328e058f5cdf3d7d13ca609fa1a886001516cf61
[oom.git] / kubernetes / common / dgbuilder / templates / deployment.yaml
1 apiVersion: extensions/v1beta1
2 kind: Deployment
3 metadata:
4   name: {{ include "common.fullname" . }}
5   namespace: {{ include "common.namespace" . }}
6   labels:
7     app: {{ include "common.name" . }}
8     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9     release: {{ .Release.Name }}
10     heritage: {{ .Release.Service }}
11 spec:
12   replicas: {{ .Values.replicaCount }}
13   template:
14     metadata:
15       labels:
16         app: {{ include "common.name" . }}
17         release: {{ .Release.Name }}
18     spec:
19       initContainers:
20       - command:
21         - /root/ready.py
22         args:
23         - --container-name
24         - {{ .Values.config.dbPodName }}
25         env:
26         - name: NAMESPACE
27           valueFrom:
28             fieldRef:
29               apiVersion: v1
30               fieldPath: metadata.namespace
31         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
32         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33         name: {{ include "common.name" . }}-readiness
34       containers:
35         - name: {{ include "common.name" . }}
36           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
37           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38           command: ["/bin/bash"]
39           args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"]
40           ports:
41           - containerPort: {{ .Values.service.internalPort }}
42           readinessProbe:
43             tcpSocket:
44               port: {{ .Values.service.internalPort }}
45             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
46             periodSeconds: {{ .Values.readiness.periodSeconds }}
47           env:
48           - name: MYSQL_ROOT_PASSWORD
49             valueFrom:
50               secretKeyRef:
51                 name: {{ template "common.fullname" . }}
52                 key: db-root-password
53           - name: SDNC_CONFIG_DIR
54             value: /opt/onap/sdnc/data/properties
55           volumeMounts:
56           - mountPath: /etc/localtime
57             name: localtime
58             readOnly: true
59           - name: config
60             mountPath: /opt/app/application.properties
61             subPath: application.properties
62           - name: config
63             mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties
64             subPath: svclogic.properties
65           - name: config
66             mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties
67             subPath: svclogic.properties
68           - name: scripts
69             mountPath: /opt/onap/ccsdk/dgbuilder/createReleaseDir.sh
70             subPath: createReleaseDir.sh
71           - name: scripts
72             mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js
73             subPath: customSettings.js
74           resources:
75 {{ toYaml .Values.resources | indent 12 }}
76         {{- if .Values.nodeSelector }}
77         nodeSelector:
78 {{ toYaml .Values.nodeSelector | indent 10 }}
79         {{- end -}}
80         {{- if .Values.affinity }}
81         affinity:
82 {{ toYaml .Values.affinity | indent 10 }}
83         {{- end }}
84       volumes:
85         - name: localtime
86           hostPath:
87             path: /etc/localtime
88         - name: config
89           configMap:
90             name: {{ include "common.fullname" . }}-config
91         - name: scripts
92           configMap:
93             name: {{ include "common.fullname" . }}-scripts
94             defaultMode: 0755
95       imagePullSecrets:
96       - name: "{{ include "common.namespace" . }}-docker-registry-key"