Skip to content

Env

Appears in

  • .Values.workload.$name.podSpec.containers.$name
  • .Values.workload.$name.podSpec.initContainers.$name

env

Define env(s) for the container

Keyworkload.$name.podSpec.containers.$name.env
Typemap
Required
Helm tpl✅ (Only value)
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env: {}

env.$key

Define the env key

Keyworkload.$name.podSpec.containers.$name.env.$key
Typestring or map
Required
Helm tpl✅ (Only on value, when it’s a string)
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME: ""

env.$key.configMapKeyRef

Define variable from configMapKeyRef

Keyworkload.$name.podSpec.containers.$name.env.$key.configMapKeyRef
Typemap
Required
Helm tpl
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
configMapKeyRef: {}

env.$key.configMapKeyRef.name

Define the configMap name

Keyworkload.$name.podSpec.containers.$name.env.$key.configMapKeyRef.name
Typestring
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
configMapKeyRef:
name: some-configmap-name

env.$key.configMapKeyRef.key

Define the configMap key

Keyworkload.$name.podSpec.containers.$name.env.$key.configMapKeyRef.key
Typestring
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
configMapKeyRef:
key: some-configmap-key

env.$key.configMapKeyRef.expandObjectName

Whether to expand (adding the fullname as prefix) the configmap name

Keyworkload.$name.podSpec.containers.$name.env.$key.configMapKeyRef.expandObjectName
Typebool
Required
Helm tpl
Defaulttrue

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
configMapKeyRef:
expandObjectName: false

env.$key.secretKeyRef

Define variable from secretKeyRef

Keyworkload.$name.podSpec.containers.$name.env.$key.secretKeyRef
Typemap
Required
Helm tpl
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
secretKeyRef: {}

env.$key.secretKeyRef.name

Define the secret name

Keyworkload.$name.podSpec.containers.$name.env.$key.secretKeyRef.name
Typestring
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
secretKeyRef:
name: some-secret-name

env.$key.secretKeyRef.key

Define the secret key

Keyworkload.$name.podSpec.containers.$name.env.$key.secretKeyRef.key
Typestring
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
secretKeyRef:
key: some-secret-key

env.$key.secretKeyRef.expandObjectName

Whether to expand (adding the fullname as prefix) the secret name

Keyworkload.$name.podSpec.containers.$name.env.$key.secretKeyRef.expandObjectName
Typebool
Required
Helm tpl
Defaulttrue

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
secretKeyRef:
expandObjectName: false

env.$key.fieldRef

Define variable from fieldRef

Keyworkload.$name.podSpec.containers.$name.env.$key.fieldRef
Typemap
Required
Helm tpl
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
fieldRef: {}

env.$key.fieldRef.fieldPath

Define the field path

Keyworkload.$name.podSpec.containers.$name.env.$key.fieldRef.fieldPath
Typestring
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
fieldRef:
fieldPath: metadata.name

env.$key.fieldRef.apiVersion

Define the apiVersion

Keyworkload.$name.podSpec.containers.$name.env.$key.fieldRef.apiVersion
Typestring
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
env:
ENV_NAME:
fieldRef:
apiVersion: v1

Full Examples

workload:
workload-name:
enabled: true
primary: true
podSpec:
containers:
container-name:
enabled: true
primary: true
env:
ENV_NAME1: ENV_VALUE
ENV_NAME2: "{{ .Values.some.path }}"
ENV_NAME3:
configMapKeyRef:
# This will be expanded to 'fullname-configmap-name'
name: configmap-name
key: configmap-key
ENV_NAME4:
secretKeyRef:
name: secret-name
key: secret-key
expandObjectName: false
ENV_NAME5:
fieldRef:
fieldPath: metadata.name
apiVersion: v1