Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, AT&T, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 ZTE |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | apiVersion: batch/v1 |
| 17 | kind: Job |
| 18 | metadata: |
| 19 | name: {{ include "common.fullname" . }}-cassandra-init |
| 20 | namespace: {{ include "common.namespace" . }} |
| 21 | labels: |
| 22 | app: {{ include "common.name" . }}-job |
| 23 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 24 | release: {{ .Release.Name }} |
| 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
Mike Elliott | 6482f50 | 2018-04-30 15:02:43 -0400 | [diff] [blame] | 27 | backoffLimit: 20 |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }}-job |
| 32 | release: {{ .Release.Name }} |
| 33 | spec: |
| 34 | restartPolicy: Never |
| 35 | initContainers: |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 36 | - name: {{ include "common.name" . }}-job-completion |
| 37 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 38 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 39 | command: |
| 40 | - /root/job_complete.py |
| 41 | args: |
| 42 | - --job-name |
| 43 | - {{ .Release.Name }}-sdc-cs-config-cassandra |
| 44 | env: |
| 45 | - name: NAMESPACE |
| 46 | valueFrom: |
| 47 | fieldRef: |
| 48 | apiVersion: v1 |
| 49 | fieldPath: metadata.namespace |
| 50 | containers: |
| 51 | - name: {{ include "common.name" . }}-job |
| 52 | image: "{{ include "common.repository" . }}/{{ .Values.onboardingInitImage }}" |
| 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | volumeMounts: |
| 55 | - name: {{ include "common.fullname" . }}-environments |
| 56 | mountPath: /root/chef-solo/environments/ |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 57 | env: |
| 58 | - name: ENVNAME |
| 59 | value: {{ .Values.global.env.name }} |
| 60 | - name: HOST_IP |
| 61 | valueFrom: |
| 62 | fieldRef: |
| 63 | fieldPath: status.podIP |
| 64 | - name: SDC_USER |
| 65 | valueFrom: |
| 66 | secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_user} |
| 67 | - name: SDC_PASSWORD |
| 68 | valueFrom: |
| 69 | secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_password} |
| 70 | - name: CS_PASSWORD |
| 71 | valueFrom: |
| 72 | secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: cs_password} |
| 73 | - name: CS_HOST_IP |
Mahendra Raghuwanshi | 35f83f5 | 2019-03-20 10:42:49 +0000 | [diff] [blame] | 74 | value: "{{ .Values.global.cassandra.serviceName }}" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 75 | volumes: |
| 76 | - name: {{ include "common.fullname" . }}-environments |
| 77 | configMap: |
| 78 | name: {{ .Release.Name }}-sdc-environments-configmap |
| 79 | defaultMode: 0755 |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 80 | imagePullSecrets: |
| 81 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 82 | restartPolicy: Never |