Package io.quarkus.kubernetes.deployment
Class KubernetesConfig
- java.lang.Object
-
- io.quarkus.kubernetes.deployment.KubernetesConfig
-
- All Implemented Interfaces:
EnvVarHolder,PlatformConfiguration
@ConfigRoot public class KubernetesConfig extends Object implements PlatformConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKubernetesConfig.DeploymentResourceKind
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanaddBuildTimestampWhether to add the build timestamp to the Kubernetes annotations This is a very useful way to have manifests of successive builds of the same application differ - thus ensuring that Kubernetes will apply the updated resources(package private) booleanaddNameToLabelSelectorsIf true, the 'app.kubernetes.io/name' label will be part of the selectors of Service and Deployment(package private) booleanaddVersionToLabelSelectorsIf true, the 'app.kubernetes.io/version' label will be part of the selectors of Service and Deployment(package private) Map<String,String>annotationsCustom annotations to add to all resources(package private) Optional<String>appConfigMapIf set, the config map will be mounted to the application container and its contents will be used for application configuration.(package private) Optional<String>appSecretIf set, the secret will mounted to the application container and its contents will be used for application configuration.(package private) Optional<List<String>>argumentsThe arguments(package private) Map<String,AwsElasticBlockStoreVolumeConfig>awsElasticBlockStoreVolumesAWS Elastic BlockStore volumes(package private) Map<String,AzureDiskVolumeConfig>azureDiskVolumesAzure disk volumes(package private) Map<String,AzureFileVolumeConfig>azureFileVolumesAzure file volumes(package private) Optional<List<String>>commandThe commands(package private) Map<String,ConfigMapVolumeConfig>configMapVolumesConfigMap volumes(package private) Optional<String>containerNameIf set, it will change the name of the container according to the configuration(package private) CronJobConfigcronJobCronJob configuration.(package private) booleandeployIf set to true, Quarkus will attempt to deploy the application to the target Kubernetes cluster(package private) Optional<KubernetesConfig.DeploymentResourceKind>deploymentKindThe kind of the deployment resource to use.(package private) Optional<List<String>>deploymentTargetThe target deployment platform.(package private) DeployStrategydeployStrategyIf deploy is enabled, it will follow this strategy to update the resources to the target Kubernetes cluster.(package private) Optional<List<String>>emptyDirVolumesEmptyDir volumes(package private) EnvVarsConfigenvEnvironment variables to add to all containers.(package private) Map<String,EnvConfig>envVarsDeprecated.Useenvinstead using the new syntax as follows:quarkus.kubernetes.env-vars.foo.field=fieldNamebecomesquarkus.kubernetes.env.fields.foo=fieldNamequarkus.kubernetes.env-vars.foo.value=valuebecomesquarkus.kubernetes.env.vars.foo=barquarkus.kubernetes.env-vars.bar.configmap=configNamebecomesquarkus.kubernetes.env.configmaps=configNamequarkus.kubernetes.env-vars.baz.secret=secretNamebecomesquarkus.kubernetes.env.secrets=secretName(package private) booleanexternalizeInitFlag to enable init task externalization.(package private) Map<String,GitRepoVolumeConfig>gitRepoVolumesGit Repository volumes(package private) Map<String,HostAliasConfig>hostAliasesThe host aliases(package private) booleanidempotentSwitch used to control whether non-idempotent fields are included in generated kubernetes resources to improve git-ops compatibility(package private) io.dekorate.kubernetes.annotation.ImagePullPolicyimagePullPolicyImage pull policy(package private) Optional<List<String>>imagePullSecretsThe image pull secret(package private) IngressConfigingressIngress configuration(package private) Map<String,ContainerConfig>initContainersInit containers(package private) JobConfigjobJob configuration.(package private) Map<String,String>labelsCustom labels to add to all resources(package private) ProbeConfiglivenessProbeThe liveness probe(package private) Map<String,MountConfig>mountsVolume mounts(package private) Optional<String>nameThe name of the application.(package private) Optional<String>namespaceThe namespace the generated resources should belong to.(package private) OptionalIntnodePortThe nodePort to set when serviceType is set to node-port.(package private) Optional<String>outputDirectoryOptionally set directory generated kubernetes resources will be written to.(package private) Optional<String>partOfThe name of the group this component belongs too(package private) Map<String,PortConfig>portsThe application ports(package private) PrometheusConfigprometheusPrometheus configuration(package private) Map<String,PvcVolumeConfig>pvcVolumesPersistent Volume Claim volumes(package private) RbacConfigrbacRBAC configuration(package private) ProbeConfigreadinessProbeThe readiness probe(package private) DebugConfigremoteDebugDebug configuration to be set in pods.(package private) IntegerreplicasThe number of desired pods(package private) ResourcesConfigresourcesResources requirements(package private) Map<String,SecretVolumeConfig>secretVolumesSecret volumes(package private) SecurityContextConfigsecurityContextIf set, it will copy the security context configuration provided into the generated pod settings.(package private) Optional<String>serviceAccountThe service account(package private) io.dekorate.kubernetes.annotation.ServiceTypeserviceTypeThe type of service that will be generated for the application(package private) Map<String,ContainerConfig>sidecarsSidecar containers(package private) ProbeConfigstartupProbeThe startup probe(package private) Optional<String>versionThe version of the application.(package private) Optional<String>workingDirWorking directory
-
Constructor Summary
Constructors Constructor Description KubernetesConfig()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.kubernetes.deployment.EnvVarHolder
convertToBuildItems
-
Methods inherited from interface io.quarkus.kubernetes.deployment.PlatformConfiguration
getConfigName
-
-
-
-
Field Detail
-
name
@ConfigItem(defaultValue="${quarkus.container-image.name}") Optional<String> nameThe name of the application. This value will be used for naming Kubernetes resources like: - Deployment - Service and so on ...
-
version
@ConfigItem(defaultValue="${quarkus.container-image.tag}") Optional<String> versionThe version of the application.
-
deploymentKind
@ConfigItem Optional<KubernetesConfig.DeploymentResourceKind> deploymentKind
The kind of the deployment resource to use. Supported values are 'StatefulSet', 'Job', 'CronJob' and 'Deployment' defaulting to the latter.
-
namespace
@ConfigItem Optional<String> namespace
The namespace the generated resources should belong to. If not value is set, then the 'namespace' field will not be added to the 'metadata' section of the generated manifests. This in turn means that when the manifests are applied to a cluster, the namespace will be resolved from the current Kubernetes context (see https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context for more details).
-
addBuildTimestamp
@ConfigItem(defaultValue="true") boolean addBuildTimestamp
Whether to add the build timestamp to the Kubernetes annotations This is a very useful way to have manifests of successive builds of the same application differ - thus ensuring that Kubernetes will apply the updated resources
-
ports
@ConfigItem Map<String,PortConfig> ports
The application ports
-
replicas
@ConfigItem(defaultValue="1") Integer replicas
The number of desired pods
-
serviceType
@ConfigItem(defaultValue="ClusterIP") io.dekorate.kubernetes.annotation.ServiceType serviceType
The type of service that will be generated for the application
-
nodePort
@ConfigItem OptionalInt nodePort
The nodePort to set when serviceType is set to node-port.
-
imagePullPolicy
@ConfigItem(defaultValue="Always") io.dekorate.kubernetes.annotation.ImagePullPolicy imagePullPolicy
Image pull policy
-
livenessProbe
@ConfigItem ProbeConfig livenessProbe
The liveness probe
-
readinessProbe
@ConfigItem ProbeConfig readinessProbe
The readiness probe
-
startupProbe
@ConfigItem ProbeConfig startupProbe
The startup probe
-
prometheus
@ConfigItem PrometheusConfig prometheus
Prometheus configuration
-
mounts
@ConfigItem Map<String,MountConfig> mounts
Volume mounts
-
secretVolumes
@ConfigItem Map<String,SecretVolumeConfig> secretVolumes
Secret volumes
-
configMapVolumes
@ConfigItem Map<String,ConfigMapVolumeConfig> configMapVolumes
ConfigMap volumes
-
gitRepoVolumes
@ConfigItem Map<String,GitRepoVolumeConfig> gitRepoVolumes
Git Repository volumes
-
pvcVolumes
@ConfigItem Map<String,PvcVolumeConfig> pvcVolumes
Persistent Volume Claim volumes
-
awsElasticBlockStoreVolumes
@ConfigItem Map<String,AwsElasticBlockStoreVolumeConfig> awsElasticBlockStoreVolumes
AWS Elastic BlockStore volumes
-
azureFileVolumes
@ConfigItem Map<String,AzureFileVolumeConfig> azureFileVolumes
Azure file volumes
-
azureDiskVolumes
@ConfigItem Map<String,AzureDiskVolumeConfig> azureDiskVolumes
Azure disk volumes
-
initContainers
@ConfigItem Map<String,ContainerConfig> initContainers
Init containers
-
sidecars
@ConfigItem Map<String,ContainerConfig> sidecars
Sidecar containers
-
deploymentTarget
@ConfigItem Optional<List<String>> deploymentTarget
The target deployment platform. Defaults to kubernetes. Can be kubernetes, openshift, knative, minikube etc., or any combination of the above as comma separated list.
-
hostAliases
@ConfigItem(name="hostaliases") Map<String,HostAliasConfig> hostAliases
The host aliases
-
resources
@ConfigItem ResourcesConfig resources
Resources requirements
-
rbac
RbacConfig rbac
RBAC configuration
-
ingress
IngressConfig ingress
Ingress configuration
-
job
JobConfig job
Job configuration. It's only used if and only ifquarkus.kubernetes.deployment-kindis `Job`.
-
cronJob
CronJobConfig cronJob
CronJob configuration. It's only used if and only ifquarkus.kubernetes.deployment-kindis `CronJob`.
-
addVersionToLabelSelectors
@ConfigItem(defaultValue="true") boolean addVersionToLabelSelectors
If true, the 'app.kubernetes.io/version' label will be part of the selectors of Service and Deployment
-
addNameToLabelSelectors
@ConfigItem(defaultValue="true") boolean addNameToLabelSelectors
If true, the 'app.kubernetes.io/name' label will be part of the selectors of Service and Deployment
-
deploy
@ConfigItem(defaultValue="false") boolean deploy
If set to true, Quarkus will attempt to deploy the application to the target Kubernetes cluster
-
deployStrategy
@ConfigItem(defaultValue="CreateOrUpdate") DeployStrategy deployStrategy
If deploy is enabled, it will follow this strategy to update the resources to the target Kubernetes cluster.
-
appSecret
@ConfigItem Optional<String> appSecret
If set, the secret will mounted to the application container and its contents will be used for application configuration.
-
appConfigMap
@ConfigItem Optional<String> appConfigMap
If set, the config map will be mounted to the application container and its contents will be used for application configuration.
-
securityContext
@ConfigItem SecurityContextConfig securityContext
If set, it will copy the security context configuration provided into the generated pod settings.
-
containerName
@ConfigItem Optional<String> containerName
If set, it will change the name of the container according to the configuration
-
remoteDebug
DebugConfig remoteDebug
Debug configuration to be set in pods.
-
externalizeInit
@ConfigItem(defaultValue="true") boolean externalizeInit
Flag to enable init task externalization. When enabled (default), all initialization tasks created by extensions, will be externalized as Jobs. In addition the deployment will wait for these jobs.
-
idempotent
@ConfigItem(defaultValue="false") boolean idempotent
Switch used to control whether non-idempotent fields are included in generated kubernetes resources to improve git-ops compatibility
-
outputDirectory
@ConfigItem Optional<String> outputDirectory
Optionally set directory generated kubernetes resources will be written to. Default is `target/kubernetes`.
-
envVars
@ConfigItem @Deprecated Map<String,EnvConfig> envVars
Deprecated.Useenvinstead using the new syntax as follows:quarkus.kubernetes.env-vars.foo.field=fieldNamebecomesquarkus.kubernetes.env.fields.foo=fieldNamequarkus.kubernetes.env-vars.foo.value=valuebecomesquarkus.kubernetes.env.vars.foo=barquarkus.kubernetes.env-vars.bar.configmap=configNamebecomesquarkus.kubernetes.env.configmaps=configNamequarkus.kubernetes.env-vars.baz.secret=secretNamebecomesquarkus.kubernetes.env.secrets=secretName
Environment variables to add to all containers using the old syntax.
-
env
@ConfigItem EnvVarsConfig env
Environment variables to add to all containers.
-
-
Method Detail
-
getPartOf
public Optional<String> getPartOf()
- Specified by:
getPartOfin interfacePlatformConfiguration
-
getName
public Optional<String> getName()
- Specified by:
getNamein interfacePlatformConfiguration
-
getVersion
public Optional<String> getVersion()
- Specified by:
getVersionin interfacePlatformConfiguration
-
getNamespace
public Optional<String> getNamespace()
- Specified by:
getNamespacein interfacePlatformConfiguration
-
getLabels
public Map<String,String> getLabels()
- Specified by:
getLabelsin interfacePlatformConfiguration
-
getAnnotations
public Map<String,String> getAnnotations()
- Specified by:
getAnnotationsin interfacePlatformConfiguration
-
isAddBuildTimestamp
public boolean isAddBuildTimestamp()
- Specified by:
isAddBuildTimestampin interfacePlatformConfiguration
-
isAddNameToLabelSelectors
public boolean isAddNameToLabelSelectors()
- Specified by:
isAddNameToLabelSelectorsin interfacePlatformConfiguration
-
isAddVersionToLabelSelectors
public boolean isAddVersionToLabelSelectors()
- Specified by:
isAddVersionToLabelSelectorsin interfacePlatformConfiguration
-
getTargetPlatformName
public String getTargetPlatformName()
Description copied from interface:EnvVarHolderSpecifies which the name of the platform this EnvVarHolder targets. This name, when needed, is used by dekorate to generate the descriptor associated with the targeted deployment platform.- Specified by:
getTargetPlatformNamein interfaceEnvVarHolder- Returns:
- the name of the targeted platform e.g.
Constants.KUBERNETES
-
getEnvVars
@Deprecated public Map<String,EnvConfig> getEnvVars()
Deprecated.- Specified by:
getEnvVarsin interfaceEnvVarHolder
-
getEnv
public EnvVarsConfig getEnv()
Description copied from interface:EnvVarHolderRetrieves the definition of environment variables to add to the application's container.- Specified by:
getEnvin interfaceEnvVarHolder- Returns:
- the associated
EnvVarsConfigholding the definition of which environment variables to add
-
getWorkingDir
public Optional<String> getWorkingDir()
- Specified by:
getWorkingDirin interfacePlatformConfiguration
-
getCommand
public Optional<List<String>> getCommand()
- Specified by:
getCommandin interfacePlatformConfiguration
-
getArguments
public Optional<List<String>> getArguments()
- Specified by:
getArgumentsin interfacePlatformConfiguration
-
getServiceAccount
public Optional<String> getServiceAccount()
- Specified by:
getServiceAccountin interfacePlatformConfiguration
-
getContainerName
public Optional<String> getContainerName()
- Specified by:
getContainerNamein interfacePlatformConfiguration
-
getPorts
public Map<String,PortConfig> getPorts()
- Specified by:
getPortsin interfacePlatformConfiguration
-
getReplicas
public Integer getReplicas()
-
getServiceType
public io.dekorate.kubernetes.annotation.ServiceType getServiceType()
- Specified by:
getServiceTypein interfacePlatformConfiguration
-
getNodePort
public OptionalInt getNodePort()
-
getImagePullPolicy
public io.dekorate.kubernetes.annotation.ImagePullPolicy getImagePullPolicy()
- Specified by:
getImagePullPolicyin interfacePlatformConfiguration
-
getImagePullSecrets
public Optional<List<String>> getImagePullSecrets()
- Specified by:
getImagePullSecretsin interfacePlatformConfiguration
-
getLivenessProbe
public ProbeConfig getLivenessProbe()
- Specified by:
getLivenessProbein interfacePlatformConfiguration
-
getReadinessProbe
public ProbeConfig getReadinessProbe()
- Specified by:
getReadinessProbein interfacePlatformConfiguration
-
getStartupProbe
public ProbeConfig getStartupProbe()
- Specified by:
getStartupProbein interfacePlatformConfiguration
-
getPrometheusConfig
public PrometheusConfig getPrometheusConfig()
- Specified by:
getPrometheusConfigin interfacePlatformConfiguration
-
getMounts
public Map<String,MountConfig> getMounts()
- Specified by:
getMountsin interfacePlatformConfiguration
-
getSecretVolumes
public Map<String,SecretVolumeConfig> getSecretVolumes()
- Specified by:
getSecretVolumesin interfacePlatformConfiguration
-
getConfigMapVolumes
public Map<String,ConfigMapVolumeConfig> getConfigMapVolumes()
- Specified by:
getConfigMapVolumesin interfacePlatformConfiguration
-
getEmptyDirVolumes
public List<String> getEmptyDirVolumes()
- Specified by:
getEmptyDirVolumesin interfacePlatformConfiguration
-
getGitRepoVolumes
public Map<String,GitRepoVolumeConfig> getGitRepoVolumes()
- Specified by:
getGitRepoVolumesin interfacePlatformConfiguration
-
getPvcVolumes
public Map<String,PvcVolumeConfig> getPvcVolumes()
- Specified by:
getPvcVolumesin interfacePlatformConfiguration
-
getAwsElasticBlockStoreVolumes
public Map<String,AwsElasticBlockStoreVolumeConfig> getAwsElasticBlockStoreVolumes()
- Specified by:
getAwsElasticBlockStoreVolumesin interfacePlatformConfiguration
-
getAzureFileVolumes
public Map<String,AzureFileVolumeConfig> getAzureFileVolumes()
- Specified by:
getAzureFileVolumesin interfacePlatformConfiguration
-
getAzureDiskVolumes
public Map<String,AzureDiskVolumeConfig> getAzureDiskVolumes()
- Specified by:
getAzureDiskVolumesin interfacePlatformConfiguration
-
getInitContainers
public Map<String,ContainerConfig> getInitContainers()
- Specified by:
getInitContainersin interfacePlatformConfiguration
-
getSidecars
public Map<String,ContainerConfig> getSidecars()
- Specified by:
getSidecarsin interfacePlatformConfiguration
-
getHostAliases
public Map<String,HostAliasConfig> getHostAliases()
- Specified by:
getHostAliasesin interfacePlatformConfiguration
-
getResources
public ResourcesConfig getResources()
- Specified by:
getResourcesin interfacePlatformConfiguration
-
getAppSecret
public Optional<String> getAppSecret()
- Specified by:
getAppSecretin interfacePlatformConfiguration
-
getAppConfigMap
public Optional<String> getAppConfigMap()
- Specified by:
getAppConfigMapin interfacePlatformConfiguration
-
getSecurityContext
public SecurityContextConfig getSecurityContext()
- Specified by:
getSecurityContextin interfacePlatformConfiguration
-
isIdempotent
public boolean isIdempotent()
- Specified by:
isIdempotentin interfacePlatformConfiguration
-
getDeployStrategy
public DeployStrategy getDeployStrategy()
-
getRbacConfig
public RbacConfig getRbacConfig()
- Specified by:
getRbacConfigin interfacePlatformConfiguration
-
getDeploymentResourceKind
public KubernetesConfig.DeploymentResourceKind getDeploymentResourceKind(io.quarkus.deployment.Capabilities capabilities)
-
-