Add ability to customize the service account name.

This commit is contained in:
Yi Hong
2026-03-19 14:36:51 -04:00
parent 0f5dc3a2d0
commit 424dee1895
4 changed files with 18 additions and 0 deletions

View File

@ -76,6 +76,7 @@ You should be good to go!
| `statefulset.dind.extraEnvs` | Allows adding custom environment variables, such as `DOCKER_IPTABLES_LEGACY` | `[]` | | `statefulset.dind.extraEnvs` | Allows adding custom environment variables, such as `DOCKER_IPTABLES_LEGACY` | `[]` |
| `statefulset.persistence.size` | Size for persistence to store act runner data | `1Gi` | | `statefulset.persistence.size` | Size for persistence to store act runner data | `1Gi` |
| `statefulset.securityContext` | Customize the SecurityContext | `{}` | | `statefulset.securityContext` | Customize the SecurityContext | `{}` |
| `statefulset.serviceAccountName` | Customize the service account name | `{}` |
| `existingSecret` | Secret that contains the token | `""` | | `existingSecret` | Secret that contains the token | `""` |
| `existingSecretKey` | Secret key | `""` | | `existingSecretKey` | Secret key | `""` |
| `giteaRootURL` | URL the act_runner registers and connect with | `""` | | `giteaRootURL` | URL the act_runner registers and connect with | `""` |

View File

@ -30,6 +30,9 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.statefulset.serviceAccountName }}
serviceAccountName: {{ .Values.statefulset.serviceAccountName }}
{{- end }}
securityContext: securityContext:
{{- toYaml .Values.statefulset.securityContext | nindent 8 }} {{- toYaml .Values.statefulset.securityContext | nindent 8 }}
initContainers: initContainers:

View File

@ -461,3 +461,15 @@ tests:
echo "Trying again in 3 seconds..." echo "Trying again in 3 seconds..."
done done
echo "Gitea has been reached!" echo "Gitea has been reached!"
- it: should render service account name correctly
template: templates/statefulset.yaml
set:
enabled: true
statefulset:
serviceAccountName: "my-service-account"
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.template.spec.serviceAccountName
value: "my-service-account"

View File

@ -32,6 +32,7 @@
## @param statefulset.dind.extraEnvs Allows adding custom environment variables, such as `DOCKER_IPTABLES_LEGACY` ## @param statefulset.dind.extraEnvs Allows adding custom environment variables, such as `DOCKER_IPTABLES_LEGACY`
## @param statefulset.persistence.size Size for persistence to store act runner data ## @param statefulset.persistence.size Size for persistence to store act runner data
## @param statefulset.securityContext Customize the SecurityContext ## @param statefulset.securityContext Customize the SecurityContext
## @param statefulset.serviceAccountName Customize the service account name
## @param existingSecret Secret that contains the token ## @param existingSecret Secret that contains the token
## @param existingSecretKey Secret key ## @param existingSecretKey Secret key
## @param giteaRootURL URL the act_runner registers and connect with ## @param giteaRootURL URL the act_runner registers and connect with
@ -47,6 +48,7 @@ statefulset:
affinity: {} affinity: {}
extraVolumes: [] extraVolumes: []
securityContext: {} securityContext: {}
serviceAccountName: null
actRunner: actRunner:
registry: "docker.gitea.com" registry: "docker.gitea.com"