diff --git a/charts/kafka-lag-exporter/templates/000-ServiceAccount.yaml b/charts/kafka-lag-exporter/templates/000-ServiceAccount.yaml index a3e026b3..88f77d70 100644 --- a/charts/kafka-lag-exporter/templates/000-ServiceAccount.yaml +++ b/charts/kafka-lag-exporter/templates/000-ServiceAccount.yaml @@ -2,10 +2,14 @@ apiVersion: v1 kind: ServiceAccount metadata: + {{- if .Values.serviceAccount.nameOverride }} + name: {{ .Values.serviceAccount.nameOverride }} + {{- else }} name: {{ include "kafka-lag-exporter.fullname" . }}-serviceaccount + {{- end }} labels: app.kubernetes.io/name: {{ include "kafka-lag-exporter.name" . }} helm.sh/chart: {{ include "kafka-lag-exporter.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/kafka-lag-exporter/templates/040-Deployment.yaml b/charts/kafka-lag-exporter/templates/040-Deployment.yaml index 722aecd8..b0f2ff3a 100644 --- a/charts/kafka-lag-exporter/templates/040-Deployment.yaml +++ b/charts/kafka-lag-exporter/templates/040-Deployment.yaml @@ -24,8 +24,12 @@ spec: {{- end }} spec: {{- if or .Values.watchers.strimzi .Values.serviceAccount.create }} + {{- if .Values.serviceAccount.nameOverride }} + serviceAccountName: {{ .Values.serviceAccount.nameOverride }} + {{- else }} serviceAccountName: {{ include "kafka-lag-exporter.fullname" . }}-serviceaccount {{- end }} + {{- end }} containers: - name: {{ .Chart.Name }} {{- if .Values.image.digest }} @@ -34,7 +38,10 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} - env: [] + {{- if .Values.env }} + env: +{{ toYaml .Values.env | indent 10 }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} @@ -60,8 +67,15 @@ spec: subPath: {{ .subPath }} readOnly: {{ .readOnly }} {{- end }} + {{- range .Values.extraMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- end }} resources: {{ toYaml .Values.resources | indent 12 }} + {{- with .Values.initContainers }} + initContainers: {{ toYaml . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -83,3 +97,7 @@ spec: configMap: name: {{ .configMap }} {{- end }} + {{- range .Values.extraMounts }} + - name: {{ .name }} +{{ toYaml .mount | indent 10 }} + {{- end }} diff --git a/charts/kafka-lag-exporter/values.yaml b/charts/kafka-lag-exporter/values.yaml index 5c122e0b..e3ca8ee7 100644 --- a/charts/kafka-lag-exporter/values.yaml +++ b/charts/kafka-lag-exporter/values.yaml @@ -43,6 +43,9 @@ watchers: ## Otherwise, the default service account for the namespace will be used. serviceAccount: create: false + ## The name of the service account will be generated based on the release name, use nameOverride to override + ## with a static name. + # nameOverride: my-serviceaccount ## You can use regex to control the metrics exposed by Prometheus endpoint. ## Any metric that matches one of the regex in the whitelist will be exposed. @@ -80,6 +83,11 @@ securityContext: {} # runAsNonRoot: true # capabilities: # drop: ["all"] +initContainers: [] +## Init containers to be added to the pod. +# - name: my-init-container +# image: busybox:latest +# command: ['sh', '-c', 'echo hello'] service: type: ClusterIP port: 8000 @@ -99,6 +107,15 @@ extraConfigmapMounts: [] # mountPath: /etc/pki/ca-trust/extracted/java/cacerts # subPath: ca-bundle.jks # readOnly: true +extraMounts: [] + # - name: my-secrets + # mount: + # emptyDir: + # medium: Memory + # mountPath: /var/run/my-secrets +env: {} + # - name: JAVA_OPTS + # value: "-Djava.security.auth.login.config=/var/run/my-secrets/jaasConfig" podAnnotations: {} # foo: bar