a191761e7553ab5ee1384b695b2e5c68245cf90c
[oom.git] / kubernetes / common / dgbuilder / templates / deployment.yaml
1 # Copyright © 2018 AT&T, 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: extensions/v1beta1
16 kind: Deployment
17 metadata:
18   name: {{ include "common.fullname" . }}
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   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ .Release.Name }}
32     spec:
33       initContainers:
34       - command:
35         - /root/ready.py
36         args:
37         - --container-name
38         - {{ .Values.config.dbPodName }}
39         env:
40         - name: NAMESPACE
41           valueFrom:
42             fieldRef:
43               apiVersion: v1
44               fieldPath: metadata.namespace
45         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
46         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47         name: {{ include "common.name" . }}-readiness
48       containers:
49         - name: {{ include "common.name" . }}
50           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52           command: ["/bin/bash"]
53           args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"]
54           ports:
55           - containerPort: {{ .Values.service.internalPort }}
56           readinessProbe:
57             tcpSocket:
58               port: {{ .Values.service.internalPort }}
59             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.readiness.periodSeconds }}
61           env:
62           - name: MYSQL_ROOT_PASSWORD
63             valueFrom:
64               secretKeyRef:
65                 name: {{ template "common.fullname" . }}
66                 key: db-root-password
67           - name: SDNC_CONFIG_DIR
68             value: /opt/onap/sdnc/data/properties
69           volumeMounts:
70           - mountPath: /etc/localtime
71             name: localtime
72             readOnly: true
73           - name: config
74             mountPath: /opt/app/application.properties
75             subPath: application.properties
76           - name: config
77             mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties
78             subPath: svclogic.properties
79           - name: config
80             mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties
81             subPath: svclogic.properties
82           - name: scripts
83             mountPath: /opt/onap/ccsdk/dgbuilder/createReleaseDir.sh
84             subPath: createReleaseDir.sh
85           - name: scripts
86             mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js
87             subPath: customSettings.js
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: config
103           configMap:
104             name: {{ include "common.fullname" . }}-config
105         - name: scripts
106           configMap:
107             name: {{ include "common.fullname" . }}-scripts
108             defaultMode: 0755
109       imagePullSecrets:
110       - name: "{{ include "common.namespace" . }}-docker-registry-key"