feat(common): Add optional service account override to workload podSpec (#36051)

**Description**

Fixes https://github.com/truecharts/public/issues/35601

**Recommend ignoring whitespace for diff**

I'm looking for feedback on the implementation and if accepted, I will
update docs / tests as required.

Allow an optional service account name reference to workload podSpec.
This PR purposes adding new field to `workload.$name.podSpec` entitled
`overrideServiceAccountName`.

## How to Use

Add the `overrideServiceAccountName` field to your workload's `podSpec`
in your values.yaml:

```yaml
workload:
  main:
    enabled: true
    primary: true
    type: Deployment
    podSpec:
      overrideServiceAccountName: "my-service-account"
      containers:
        main:
          enabled: true
```

**⚙️ Type of change**

- [X] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code
- [ ] 📜 Documentation Changes

**🧪 How Has This Been Tested?**

Yes
```
 helm  template blah .  --set workload.main.podSpec.overrideServiceAccountName=my-service-account  -f ./default-values.yaml | grep serviceAccountName
 
 serviceAccountName: my-service-account
```

**📃 Notes:**

When `overrideServiceAccountName` is specified:
1. The chart will use this value directly as the `serviceAccountName` in
the pod spec
2. It will bypass the normal service account selection logic
3. The specified service account must already exist in the cluster
4. The service account must exist in the same namespace as the workload
5. You can still define service accounts in the chart for other
workloads

This is a useful feature when you want to share a common service account
across many pods/applications.

Side note, many other charts support this feature. The default chart
when you run `helm create` also has this feature.

**✔️ Checklist:**

- [X] ⚖️ My code follows the style guidelines of this project
- [X] 👀 I have performed a self-review of my own code
- [X] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made changes to the documentation
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [X] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or
`fix(docs):`

** App addition**

None

---

---------

Signed-off-by: Alfred Göppel <43101280+alfi0812@users.noreply.github.com>
Co-authored-by: Stavros Kois <s.kois@outlook.com>
Co-authored-by: Alfred Göppel <43101280+alfi0812@users.noreply.github.com>
This commit is contained in:
Douglas Chimento
2025-06-07 14:47:35 +02:00
committed by GitHub
co-authored by Stavros Kois Alfred Göppel
parent 1cab3eec1b
commit 67df3235ea
3 changed files with 200 additions and 102 deletions
@@ -153,6 +153,30 @@ tests:
path: spec.template.spec.serviceAccountName path: spec.template.spec.serviceAccountName
value: test-release-name-common-test value: test-release-name-common-test
- it: should assign serviceAccount to pod with explicit name
set:
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec:
serviceAccountName: some-explicit-name
serviceAccount:
sa-name1:
enabled: true
primary: true
targetSelector:
- workload-name1
asserts:
- documentIndex: &deploymentDoc 1
isKind:
of: Deployment
- documentIndex: *deploymentDoc
equal:
path: spec.template.spec.serviceAccountName
value: some-explicit-name
# Failures # Failures
- it: should fail with more than 1 SA assigned to a pod - it: should fail with more than 1 SA assigned to a pod
set: set:
@@ -175,3 +199,22 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: Expected at most 1 ServiceAccount to be assigned on a pod [workload-name1]. But [2] were assigned errorMessage: Expected at most 1 ServiceAccount to be assigned on a pod [workload-name1]. But [2] were assigned
- it: should fail with invalid name on explicit serviceAccountName
set:
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec:
serviceAccountName: some-long-name-that-exceeds-the-63-character-limit-for-kubernetes-objects
serviceAccount:
sa-name1:
enabled: true
primary: true
targetSelector:
- workload-name1
asserts:
- failedTemplate:
errorMessage: Name [some-long-name-that-exceeds-the-63-character-limit-for-kubernetes-objects] is not valid. Must start and end with an alphanumeric lowercase character. It can contain '-'. And must be at most 63 characters.
@@ -8,6 +8,21 @@ objectData: The object data to be used to render the Pod.
{{- $rootCtx := .rootCtx -}} {{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}} {{- $objectData := .objectData -}}
{{/* Check if an explicit service account name is specified in podSpec */}}
{{- with $objectData.podSpec.serviceAccountName -}}
{{- $objectName := tpl . $rootCtx -}}
{{- include "tc.v1.common.lib.chart.names.validation" (dict "name" $objectName) -}}
{{- $objectName -}}
{{- else -}}
{{/* If not, use the auto-generated service account name */}}
{{- include "tc.v1.common.lib.pod.serviceAccountName.auto" (dict "rootCtx" $rootCtx "objectData" $objectData) -}}
{{- end -}}
{{- end -}}
{{- define "tc.v1.common.lib.pod.serviceAccountName.auto" -}}
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}}
{{- $saName := "default" -}} {{- $saName := "default" -}}
{{- $saNameCount := 0 -}} {{- $saNameCount := 0 -}}
+142 -102
View File
@@ -34,8 +34,8 @@ Define workload objects
| ---------- | ---------- | | ---------- | ---------- |
| Key | `workload` | | Key | `workload` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -54,8 +54,8 @@ Define workload
| ---------- | ---------------- | | ---------- | ---------------- |
| Key | `workload.$name` | | Key | `workload.$name` |
| Type | `map` | | Type | `map` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -75,8 +75,8 @@ Enable or disable workload
| ---------- | ------------------------ | | ---------- | ------------------------ |
| Key | `workload.$name.enabled` | | Key | `workload.$name.enabled` |
| Type | `bool` | | Type | `bool` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `false` | | Default | `false` |
Example Example
@@ -97,8 +97,8 @@ Set workload as primary
| ---------- | ------------------------ | | ---------- | ------------------------ |
| Key | `workload.$name.primary` | | Key | `workload.$name.primary` |
| Type | `bool` | | Type | `bool` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `false` | | Default | `false` |
Example Example
@@ -119,8 +119,8 @@ Define labels for workload
| ---------- | ----------------------- | | ---------- | ----------------------- |
| Key | `workload.$name.labels` | | Key | `workload.$name.labels` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On value only) | | Helm `tpl` | ✅ (On value only) |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -142,8 +142,8 @@ Define annotations for workload
| ---------- | ---------------------------- | | ---------- | ---------------------------- |
| Key | `workload.$name.annotations` | | Key | `workload.$name.annotations` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On value only) | | Helm `tpl` | ✅ (On value only) |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -165,8 +165,8 @@ Define the namespace for this object
| ---------- | -------------------------- | | ---------- | -------------------------- |
| Key | `workload.$name.namespace` | | Key | `workload.$name.namespace` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On value only) | | Helm `tpl` | ✅ (On value only) |
| Default | `""` | | Default | `""` |
Example Example
@@ -187,8 +187,8 @@ Define the kind of the workload
| ---------- | --------------------- | | ---------- | --------------------- |
| Key | `workload.$name.type` | | Key | `workload.$name.type` |
| Type | `string` | | Type | `string` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `""` | | Default | `""` |
Valid values Valid values
@@ -217,8 +217,8 @@ Define the podSpec for the workload
| ---------- | ------------------------ | | ---------- | ------------------------ |
| Key | `workload.$name.podSpec` | | Key | `workload.$name.podSpec` |
| Type | `map` | | Type | `map` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -239,8 +239,8 @@ Define labels for podSpec
| ---------- | ------------------------------- | | ---------- | ------------------------------- |
| Key | `workload.$name.podSpec.labels` | | Key | `workload.$name.podSpec.labels` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On value only) | | Helm `tpl` | ✅ (On value only) |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -263,8 +263,8 @@ Define annotations for podSpec
| ---------- | ------------------------------------ | | ---------- | ------------------------------------ |
| Key | `workload.$name.podSpec.annotations` | | Key | `workload.$name.podSpec.annotations` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On value only) | | Helm `tpl` | ✅ (On value only) |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -287,8 +287,8 @@ Pod's automountServiceAccountToken
| ---------- | ------------------------------------------------------------------- | | ---------- | ------------------------------------------------------------------- |
| Key | `workload.$name.podSpec.automountServiceAccountToken` | | Key | `workload.$name.podSpec.automountServiceAccountToken` |
| Type | `bool` | | Type | `bool` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#automountserviceaccounttoken) | | Default | See default [here](/common/podoptions#automountserviceaccounttoken) |
Example Example
@@ -302,6 +302,46 @@ workload:
--- ---
##### `serviceAccountName`
:::note
Suggested is to use the top-level [serviceAccount](/common/serviceaccount/) key
to define the service account with `targetSelector`.
Using this key here, is out of our support scope.
:::
Define the service account name for the workload
| | |
| ---------- | ----------------------------------- |
| Key | `workload.$name.serviceAccountName` |
| Type | `string` |
| Required | ❌ |
| Helm `tpl` | ✅ (On value only) |
| Default | `""` |
Example
```yaml
workload:
workload-name:
serviceAccountName: some-service-account
```
Example
```yaml
workload:
workload-name:
podSpec:
serviceAccountName: some-service-account
```
---
##### `hostNetwork` ##### `hostNetwork`
Bind pod to host's network Bind pod to host's network
@@ -310,8 +350,8 @@ Bind pod to host's network
| ---------- | -------------------------------------------------- | | ---------- | -------------------------------------------------- |
| Key | `workload.$name.podSpec.hostNetwork` | | Key | `workload.$name.podSpec.hostNetwork` |
| Type | `bool` | | Type | `bool` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#hostnetwork) | | Default | See default [here](/common/podoptions#hostnetwork) |
Example Example
@@ -331,8 +371,8 @@ Allow pod to access host's PID namespace
| ---------- | ---------------------------------------------- | | ---------- | ---------------------------------------------- |
| Key | `workload.$name.podSpec.hostPID` | | Key | `workload.$name.podSpec.hostPID` |
| Type | `bool` | | Type | `bool` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#hostpid) | | Default | See default [here](/common/podoptions#hostpid) |
Example Example
@@ -354,8 +394,8 @@ Allow pod to access host's IPC namespace
| ---------- | ---------------------------------------------- | | ---------- | ---------------------------------------------- |
| Key | `workload.$name.podSpec.hostIPC` | | Key | `workload.$name.podSpec.hostIPC` |
| Type | `bool` | | Type | `bool` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#hostipc) | | Default | See default [here](/common/podoptions#hostipc) |
Example Example
@@ -377,8 +417,8 @@ Allow pod to access host's users namespace
| ---------- | ------------------------------------------------ | | ---------- | ------------------------------------------------ |
| Key | `workload.$name.podSpec.hostUsers` | | Key | `workload.$name.podSpec.hostUsers` |
| Type | `bool` | | Type | `bool` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#hostusers) | | Default | See default [here](/common/podoptions#hostusers) |
Example Example
@@ -400,8 +440,8 @@ Share Process Namespace with other containers in the pod
| ---------- | ------------------------------------------------------------ | | ---------- | ------------------------------------------------------------ |
| Key | `workload.$name.podSpec.shareProcessNamespace` | | Key | `workload.$name.podSpec.shareProcessNamespace` |
| Type | `bool` | | Type | `bool` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#shareprocessnamespace) | | Default | See default [here](/common/podoptions#shareprocessnamespace) |
Example Example
@@ -423,8 +463,8 @@ Pod's enableServiceLinks
| ---------- | --------------------------------------------------------- | | ---------- | --------------------------------------------------------- |
| Key | `workload.$name.podSpec.enableServiceLinks` | | Key | `workload.$name.podSpec.enableServiceLinks` |
| Type | `bool` | | Type | `bool` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#enableservicelinks) | | Default | See default [here](/common/podoptions#enableservicelinks) |
Example Example
@@ -446,8 +486,8 @@ Pod's restartPolicy
| ---------- | ---------------------------------------------------- | | ---------- | ---------------------------------------------------- |
| Key | `workload.$name.podSpec.restartPolicy` | | Key | `workload.$name.podSpec.restartPolicy` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | See default [here](/common/podoptions#restartpolicy) | | Default | See default [here](/common/podoptions#restartpolicy) |
Valid values Valid values
@@ -475,8 +515,8 @@ Pod's schedulerName
| ---------- | ---------------------------------------------------- | | ---------- | ---------------------------------------------------- |
| Key | `workload.$name.podSpec.schedulerName` | | Key | `workload.$name.podSpec.schedulerName` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | See default [here](/common/podoptions#schedulername) | | Default | See default [here](/common/podoptions#schedulername) |
Example Example
@@ -498,8 +538,8 @@ Pod's priorityClassName
| ---------- | -------------------------------------------------------- | | ---------- | -------------------------------------------------------- |
| Key | `workload.$name.podSpec.priorityClassName` | | Key | `workload.$name.podSpec.priorityClassName` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | See default [here](/common/podoptions#priorityclassname) | | Default | See default [here](/common/podoptions#priorityclassname) |
Example Example
@@ -521,8 +561,8 @@ Pod's hostname
| ---------- | --------------------------------- | | ---------- | --------------------------------- |
| Key | `workload.$name.podSpec.hostname` | | Key | `workload.$name.podSpec.hostname` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -544,8 +584,8 @@ Pod's terminationGracePeriodSeconds
| ---------- | -------------------------------------------------------------------- | | ---------- | -------------------------------------------------------------------- |
| Key | `workload.$name.podSpec.terminationGracePeriodSeconds` | | Key | `workload.$name.podSpec.terminationGracePeriodSeconds` |
| Type | `int` | | Type | `int` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | See default [here](/common/podoptions#terminationgraceperiodseconds) | | Default | See default [here](/common/podoptions#terminationgraceperiodseconds) |
Example Example
@@ -567,8 +607,8 @@ Pod's nodeSelector
| ---------- | --------------------------------------------------- | | ---------- | --------------------------------------------------- |
| Key | `workload.$name.podSpec.nodeSelector` | | Key | `workload.$name.podSpec.nodeSelector` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On value only) | | Helm `tpl` | ✅ (On value only) |
| Default | See default [here](/common/podoptions#nodeselector) | | Default | See default [here](/common/podoptions#nodeselector) |
Example Example
@@ -591,8 +631,8 @@ Pod's topologySpreadConstraints
| ---------- | ---------------------------------------------------------------- | | ---------- | ---------------------------------------------------------------- |
| Key | `workload.$name.podSpec.topologySpreadConstraints` | | Key | `workload.$name.podSpec.topologySpreadConstraints` |
| Type | `list` of `map` | | Type | `list` of `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#topologyspreadconstraints) | | Default | See default [here](/common/podoptions#topologyspreadconstraints) |
--- ---
@@ -605,8 +645,8 @@ Pod's hostAliases
| ---------- | -------------------------------------------------- | | ---------- | -------------------------------------------------- |
| Key | `workload.$name.podSpec.hostAliases` | | Key | `workload.$name.podSpec.hostAliases` |
| Type | `list` of `map` | | Type | `list` of `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#hostaliases) | | Default | See default [here](/common/podoptions#hostaliases) |
Example Example
@@ -628,8 +668,8 @@ Pod's hostAliases ip
| ---------- | --------------------------------------- | | ---------- | --------------------------------------- |
| Key | `workload.$name.podSpec.hostAliases.ip` | | Key | `workload.$name.podSpec.hostAliases.ip` |
| Type | `string` | | Type | `string` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -652,8 +692,8 @@ Pod's hostAliases hostnames
| ---------- | ---------------------------------------------- | | ---------- | ---------------------------------------------- |
| Key | `workload.$name.podSpec.hostAliases.hostnames` | | Key | `workload.$name.podSpec.hostAliases.hostnames` |
| Type | `list` of `string` | | Type | `list` of `string` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ✅ (On each entry) | | Helm `tpl` | ✅ (On each entry) |
| Default | `[]` | | Default | `[]` |
Example Example
@@ -685,8 +725,8 @@ Pod's dnsPolicy
| ---------- | ------------------------------------------------ | | ---------- | ------------------------------------------------ |
| Key | `workload.$name.podSpec.dnsPolicy` | | Key | `workload.$name.podSpec.dnsPolicy` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | See default [here](/common/podoptions#dnspolicy) | | Default | See default [here](/common/podoptions#dnspolicy) |
Valid values Valid values
@@ -715,8 +755,8 @@ Pod's dnsConfig
| ---------- | ------------------------------------------------ | | ---------- | ------------------------------------------------ |
| Key | `workload.$name.podSpec.dnsConfig` | | Key | `workload.$name.podSpec.dnsConfig` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#dnsconfig) | | Default | See default [here](/common/podoptions#dnsconfig) |
Example Example
@@ -738,8 +778,8 @@ Pod's dnsConfig nameservers
| ---------- | ---------------------------------------------- | | ---------- | ---------------------------------------------- |
| Key | `workload.$name.podSpec.dnsConfig.nameservers` | | Key | `workload.$name.podSpec.dnsConfig.nameservers` |
| Type | `list` of `string` | | Type | `list` of `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On each entry) | | Helm `tpl` | ✅ (On each entry) |
| Default | `[]` | | Default | `[]` |
Example Example
@@ -763,8 +803,8 @@ Pod's dnsConfig searches
| ---------- | ------------------------------------------- | | ---------- | ------------------------------------------- |
| Key | `workload.$name.podSpec.dnsConfig.searches` | | Key | `workload.$name.podSpec.dnsConfig.searches` |
| Type | `list` of `string` | | Type | `list` of `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ (On each entry) | | Helm `tpl` | ✅ (On each entry) |
| Default | `[]` | | Default | `[]` |
Example Example
@@ -788,8 +828,8 @@ Pod's dnsConfig options
| ---------- | ------------------------------------------ | | ---------- | ------------------------------------------ |
| Key | `workload.$name.podSpec.dnsConfig.options` | | Key | `workload.$name.podSpec.dnsConfig.options` |
| Type | `list` of `map` | | Type | `list` of `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `[{"ndots": "1"}]` | | Default | `[{"ndots": "1"}]` |
Example Example
@@ -812,8 +852,8 @@ Pod's dnsConfig options name
| ---------- | ----------------------------------------------- | | ---------- | ----------------------------------------------- |
| Key | `workload.$name.podSpec.dnsConfig.options.name` | | Key | `workload.$name.podSpec.dnsConfig.options.name` |
| Type | `string` | | Type | `string` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -838,8 +878,8 @@ Pod's dnsConfig options value
| ---------- | ------------------------------------------------ | | ---------- | ------------------------------------------------ |
| Key | `workload.$name.podSpec.dnsConfig.options.value` | | Key | `workload.$name.podSpec.dnsConfig.options.value` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -864,8 +904,8 @@ Pod's tolerations
| ---------- | -------------------------------------------------- | | ---------- | -------------------------------------------------- |
| Key | `workload.$name.podSpec.tolerations` | | Key | `workload.$name.podSpec.tolerations` |
| Type | `list` of `map` | | Type | `list` of `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/podoptions#tolerations) | | Default | See default [here](/common/podoptions#tolerations) |
Example Example
@@ -887,8 +927,8 @@ Pod's tolerations operator
| ---------- | --------------------------------------------- | | ---------- | --------------------------------------------- |
| Key | `workload.$name.podSpec.tolerations.operator` | | Key | `workload.$name.podSpec.tolerations.operator` |
| Type | `string` | | Type | `string` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Valid values Valid values
@@ -922,8 +962,8 @@ Required only when `operator` = `Equal`
| ---------- | ---------------------------------------- | | ---------- | ---------------------------------------- |
| Key | `workload.$name.podSpec.tolerations.key` | | Key | `workload.$name.podSpec.tolerations.key` |
| Type | `string` | | Type | `string` |
| Required | ❌/✅ | | Required | ❌/✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -953,8 +993,8 @@ Required only when `operator` = `Equal`
| ---------- | ------------------------------------------ | | ---------- | ------------------------------------------ |
| Key | `workload.$name.podSpec.tolerations.value` | | Key | `workload.$name.podSpec.tolerations.value` |
| Type | `string` | | Type | `string` |
| Required | ❌/✅ | | Required | ❌/✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -979,8 +1019,8 @@ Pod's tolerations effect
| ---------- | ------------------------------------------- | | ---------- | ------------------------------------------- |
| Key | `workload.$name.podSpec.tolerations.effect` | | Key | `workload.$name.podSpec.tolerations.effect` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Valid values Valid values
@@ -1010,8 +1050,8 @@ Pod's tolerations tolerationSeconds
| ---------- | ------------------------------------------------------ | | ---------- | ------------------------------------------------------ |
| Key | `workload.$name.podSpec.tolerations.tolerationSeconds` | | Key | `workload.$name.podSpec.tolerations.tolerationSeconds` |
| Type | `int` | | Type | `int` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | unset | | Default | unset |
Example Example
@@ -1042,8 +1082,8 @@ Pod's runtimeClassName
| ---------- | ------------------------------------------------------- | | ---------- | ------------------------------------------------------- |
| Key | `workload.$name.podSpec.runtimeClassName` | | Key | `workload.$name.podSpec.runtimeClassName` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | See default [here](/common/podoptions#runtimeclassname) | | Default | See default [here](/common/podoptions#runtimeclassname) |
Example Example
@@ -1065,8 +1105,8 @@ Pod's securityContext
| ---------- | -------------------------------------------------------------- | | ---------- | -------------------------------------------------------------- |
| Key | `workload.$name.podSpec.securityContext` | | Key | `workload.$name.podSpec.securityContext` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/securitycontext#securitycontextpod) | | Default | See default [here](/common/securitycontext#securitycontextpod) |
Default Default
@@ -1099,8 +1139,8 @@ Pod's securityContext fsGroup
| ---------- | ---------------------------------------------------------------------- | | ---------- | ---------------------------------------------------------------------- |
| Key | `workload.$name.podSpec.securityContext.fsGroup` | | Key | `workload.$name.podSpec.securityContext.fsGroup` |
| Type | `int` | | Type | `int` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/securitycontext/#securitycontextpodfsgroup) | | Default | See default [here](/common/securitycontext/#securitycontextpodfsgroup) |
Example Example
@@ -1123,8 +1163,8 @@ Pod's securityContext fsGroupChangePolicy
| ---------- | --------------------------------------------------------------------------------- | | ---------- | --------------------------------------------------------------------------------- |
| Key | `workload.$name.podSpec.securityContext.fsGroupChangePolicy` | | Key | `workload.$name.podSpec.securityContext.fsGroupChangePolicy` |
| Type | `string` | | Type | `string` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/securitycontext#securitycontextpodfsgroupchangepolicy) | | Default | See default [here](/common/securitycontext#securitycontextpodfsgroupchangepolicy) |
Valid values Valid values
@@ -1152,8 +1192,8 @@ Pod's securityContext supplementalGroups
| ---------- | -------------------------------------------------------------------------------- | | ---------- | -------------------------------------------------------------------------------- |
| Key | `workload.$name.podSpec.securityContext.supplementalGroups` | | Key | `workload.$name.podSpec.securityContext.supplementalGroups` |
| Type | `list` of `int` | | Type | `list` of `int` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/securitycontext#securitycontextpodsupplementalgroups) | | Default | See default [here](/common/securitycontext#securitycontextpodsupplementalgroups) |
Example Example
@@ -1183,8 +1223,8 @@ to the pod. When hostNetwork is enabled the above **sysctl** option will not be
| ---------- | --------------------------------------------------------------------- | | ---------- | --------------------------------------------------------------------- |
| Key | `workload.$name.podSpec.securityContext.sysctls` | | Key | `workload.$name.podSpec.securityContext.sysctls` |
| Type | `list` of `map` | | Type | `list` of `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | See default [here](/common/securitycontext#securitycontextpodsysctls) | | Default | See default [here](/common/securitycontext#securitycontextpodsysctls) |
Example Example
@@ -1207,8 +1247,8 @@ Pod's securityContext sysctls name
| ---------- | ----------------------------------------------------- | | ---------- | ----------------------------------------------------- |
| Key | `workload.$name.podSpec.securityContext.sysctls.name` | | Key | `workload.$name.podSpec.securityContext.sysctls.name` |
| Type | `string` | | Type | `string` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -1233,8 +1273,8 @@ Pod's securityContext sysctls value
| ---------- | ------------------------------------------------------ | | ---------- | ------------------------------------------------------ |
| Key | `workload.$name.podSpec.securityContext.sysctls.value` | | Key | `workload.$name.podSpec.securityContext.sysctls.value` |
| Type | `string` | | Type | `string` |
| Required | ✅ | | Required | ✅ |
| Helm `tpl` | ✅ | | Helm `tpl` | ✅ |
| Default | `""` | | Default | `""` |
Example Example
@@ -1261,8 +1301,8 @@ See [Container](/common/container/) for more information
| ---------- | --------------------------- | | ---------- | --------------------------- |
| Key | `workload.$name.containers` | | Key | `workload.$name.containers` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `{}` | | Default | `{}` |
Example Example
@@ -1285,8 +1325,8 @@ See [Container](/common/container/) for more information
| ---------- | ------------------------------- | | ---------- | ------------------------------- |
| Key | `workload.$name.initContainers` | | Key | `workload.$name.initContainers` |
| Type | `map` | | Type | `map` |
| Required | ❌ | | Required | ❌ |
| Helm `tpl` | ❌ | | Helm `tpl` | ❌ |
| Default | `{}` | | Default | `{}` |
Example Example