diff --git a/.gitignore b/.gitignore index 496ee2c..29bb3fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.DS_Store \ No newline at end of file +.DS_Store + +.vscode \ No newline at end of file diff --git a/charts/tooljet/templates/_helpers.tpl b/charts/tooljet/templates/_helpers.tpl index 8aef6ce..236bae4 100644 --- a/charts/tooljet/templates/_helpers.tpl +++ b/charts/tooljet/templates/_helpers.tpl @@ -147,4 +147,15 @@ Return the appropriate apiVersion for autoscaling. {{- else -}} {{- print "autoscaling/v2beta2" -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Return the service account name +*/}} +{{- define "tooljet.serviceAccountName" -}} +{{- if .Values.apps.tooljet.serviceAccount.name -}} +{{- .Values.apps.tooljet.serviceAccount.name -}} +{{- else -}} +{{- include "tooljet.fullname" . -}} +{{- end -}} +{{- end -}} diff --git a/charts/tooljet/templates/deployment.yaml b/charts/tooljet/templates/deployment.yaml index dbcb60d..473d3e1 100644 --- a/charts/tooljet/templates/deployment.yaml +++ b/charts/tooljet/templates/deployment.yaml @@ -21,6 +21,9 @@ spec: labels: {{- include "tooljet.selectorLabels" . | nindent 8 }} spec: + {{- if .Values.apps.tooljet.serviceAccount.create }} + serviceAccountName: {{ include "tooljet.serviceAccountName" . }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.apps.tooljet.deployment.image.repository }}:{{ .Values.apps.tooljet.deployment.image.tag }}" diff --git a/charts/tooljet/templates/serviceaccount.yml b/charts/tooljet/templates/serviceaccount.yml new file mode 100644 index 0000000..ed5290c --- /dev/null +++ b/charts/tooljet/templates/serviceaccount.yml @@ -0,0 +1,12 @@ +{{- if .Values.apps.tooljet.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "tooljet.serviceAccountName" . }} + labels: + {{- include "tooljet.labels" . | nindent 4 }} + {{- if .Values.apps.tooljet.serviceAccount.annotations }} + annotations: + {{- toYaml .Values.apps.tooljet.serviceAccount.annotations | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/tooljet/values.yaml b/charts/tooljet/values.yaml index f24fcdc..55d65d9 100644 --- a/charts/tooljet/values.yaml +++ b/charts/tooljet/values.yaml @@ -30,6 +30,10 @@ apps: port: 80 targetPort: 3000 type: ClusterIP + serviceAccount: + create: false + name: "" + annotations: {} postgresql: enabled: true