blob: 13fc982a6aed5f4992779224548ea24e4f2c7ec5 [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 Lucas089cd9d2020-09-30 12:24:20 -04006# Copyright (c) 2020 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 Lucasecc9f602019-03-19 11:38:42 -040049 initContainers:
Jack Lucas8c3463e2020-06-12 18:36:55 -040050 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020051 image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }}
Jack Lucas8c3463e2020-06-12 18:36:55 -040052 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020054 - /app/ready.py
Jack Lucas8c3463e2020-06-12 18:36:55 -040055 args:
56 - --container-name
57 - aaf-cm
58 - "-t"
59 - "15"
60 env:
61 - name: NAMESPACE
62 valueFrom:
63 fieldRef:
64 apiVersion: v1
65 fieldPath: metadata.namespace
Jack Lucasecc9f602019-03-19 11:38:42 -040066 - name: {{ include "common.name" . }}-multisite-init
67 image: {{ include "common.repository" . }}/{{ .Values.multisiteInitImage }}
68 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69 args:
70 - --namespace
71 - {{ include "common.namespace" . }}
72 - --configmap
73 - {{ .Values.multisiteConfigMapName }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000074 - name: init-tls
75 env:
76 - name: POD_IP
77 valueFrom:
78 fieldRef:
79 apiVersion: v1
80 fieldPath: status.podIP
Jack Lucasc70bc7e2019-09-23 09:02:31 -040081 - name: aaf_locator_fqdn
82 value: dcae
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000083 image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
84 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 resources: {}
86 volumeMounts:
Jack Lucasc70bc7e2019-09-23 09:02:31 -040087 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000088 name: tls-info
Sylvain Desbureauxcfb7ff92020-05-06 17:40:20 +020089 {{- if .Values.persistence.enabled }}
90 - name: remove-lost-found
91 image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
92 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 volumeMounts:
94 - mountPath: /cfy-persist
95 name: cm-persistent
96 command:
97 - /bin/sh
98 args:
99 - -c
100 - "rm -rf '/cfy-persist/lost+found';"
101 {{- end }}
BorislavGe904ab22018-04-03 16:55:55 +0300102 containers:
103 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +0000104 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
BorislavGe904ab22018-04-03 16:55:55 +0300105 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000106 env:
107 - name: REQUESTS_CA_BUNDLE
108 value: "/opt/onap/certs/cacert.pem"
vaibhav_16decdb582fa2018-09-20 12:32:47 +0000109 resources:
110{{ include "common.resources" . | indent 12 }}
BorislavGe904ab22018-04-03 16:55:55 +0300111 ports:
112 - containerPort: {{ .Values.service.internalPort }}
113 # disable liveness probe when breakpoints set in debugger
114 # so K8s doesn't restart unresponsive container
115 {{- if eq .Values.liveness.enabled true }}
116 livenessProbe:
117 tcpSocket:
118 port: {{ .Values.service.internalPort }}
119 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
120 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jack Lucas089cd9d2020-09-30 12:24:20 -0400121 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Jack Lucasecc9f602019-03-19 11:38:42 -0400122 {{ end }}
BorislavGe904ab22018-04-03 16:55:55 +0300123 readinessProbe:
Jack Lucasecc9f602019-03-19 11:38:42 -0400124 exec:
125 command:
126 - /scripts/readiness-check.sh
BorislavGe904ab22018-04-03 16:55:55 +0300127 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
128 periodSeconds: {{ .Values.readiness.periodSeconds }}
Jack Lucas089cd9d2020-09-30 12:24:20 -0400129 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
BorislavGe904ab22018-04-03 16:55:55 +0300130 volumeMounts:
131 - mountPath: /opt/onap/config.txt
132 subPath: config.txt
133 name: {{ include "common.fullname" .}}-config
134 readOnly: true
Jack Lucasecc9f602019-03-19 11:38:42 -0400135 - mountPath: /opt/onap/kube
136 name: {{ include "common.fullname" .}}-kubeconfig
137 readOnly: true
BorislavGe904ab22018-04-03 16:55:55 +0300138 - mountPath: /secret
139 name: dcae-token
140 readOnly: true
141 - mountPath: /sys/fs/cgroup
142 name: {{ include "common.fullname" . }}-cgroup
143 readOnly: true
144 - mountPath: /etc/localtime
145 name: localtime
146 readOnly: true
Jack Lucascec10b42018-12-04 15:10:28 -0500147 - mountPath: /cfy-persist
148 name: cm-persistent
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000149 - mountPath: /opt/onap/certs
150 name: tls-info
Schmalzried, Terry (ts862m)12db7892020-08-21 20:42:33 -0400151 - mountPath: /opt/onap/cm-secrets
152 name: cm-secrets
153 readOnly: true
BorislavGe904ab22018-04-03 16:55:55 +0300154 securityContext:
155 privileged: True
BorislavGe904ab22018-04-03 16:55:55 +0300156 volumes:
157 - name: {{ include "common.fullname" . }}-config
158 configMap:
159 name: {{ include "common.fullname" . }}-configmap
Jack Lucasecc9f602019-03-19 11:38:42 -0400160 - name: {{ include "common.fullname" .}}-kubeconfig
161 configMap:
162 name: {{ .Values.multisiteConfigMapName }}
BorislavGe904ab22018-04-03 16:55:55 +0300163 - name: dcae-token
164 secret:
165 secretName: dcae-token
166 - name: {{ include "common.fullname" . }}-cgroup
167 hostPath:
168 path: /sys/fs/cgroup
169 - name: localtime
170 hostPath:
171 path: /etc/localtime
Jack Lucascec10b42018-12-04 15:10:28 -0500172 - name: cm-persistent
Sylvain Desbureaux03c36f92019-11-29 15:22:29 +0100173 {{- if .Values.persistence.enabled }}
Jack Lucascec10b42018-12-04 15:10:28 -0500174 persistentVolumeClaim:
175 claimName: {{ include "common.fullname" . }}-data
Sylvain Desbureaux03c36f92019-11-29 15:22:29 +0100176 {{- else }}
177 emptyDir: {}
178 {{- end }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000179 - emptyDir: {}
180 name: tls-info
Schmalzried, Terry (ts862m)12db7892020-08-21 20:42:33 -0400181 - name: cm-secrets
182 secret:
183 secretName: {{ include "common.secret.getSecretNameFast" (dict "global" . "uid" "cm-pass") }}
BorislavGe904ab22018-04-03 16:55:55 +0300184 imagePullSecrets:
185 - name: "{{ include "common.namespace" . }}-docker-registry-key"