EnvVar

io.k8s.api.core.v1.EnvVar source ↗

EnvVar represents an environment variable present in a Container.

namestring requiredName of the environment variable. May consist of any printable ASCII characters except '='.
valuestringVariable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".
valueFromEnvVarSourceSource for the environment variable's value. Cannot be used if value is not empty.
configMapKeyRefConfigMapKeySelectorSelects a key of a ConfigMap.
keystring requiredThe key to select.
namestringName of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optionalbooleanSpecify whether the ConfigMap or its key must be defined
fieldRefObjectFieldSelectorSelects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
apiVersionstringVersion of the schema the FieldPath is written in terms of, defaults to "v1".
fieldPathstring requiredPath of the field to select in the specified API version.
fileKeyRefFileKeySelectorFileKeyRef selects a key of the env file. Requires the EnvFiles feature gate to be enabled.
keystring requiredThe key within the env file. An invalid key will prevent the pod from starting. The keys defined within a source may consist of any printable ASCII characters except '='. During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
optionalbooleanSpecify whether the file or its key must be defined. If the file or key does not exist, then the env var is not published. If optional is set to true and the specified key does not exist, the environment variable will not be set in the Pod's containers.If optional is set to false and the specified key does not exist, an error will be returned during Pod creation.
pathstring requiredThe path within the volume from which to select the file. Must be relative and may not contain the '..' path or start with '..'.
volumeNamestring requiredThe name of the volume mount containing the env file.
resourceFieldRefResourceFieldSelectorSelects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
containerNamestringContainer name: required for volumes, optional for env vars
divisorQuantitySpecifies the output format of the exposed resources, defaults to "1"
resourcestring requiredRequired: resource to select
secretKeyRefSecretKeySelectorSelects a key of a secret in the pod's namespace
keystring requiredThe key of the secret to select from. Must be a valid secret key.
namestringName of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optionalbooleanSpecify whether the Secret or its key must be defined