Files
truecharts/charts/library/common-test
67df3235ea 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>
2025-06-07 14:47:35 +02:00
..

title
title
README

General Info

For more information about this Chart, please check the docs on the TrueCharts website

This chart is not maintained by the upstream project and any issues with the chart should be raised here

Installation

Helm-Chart installation

To install TrueCharts Helm charts using Helm, you can use our OCI Repository.

helm install mychart oci://tccr.io/truecharts/common-test

For more information on how to install TrueCharts Helm charts, checkout the instructions on the website

Chart Specific Guides and information

All our charts have dedicated documentation pages. The documentation for this chart can be found here: https://truecharts.org/charts/library/common-test

Configuration Options

To view the chart specific options, please view Values.yaml included in the chart. The most recent version of which, is available here: https://github.com/truecharts/public/blob/master/charts/library/common-test/values.yaml

All our Charts use a shared "common" library chart that contains most of the templating and options. For the complete overview of all available options, please checkout the documentation for them on the common docs on our website

For information about the common chart and all defaults included with it, please review its values.yaml file available here: https://github.com/truecharts/public/blob/master/charts/library/common/values.yaml

Support


Sponsor TrueCharts

TrueCharts can only exist due to the incredible effort of our staff. Please consider making a donation or contributing back to the project any way you can!

All Rights Reserved - The TrueCharts Project