[CASSANDRA] Change values to makre Cassandra instances more stable
[oom.git] / kubernetes / dcaegen2 / components / dcae-dashboard / templates / deployment.yaml
1 {{/*
2 #============LICENSE_START========================================================
3 # ================================================================================
4 # Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
18 */}}
19
20 apiVersion: apps/v1
21 kind: Deployment
22 metadata:
23   name: {{ include "common.fullname" . }}
24   namespace: {{ include "common.namespace" . }}
25   labels:
26     app: {{ include "common.name" . }}
27     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
28     release: {{ include "common.release" . }}
29     heritage: {{ .Release.Service }}
30 spec:
31   replicas: 1
32   selector:
33     matchLabels:
34       app: {{ include "common.name" . }}
35   template:
36     metadata:
37       labels:
38         app: {{ include "common.name" . }}
39         release: {{ include "common.release" . }}
40     spec:
41       initContainers:
42         - name: {{ include "common.name" . }}-readiness
43           image: {{ include "repositoryGenerator.image.readiness" . }}
44           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45           command:
46             - /app/ready.py
47           args:
48           - --container-name
49           - dcae-cloudify-manager
50           - --container-name
51           - consul-server
52           - --container-name
53           - dcae-inventory-api
54           - --container-name
55           - dcae-deployment-handler
56           - --container-name
57           - {{ .Values.postgres.nameOverride }}
58           - "-t"
59           - "45"
60           env:
61           - name: NAMESPACE
62             valueFrom:
63               fieldRef:
64                 apiVersion: v1
65                 fieldPath: metadata.namespace
66         - name: init-tls
67           env:
68           - name: POD_IP
69             valueFrom:
70               fieldRef:
71                 apiVersion: v1
72                 fieldPath: status.podIP
73           - name: aaf_locator_fqdn
74             value: dcae
75           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}
76           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77           resources: {}
78           volumeMounts:
79             - mountPath: /opt/app/osaaf
80               name: tls-info
81       containers:
82         - name: {{ include "common.name" . }}
83           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
84           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85           resources:
86 {{ include "common.resources" . | indent 12 }}
87           ports:
88           - containerPort: {{ .Values.service.internalPort }}
89             protocol: TCP
90           # disable liveness probe when breakpoints set in debugger
91           # so K8s doesn't restart unresponsive container
92           {{- if eq .Values.liveness.enabled true }}
93           livenessProbe:
94             tcpSocket:
95               port: {{ .Values.service.internalPort }}
96             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
97             periodSeconds: {{ .Values.liveness.periodSeconds }}
98           {{ end }}
99           readinessProbe:
100             httpGet:
101               path: {{ .Values.readiness.path }}
102               port: {{ .Values.service.internalPort }}
103               scheme: {{ .Values.readiness.scheme }}
104             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
105             periodSeconds: {{ .Values.readiness.periodSeconds }}
106             failureThreshold: 1
107             successThreshold: 1
108             timeoutSeconds: 1
109           volumeMounts:
110             - mountPath: /opt/app/osaaf/
111               name: tls-info
112             - mountPath: /opt/logs/dcae/dashboard
113               name: component-log
114           env:
115             - name: CONSUL_HOST
116               value: consul-server.{{ include "common.namespace" . }}
117             - name: CONFIG_BINDING_SERVICE
118               value: config-binding-service
119             - name: inventory_url
120               value: {{ .Values.config.inventory_url }}
121             - name: postgres_port
122               value: "{{ .Values.postgres.config.pgPort }}"
123             - name: cloudify_password
124               {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cm-pass" "key" "password") | indent 14 }}
125             - name: dhandler_url
126               value: {{ .Values.config.dhandler_url }}
127             - name: cfy_url
128               value: {{ .Values.config.cfy_url }}
129             - name: cloudify_user
130               value: admin
131             - name: consul_url
132               value: http://consul-server-ui:8500
133             - name: postgres_user_dashboard
134               {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 14 }}
135             - name: postgres_password_dashboard
136               {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 14 }}
137             - name: postgres_db_name
138               value: {{ .Values.postgres.config.pgDatabase }}
139             - name: postgres_ip
140               value: {{ .Values.postgres.service.name2 }}
141             - name: POD_IP
142               valueFrom:
143                 fieldRef:
144                   apiVersion: v1
145                   fieldPath: status.podIP
146         - name: {{ include "common.name" . }}-filebeat
147           env:
148             - name: POD_IP
149               valueFrom:
150                 fieldRef:
151                   apiVersion: v1
152                   fieldPath: status.podIP
153           image: {{ include "repositoryGenerator.image.logging" . }}
154           imagePullPolicy: IfNotPresent
155           resources: {}
156           volumeMounts:
157           - mountPath: /var/log/onap/dashboard
158             name: component-log
159           - mountPath: /usr/share/filebeat/data
160             name: filebeat-data
161           - mountPath: /usr/share/filebeat/filebeat.yml
162             name: filebeat-conf
163             subPath: filebeat.yml
164       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
165       volumes:
166         - emptyDir: {}
167           name: component-log
168         - emptyDir: {}
169           name: filebeat-data
170         - configMap:
171             defaultMode: 420
172             name: {{ include "common.fullname" . }}-filebeat-configmap
173           name: filebeat-conf
174         - emptyDir: {}
175           name: tls-info
176       imagePullSecrets:
177       - name: "{{ include "common.namespace" . }}-docker-registry-key"