Skip to content

Commit 3f78f2d

Browse files
authored
Readding ServiceAccount (#212)
* Readding ServiceAccount * Bumping version
1 parent b5eb61a commit 3f78f2d

5 files changed

Lines changed: 27 additions & 1 deletion

File tree

helm/taskchampion-sync-server/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: taskchampion-sync-server
33
description: A Helm chart for deploying TaskChampion Sync Server on Kubernetes
44
type: application
5-
version: 0.2.0
5+
version: 0.2.1
66
appVersion: "0.7.0"
77
keywords:
88
- taskchampion

helm/taskchampion-sync-server/templates/_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,8 @@ app.kubernetes.io/instance: {{ .Release.Name }}
9393

9494
{{- define "taskchampion-sync-server.postgres-secret-name" -}}
9595
{{- printf "%s-connection" .Release.Name -}}
96+
{{- end -}}
97+
98+
{{- define "taskchampion-sync-server.serviceAccountName" -}}
99+
{{- default (include "taskchampion-sync-server.fullname" .) .Values.serviceAccount.name -}}
96100
{{- end -}}

helm/taskchampion-sync-server/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ spec:
2323
imagePullSecrets:
2424
{{- toYaml . | nindent 8 }}
2525
{{- end }}
26+
{{- if .Values.serviceAccount.create }}
27+
serviceAccountName: {{ include "taskchampion-sync-server.serviceAccountName" . }}
28+
{{- end }}
2629
securityContext:
2730
{{- toYaml .Values.securityContext | nindent 8 }}
2831
{{- if and .Values.postgres.enabled .Values.postgres.initContainer.enabled }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "taskchampion-sync-server.serviceAccountName" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "taskchampion-sync-server.labels" . | nindent 4 }}
9+
{{- end }}

helm/taskchampion-sync-server/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ replicas:
9696
enabled: false
9797
count: 1
9898

99+
# ServiceAccount configuration
100+
# The app does not access the Kubernetes API, so no RBAC permissions are needed.
101+
# A dedicated ServiceAccount is created to give the pod a stable identity
102+
# for network policies, pod security, or future RBAC.
103+
serviceAccount:
104+
# create specifies whether a ServiceAccount should be created
105+
create: true
106+
# name sets the ServiceAccount name
107+
name: taskchampion-sync-server
108+
99109
# Security context for the pod
100110
# NOTE: runAsUser and runAsGroup are intentionally unset.
101111
# The Docker entrypoint requires root to chown the data directory and then

0 commit comments

Comments
 (0)