[OOM] Fixing k8s ServiceAccounts
[oom.git] / kubernetes / sdc / components / sdc-onboarding-be / templates / job.yaml
index bfc1ef8..eb0958c 100644 (file)
 
 apiVersion: batch/v1
 kind: Job
-metadata:
-  name: {{ include "common.fullname" . }}-cassandra-init
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}-job
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
+metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
 spec:
   backoffLimit: 20
   template:
@@ -42,7 +35,7 @@ spec:
         - /app/ready.py
         args:
         - --job-name
-        - {{ include "common.release" . }}-sdc-cs-config-cassandra
+        - {{ include "common.release" . }}-sdc-cs
         - "-t"
         - "20"
         env:
@@ -72,6 +65,8 @@ spec:
         volumeMounts:
         - name: {{ include "common.fullname" . }}-environments
           mountPath: /home/sdc/chef-solo/environments/
+        - name: {{ include "common.fullname" . }}-cqlshrc
+          mountPath: /home/sdc/.cassandra
         env:
         - name: ENVNAME
           value: {{ .Values.env.name }}
@@ -98,11 +93,14 @@ spec:
             cpu: 200m
             memory: 200Mi
       {{ include "common.waitForJobContainer" . | indent 6 | trim }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
       - name: {{ include "common.fullname" . }}-environments
         configMap:
           name: {{ include "common.release" . }}-sdc-environments-configmap
           defaultMode: 0755
+      - name: {{ include "common.fullname" . }}-cqlshrc
+        configMap:
+          name: {{ include "common.release" . }}-sdc-cqlshrc
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
-      restartPolicy: Never