Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | apiVersion: batch/v1 |
| 16 | kind: Job |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }}-create-config |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 23 | release: {{ .Release.Name }} |
| 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
| 26 | template: |
| 27 | metadata: |
| 28 | labels: |
| 29 | app: aaf-init-job |
| 30 | release: {{ .Release.Name }} |
| 31 | spec: |
Mike Elliott | b35b580 | 2018-05-08 14:22:13 -0400 | [diff] [blame] | 32 | initContainers: |
| 33 | - name: {{ include "common.name" . }}-inject-config |
| 34 | command: |
| 35 | - /bin/bash |
| 36 | - -c |
| 37 | - > |
| 38 | git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit; |
| 39 | echo "Clone complete. Copying from /tmp/gerrit/ to /public"; |
| 40 | cp -rf /tmp/gerrit/auth/sample/public/* /public; |
| 41 | echo "Done."; |
| 42 | image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.global.ubuntuInitImage }}" |
| 43 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 44 | volumeMounts: |
| 45 | - name: aaf-public |
| 46 | mountPath: "/public" |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 47 | containers: |
| 48 | - command: ["/bin/bash","-c","if [ ! -d /data/backup ]; then mkdir /data/data && cp -Ra /data1/data/..data/* /data/data/ && mkdir /data/etc && cp -Ra /data1/etc/..data/* data/etc/ && mkdir /data/backup && cp -Ra /data1/backup/..data/* /data/backup/ && cp -Ra /data1/public /data/ && cp -Ra /data1/local /data && mkdir -p /data/logs/oauth && mkdir -p /data/logs/hello && mkdir -p /data/logs/fs && mkdir -p /data/logs/gui && mkdir -p /data/logs/locate && mkdir -p /data/logs/cm && mkdir -p /data/logs/service; fi; exit 0"] |
| 49 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 50 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 51 | name: aaf-init-job |
| 52 | volumeMounts: |
| 53 | - mountPath: /etc/localtime |
| 54 | name: localtime |
| 55 | readOnly: true |
| 56 | - mountPath: /data |
| 57 | name: aaf-persistent-data |
| 58 | - mountPath: /data1/etc |
| 59 | name: aaf-etc |
| 60 | - mountPath: /data1/data |
| 61 | name: aaf-data |
| 62 | - mountPath: /data1/public/iframe_denied_test.html |
| 63 | name: aaf-public |
| 64 | subPath: iframe_denied_test.html |
| 65 | - mountPath: /data1/public/aaf_2_0.xsd |
| 66 | name: aaf-public |
| 67 | subPath: aaf_2_0.xsd |
| 68 | - mountPath: /data1/public/truststoreONAP.p12 |
Mike Elliott | b35b580 | 2018-05-08 14:22:13 -0400 | [diff] [blame] | 69 | name: aaf-public |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 70 | subPath: truststoreONAP.p12 |
| 71 | - mountPath: /data1/public/AAF_RootCA.cer |
Mike Elliott | b35b580 | 2018-05-08 14:22:13 -0400 | [diff] [blame] | 72 | name: aaf-public |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 73 | subPath: AAF_RootCA.cer |
| 74 | - mountPath: /data1/public/truststoreONAPall.jks |
Mike Elliott | b35b580 | 2018-05-08 14:22:13 -0400 | [diff] [blame] | 75 | name: aaf-public |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 76 | subPath: truststoreONAPall.jks |
| 77 | - mountPath: /data1/local/org.osaaf.location.props |
| 78 | name: aaf-local |
| 79 | subPath: org.osaaf.location.props |
| 80 | - mountPath: /data1/local/org.osaaf.cm.ca.props |
| 81 | name: aaf-local |
| 82 | subPath: org.osaaf.cm.ca.props |
| 83 | - mountPath: /data1/local/org.osaaf.cassandra.props |
| 84 | name: aaf-local |
| 85 | subPath: org.osaaf.cassandra.props |
| 86 | - mountPath: /data1/local/org.osaaf.aaf.props |
| 87 | name: aaf-local |
| 88 | subPath: org.osaaf.aaf.props |
| 89 | - mountPath: /data1/local/org.osaaf.aaf.trust.p12 |
| 90 | name: aaf-local-secret |
| 91 | subPath: org.osaaf.aaf.trust.p12 |
| 92 | - mountPath: /data1/local/org.osaaf.aaf.p12 |
| 93 | name: aaf-local-secret |
| 94 | subPath: org.osaaf.aaf.p12 |
| 95 | - mountPath: /data1/local/org.osaaf.aaf.keyfile |
| 96 | name: aaf-local-secret |
| 97 | subPath: org.osaaf.aaf.keyfile |
| 98 | - mountPath: /data1/local/org.osaaf.aaf.cm.p12 |
| 99 | name: aaf-local-secret |
| 100 | subPath: org.osaaf.aaf.cm.p12 |
| 101 | - mountPath: /data1/backup |
| 102 | name: aaf-backup |
Mike Elliott | b35b580 | 2018-05-08 14:22:13 -0400 | [diff] [blame] | 103 | - mountPath: /share |
| 104 | name: aaf-public |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 105 | resources: |
| 106 | {{ toYaml .Values.resources | indent 12 }} |
| 107 | {{- if .Values.nodeSelector }} |
| 108 | nodeSelector: |
| 109 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 110 | {{- end -}} |
| 111 | {{- if .Values.affinity }} |
| 112 | affinity: |
| 113 | {{ toYaml .Values.affinity | indent 10 }} |
| 114 | {{- end }} |
| 115 | volumes: |
| 116 | - name: localtime |
| 117 | hostPath: |
| 118 | path: /etc/localtime |
| 119 | - name: aaf-local-secret |
| 120 | secret: |
| 121 | secretName: {{ .Release.Name }}-aaf-local-secret |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 122 | - name: aaf-etc |
| 123 | configMap: |
| 124 | name: {{ .Release.Name }}-aaf-etc |
| 125 | - name: aaf-local |
| 126 | configMap: |
| 127 | name: {{ .Release.Name }}-aaf-local |
| 128 | - name: aaf-backup |
| 129 | configMap: |
| 130 | name: {{ .Release.Name }}-aaf-backup |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 131 | - name: aaf-data |
| 132 | configMap: |
| 133 | name: {{ .Release.Name }}-aaf-data |
| 134 | - name: aaf-persistent-data |
| 135 | {{- if .Values.global.persistence.enabled }} |
| 136 | persistentVolumeClaim: |
| 137 | claimName: {{ .Release.Name }}-aaf-pvc |
| 138 | {{- else }} |
| 139 | emptyDir: {} |
| 140 | {{- end }} |
Mike Elliott | b35b580 | 2018-05-08 14:22:13 -0400 | [diff] [blame] | 141 | - name: aaf-public |
| 142 | emptyDir: {} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 143 | restartPolicy: OnFailure |
| 144 | imagePullSecrets: |
| 145 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |