Merge "[CCSDK] Correct permissions of mounted configmaps" into guilin
[oom.git] / kubernetes / cds / charts / cds-ui / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Orange
3 # Modifications Copyright © 2018  Amdocs, Bell Canada
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 */}}
17
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: {{ include "common.fullname" . }}
22   namespace: {{ include "common.namespace" . }}
23   labels:
24     app: {{ include "common.name" . }}
25     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26     release: {{ include "common.release" . }}
27     heritage: {{ .Release.Service }}
28 spec:
29   selector:
30     matchLabels:
31       app: {{ include "common.name" . }}
32   replicas: {{ .Values.replicaCount }}
33   template:
34     metadata:
35       labels:
36         app: {{ include "common.name" . }}
37         release: {{ include "common.release" . }}
38         name: {{ include "common.fullname" . }}
39     spec:
40       containers:
41         - name: {{ include "common.name" . }}
42           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
43           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
44           ports:
45             - containerPort: {{ .Values.service.internalPort }}
46           # disable liveness probe when breakpoints set in debugger
47           # so K8s doesn't restart unresponsive container
48           {{ if .Values.liveness.enabled }}
49           livenessProbe:
50             tcpSocket:
51               port: {{ .Values.service.internalPort }}
52             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
53             periodSeconds: {{ .Values.liveness.periodSeconds }}
54           {{ end }}
55           command:
56           - sh
57           args:
58           - -c
59           - |
60             echo "cadi_keystore_password_p12=$PASSPHRASE_VALUE" > .enc
61             node .
62           env:
63             - name: HOST
64               value: 0.0.0.0
65             - name: APP_ACTION_DEPLOY_BLUEPRINT_GRPC_ENABLED
66               value: "{{ .Values.config.app.action.deployBlueprint.grpcEnabled }}"
67             - name: API_BLUEPRINT_CONTROLLER_HTTP_BASE_URL
68               value: {{ .Values.config.api.controller.http.baseUrl }}
69             - name: API_BLUEPRINT_CONTROLLER_HTTP_AUTH_TOKEN
70               value: {{ .Values.config.api.controller.http.authToken }}
71             - name: API_BLUEPRINT_PROCESSOR_HTTP_BASE_URL
72               value: {{ .Values.config.api.processor.http.baseUrl }}
73             - name: API_BLUEPRINT_PROCESSOR_HTTP_AUTH_TOKEN
74               value: {{ .Values.config.api.processor.http.authToken }}
75             - name: API_BLUEPRINT_PROCESSOR_GRPC_HOST
76               value: {{ .Values.config.api.processor.grpc.host }}
77             - name: API_BLUEPRINT_PROCESSOR_GRPC_PORT
78               value: "{{ .Values.config.api.processor.grpc.port }}"
79             - name: API_BLUEPRINT_PROCESSOR_GRPC_AUTH_TOKEN
80               value: {{ .Values.config.api.processor.grpc.authToken }}
81             - name: KEYSTORE
82               value: "/certs/org.onap.sdnc-cds.p12"
83             - name: PASSPHRASE_VALUE
84               {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-certs-pass" "key" "password") | indent 14 }}
85           readinessProbe:
86             tcpSocket:
87               port: {{ .Values.service.internalPort }}
88             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
89             periodSeconds: {{ .Values.readiness.periodSeconds }}
90           volumeMounts:
91             - mountPath: /etc/localtime
92               name: localtime
93               readOnly: true
94             - mountPath: /certs
95               name: certs
96           resources:
97 {{ include "common.resources" . | indent 12 }}
98         {{- if .Values.nodeSelector }}
99         nodeSelector:
100 {{ toYaml .Values.nodeSelector | indent 10 }}
101         {{- end -}}
102         {{- if .Values.affinity }}
103         affinity:
104 {{ toYaml .Values.affinity | indent 10 }}
105         {{- end }}
106       volumes:
107         - name: localtime
108           hostPath:
109             path: /etc/localtime
110         - name: certs
111           secret:
112             secretName: {{ include "common.fullname" . }}-certs
113       imagePullSecrets:
114       - name: "{{ include "common.namespace" . }}-docker-registry-key"