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: |
| 32 | containers: |
| 33 | - 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"] |
| 34 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 35 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 36 | name: aaf-init-job |
| 37 | volumeMounts: |
| 38 | - mountPath: /etc/localtime |
| 39 | name: localtime |
| 40 | readOnly: true |
| 41 | - mountPath: /data |
| 42 | name: aaf-persistent-data |
| 43 | - mountPath: /data1/etc |
| 44 | name: aaf-etc |
| 45 | - mountPath: /data1/data |
| 46 | name: aaf-data |
| 47 | - mountPath: /data1/public/iframe_denied_test.html |
| 48 | name: aaf-public |
| 49 | subPath: iframe_denied_test.html |
| 50 | - mountPath: /data1/public/aaf_2_0.xsd |
| 51 | name: aaf-public |
| 52 | subPath: aaf_2_0.xsd |
| 53 | - mountPath: /data1/public/truststoreONAP.p12 |
| 54 | name: aaf-public-secret |
| 55 | subPath: truststoreONAP.p12 |
| 56 | - mountPath: /data1/public/AAF_RootCA.cer |
| 57 | name: aaf-public-secret |
| 58 | subPath: AAF_RootCA.cer |
| 59 | - mountPath: /data1/public/truststoreONAPall.jks |
| 60 | name: aaf-public-secret |
| 61 | subPath: truststoreONAPall.jks |
| 62 | - mountPath: /data1/local/org.osaaf.location.props |
| 63 | name: aaf-local |
| 64 | subPath: org.osaaf.location.props |
| 65 | - mountPath: /data1/local/org.osaaf.cm.ca.props |
| 66 | name: aaf-local |
| 67 | subPath: org.osaaf.cm.ca.props |
| 68 | - mountPath: /data1/local/org.osaaf.cassandra.props |
| 69 | name: aaf-local |
| 70 | subPath: org.osaaf.cassandra.props |
| 71 | - mountPath: /data1/local/org.osaaf.aaf.props |
| 72 | name: aaf-local |
| 73 | subPath: org.osaaf.aaf.props |
| 74 | - mountPath: /data1/local/org.osaaf.aaf.trust.p12 |
| 75 | name: aaf-local-secret |
| 76 | subPath: org.osaaf.aaf.trust.p12 |
| 77 | - mountPath: /data1/local/org.osaaf.aaf.p12 |
| 78 | name: aaf-local-secret |
| 79 | subPath: org.osaaf.aaf.p12 |
| 80 | - mountPath: /data1/local/org.osaaf.aaf.keyfile |
| 81 | name: aaf-local-secret |
| 82 | subPath: org.osaaf.aaf.keyfile |
| 83 | - mountPath: /data1/local/org.osaaf.aaf.cm.p12 |
| 84 | name: aaf-local-secret |
| 85 | subPath: org.osaaf.aaf.cm.p12 |
| 86 | - mountPath: /data1/backup |
| 87 | name: aaf-backup |
| 88 | resources: |
| 89 | {{ toYaml .Values.resources | indent 12 }} |
| 90 | {{- if .Values.nodeSelector }} |
| 91 | nodeSelector: |
| 92 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 93 | {{- end -}} |
| 94 | {{- if .Values.affinity }} |
| 95 | affinity: |
| 96 | {{ toYaml .Values.affinity | indent 10 }} |
| 97 | {{- end }} |
| 98 | volumes: |
| 99 | - name: localtime |
| 100 | hostPath: |
| 101 | path: /etc/localtime |
| 102 | - name: aaf-local-secret |
| 103 | secret: |
| 104 | secretName: {{ .Release.Name }}-aaf-local-secret |
| 105 | - name: aaf-public-secret |
| 106 | secret: |
| 107 | secretName: {{ .Release.Name }}-aaf-public-secret |
| 108 | - name: aaf-etc |
| 109 | configMap: |
| 110 | name: {{ .Release.Name }}-aaf-etc |
| 111 | - name: aaf-local |
| 112 | configMap: |
| 113 | name: {{ .Release.Name }}-aaf-local |
| 114 | - name: aaf-backup |
| 115 | configMap: |
| 116 | name: {{ .Release.Name }}-aaf-backup |
| 117 | - name: aaf-public |
| 118 | configMap: |
| 119 | name: {{ .Release.Name }}-aaf-public |
| 120 | - name: aaf-data |
| 121 | configMap: |
| 122 | name: {{ .Release.Name }}-aaf-data |
| 123 | - name: aaf-persistent-data |
| 124 | {{- if .Values.global.persistence.enabled }} |
| 125 | persistentVolumeClaim: |
| 126 | claimName: {{ .Release.Name }}-aaf-pvc |
| 127 | {{- else }} |
| 128 | emptyDir: {} |
| 129 | {{- end }} |
| 130 | restartPolicy: OnFailure |
| 131 | imagePullSecrets: |
| 132 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |