blob: 204a3e27d72785d0a71a3b33b59cae5f00aab78f [file] [log] [blame]
Jakub Latusekdf233a82020-10-21 13:36:29 +02001{{/*
BorislavGe904ab22018-04-03 16:55:55 +03002#============LICENSE_START========================================================
3# ================================================================================
Schmalzried, Terry (ts862m)12db7892020-08-21 20:42:33 -04004# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
Durgpal7ad40692018-08-03 07:28:36 +00005# Modifications Copyright © 2018 Amdocs, Bell Canada
Jack Lucasd12a1b62021-01-11 12:46:33 -05006# Copyright (c) 2020-2021 J. F. Lucas. All rights reserved.
BorislavGe904ab22018-04-03 16:55:55 +03007# ================================================================================
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19# ============LICENSE_END=========================================================
Jakub Latusekdf233a82020-10-21 13:36:29 +020020*/}}
BorislavGe904ab22018-04-03 16:55:55 +030021
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020022apiVersion: apps/v1
BorislavGe904ab22018-04-03 16:55:55 +030023kind: Deployment
24metadata:
25 name: {{ include "common.fullname" . }}
26 namespace: {{ include "common.namespace" . }}
27 labels:
28 app: {{ include "common.name" . }}
29 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010030 release: {{ include "common.release" . }}
BorislavGe904ab22018-04-03 16:55:55 +030031 heritage: {{ .Release.Service }}
32spec:
33 replicas: 1
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020034 selector:
35 matchLabels:
36 app: {{ include "common.name" . }}
BorislavGe904ab22018-04-03 16:55:55 +030037 template:
38 metadata:
39 labels:
40 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010041 release: {{ include "common.release" . }}
BorislavGe904ab22018-04-03 16:55:55 +030042 spec:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000043 # host alias allows local 'cfy' command to use https and match
44 # the host name in the certificate
45 hostAliases:
46 - ip: "127.0.0.1"
47 hostnames:
48 - "dcae-cloudify-manager"
Jack Lucasd12a1b62021-01-11 12:46:33 -050049 # Cloudify requires a fixed hostname across restarts
50 hostname: dcae-cloudify-manager
Jack Lucasecc9f602019-03-19 11:38:42 -040051 initContainers:
Jack Lucas8c3463e2020-06-12 18:36:55 -040052 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010053 image: {{ include "repositoryGenerator.image.readiness" . }}
Jack Lucas8c3463e2020-06-12 18:36:55 -040054 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020056 - /app/ready.py
Jack Lucas8c3463e2020-06-12 18:36:55 -040057 args:
58 - --container-name
59 - aaf-cm
Jack Lucasd12a1b62021-01-11 12:46:33 -050060 - --container-name
61 - consul-server
Jack Lucas8c3463e2020-06-12 18:36:55 -040062 - "-t"
63 - "15"
64 env:
65 - name: NAMESPACE
66 valueFrom:
67 fieldRef:
68 apiVersion: v1
69 fieldPath: metadata.namespace
Jack Lucasecc9f602019-03-19 11:38:42 -040070 - name: {{ include "common.name" . }}-multisite-init
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010071 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.multisiteInitImage }}
Jack Lucasecc9f602019-03-19 11:38:42 -040072 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
73 args:
74 - --namespace
75 - {{ include "common.namespace" . }}
76 - --configmap
77 - {{ .Values.multisiteConfigMapName }}
Jack Lucasd12a1b62021-01-11 12:46:33 -050078 - name: init-consul
79 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.consulLoaderImage }}
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 args:
82 - --key
83 - k8s-plugin|/plugin-configs/k8s-plugin.json
84 - --key
85 - dmaap-plugin|/plugin-configs/dmaap-plugin.json
86 resources: {}
87 volumeMounts:
88 - mountPath: /plugin-configs
89 name: plugin-configs
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000090 - name: init-tls
91 env:
92 - name: POD_IP
93 valueFrom:
94 fieldRef:
95 apiVersion: v1
96 fieldPath: status.podIP
Jack Lucasc70bc7e2019-09-23 09:02:31 -040097 - name: aaf_locator_fqdn
98 value: dcae
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010099 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000100 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
101 resources: {}
102 volumeMounts:
Jack Lucasc70bc7e2019-09-23 09:02:31 -0400103 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000104 name: tls-info
Sylvain Desbureauxcfb7ff92020-05-06 17:40:20 +0200105 {{- if .Values.persistence.enabled }}
106 - name: remove-lost-found
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +0100107 image: {{ include "repositoryGenerator.image.busybox" . }}
Sylvain Desbureauxcfb7ff92020-05-06 17:40:20 +0200108 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
109 volumeMounts:
110 - mountPath: /cfy-persist
111 name: cm-persistent
112 command:
113 - /bin/sh
114 args:
115 - -c
116 - "rm -rf '/cfy-persist/lost+found';"
117 {{- end }}
BorislavGe904ab22018-04-03 16:55:55 +0300118 containers:
119 - name: {{ include "common.name" . }}
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +0100120 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
BorislavGe904ab22018-04-03 16:55:55 +0300121 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000122 env:
123 - name: REQUESTS_CA_BUNDLE
124 value: "/opt/onap/certs/cacert.pem"
vaibhav_16decdb582fa2018-09-20 12:32:47 +0000125 resources:
126{{ include "common.resources" . | indent 12 }}
BorislavGe904ab22018-04-03 16:55:55 +0300127 ports:
128 - containerPort: {{ .Values.service.internalPort }}
129 # disable liveness probe when breakpoints set in debugger
130 # so K8s doesn't restart unresponsive container
131 {{- if eq .Values.liveness.enabled true }}
132 livenessProbe:
133 tcpSocket:
134 port: {{ .Values.service.internalPort }}
135 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
136 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jack Lucas089cd9d2020-09-30 12:24:20 -0400137 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Jack Lucasecc9f602019-03-19 11:38:42 -0400138 {{ end }}
BorislavGe904ab22018-04-03 16:55:55 +0300139 readinessProbe:
Jack Lucasecc9f602019-03-19 11:38:42 -0400140 exec:
141 command:
142 - /scripts/readiness-check.sh
BorislavGe904ab22018-04-03 16:55:55 +0300143 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
144 periodSeconds: {{ .Values.readiness.periodSeconds }}
Jack Lucas089cd9d2020-09-30 12:24:20 -0400145 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
BorislavGe904ab22018-04-03 16:55:55 +0300146 volumeMounts:
147 - mountPath: /opt/onap/config.txt
148 subPath: config.txt
149 name: {{ include "common.fullname" .}}-config
150 readOnly: true
Jack Lucasecc9f602019-03-19 11:38:42 -0400151 - mountPath: /opt/onap/kube
152 name: {{ include "common.fullname" .}}-kubeconfig
153 readOnly: true
BorislavGe904ab22018-04-03 16:55:55 +0300154 - mountPath: /secret
155 name: dcae-token
156 readOnly: true
157 - mountPath: /sys/fs/cgroup
158 name: {{ include "common.fullname" . }}-cgroup
159 readOnly: true
160 - mountPath: /etc/localtime
161 name: localtime
162 readOnly: true
Jack Lucascec10b42018-12-04 15:10:28 -0500163 - mountPath: /cfy-persist
164 name: cm-persistent
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000165 - mountPath: /opt/onap/certs
166 name: tls-info
Schmalzried, Terry (ts862m)12db7892020-08-21 20:42:33 -0400167 - mountPath: /opt/onap/cm-secrets
168 name: cm-secrets
169 readOnly: true
BorislavGe904ab22018-04-03 16:55:55 +0300170 securityContext:
171 privileged: True
BorislavGe904ab22018-04-03 16:55:55 +0300172 volumes:
173 - name: {{ include "common.fullname" . }}-config
174 configMap:
175 name: {{ include "common.fullname" . }}-configmap
Jack Lucasecc9f602019-03-19 11:38:42 -0400176 - name: {{ include "common.fullname" .}}-kubeconfig
177 configMap:
178 name: {{ .Values.multisiteConfigMapName }}
Jack Lucasd12a1b62021-01-11 12:46:33 -0500179 - name: plugin-configs
180 configMap:
181 name: {{ include "common.fullname" . }}-plugins
BorislavGe904ab22018-04-03 16:55:55 +0300182 - name: dcae-token
183 secret:
184 secretName: dcae-token
185 - name: {{ include "common.fullname" . }}-cgroup
186 hostPath:
187 path: /sys/fs/cgroup
188 - name: localtime
189 hostPath:
190 path: /etc/localtime
Jack Lucascec10b42018-12-04 15:10:28 -0500191 - name: cm-persistent
Sylvain Desbureaux03c36f92019-11-29 15:22:29 +0100192 {{- if .Values.persistence.enabled }}
Jack Lucascec10b42018-12-04 15:10:28 -0500193 persistentVolumeClaim:
194 claimName: {{ include "common.fullname" . }}-data
Sylvain Desbureaux03c36f92019-11-29 15:22:29 +0100195 {{- else }}
196 emptyDir: {}
197 {{- end }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000198 - emptyDir: {}
199 name: tls-info
Schmalzried, Terry (ts862m)12db7892020-08-21 20:42:33 -0400200 - name: cm-secrets
201 secret:
202 secretName: {{ include "common.secret.getSecretNameFast" (dict "global" . "uid" "cm-pass") }}
BorislavGe904ab22018-04-03 16:55:55 +0300203 imagePullSecrets:
204 - name: "{{ include "common.namespace" . }}-docker-registry-key"