Skip to content

Service Account

Appears in

  • .Values.serviceAccount

Naming scheme

  • Primary: $FullName (release-name-chart-name)
  • Non-Primary: $FullName-$ServiceAccountName (release-name-chart-name-ServiceAccountName)

Target Selector

  • targetSelectAll (bool): Whether to assign the serviceAccount to all pods or not. targetSelector is ignored in this case
  • targetSelector (list): Define the pod(s) to assign the serviceAccount
  • targetSelector (empty): Assign the serviceAccount to the primary pod

serviceAccount

Create serviceAccount objects

KeyserviceAccount
Typemap
Required
Helm tpl
Default{}

Example

serviceAccount: {}

serviceAccount.$name

Define serviceAccount

KeyserviceAccount.$name
Typemap
Required
Helm tpl
Default{}

Example

serviceAccount:
sa-name: {}

enabled

Enables or Disables the serviceAccount

KeyserviceAccount.$name.enabled
Typebool
Required
Helm tpl
Defaultfalse

Example

serviceAccount:
sa-name:
enabled: true

primary

Sets the serviceAccount as primary

KeyserviceAccount.$name.primary
Typebool
Required
Helm tpl
Defaultfalse

Example

serviceAccount:
sa-name:
primary: true

namespace

Define the namespace for this object

KeyserviceAccount.$name.namespace
Typestring
Required
Helm tpl
Default""

Example

serviceAccount:
sa-name:
namespace: some-namespace

labels

Additional labels for service account

KeyserviceAccount.$name.labels
Typemap
Required
Helm tpl✅ (On value only)
Default{}

Example

serviceAccount:
sa-name:
labels:
key: value

annotations

Additional annotations for service account

KeyserviceAccount.$name.annotations
Typemap
Required
Helm tpl✅ (On value only)
Default{}

Example

serviceAccount:
sa-name:
annotations:
key: value

targetSelectAll

Whether to assign the serviceAccount to all pods or not

KeyserviceAccount.$name.targetSelectAll
Typebool
Required
Helm tpl
Defaultunset

Example

serviceAccount:
sa-name:
targetSelectAll: true

targetSelector

Define the pod(s) to assign the serviceAccount

KeyserviceAccount.$name.targetSelector
Typelist of string
Required
Helm tpl
Default[]

Example

serviceAccount:
sa-name:
targetSelector:
- workload-name1
- workload-name2

Full Examples

serviceAccount:
sa-name:
enabled: true
primary: true
namespace: some-namespace
labels:
key: value
keytpl: "{{ .Values.some.value }}"
annotations:
key: value
keytpl: "{{ .Values.some.value }}"
targetSelectAll: true
other-sa-name:
enabled: true
namespace: some-namespace
targetSelector:
- pod-name
- other-pod-name