[CASSANDRA] Change values to makre Cassandra instances more stable
[oom.git] / kubernetes / dcaegen2 / components / dcae-servicechange-handler / templates / deployment.yaml
1 {{/*
2 #============LICENSE_START========================================================
3 # ================================================================================
4 # Copyright (c) 2019 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-inventory-api"
50             - --container-name
51             - "message-router"
52             - --container-name
53             - "sdc-be"
54             - "-t"
55             - "45"
56           env:
57           - name: NAMESPACE
58             valueFrom:
59               fieldRef:
60                 apiVersion: v1
61                 fieldPath: metadata.namespace
62         - name: init-tls
63           env:
64           - name: POD_IP
65             valueFrom:
66               fieldRef:
67                 apiVersion: v1
68                 fieldPath: status.podIP
69           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}
70           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71           resources: {}
72           volumeMounts:
73             - mountPath: /opt/app/osaaf
74               name: tls-info
75       containers:
76         - name: {{ include "common.name" . }}
77           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
78           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
79           resources:
80 {{ include "common.resources" . | indent 12 }}
81           # disable liveness probe when breakpoints set in debugger
82           # so K8s doesn't restart unresponsive container
83           {{- if eq .Values.liveness.enabled true }}
84           livenessProbe:
85             exec:
86               command: [{{ .Values.liveness.script }}]
87             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
88             periodSeconds: {{ .Values.liveness.periodSeconds }}
89           {{ end }}
90           readinessProbe:
91             exec:
92               command: [{{ .Values.readiness.script }}]
93             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94             periodSeconds: {{ .Values.readiness.periodSeconds }}
95           volumeMounts:
96             - name: {{  include "common.fullname" . }}-sch-config
97               mountPath: /opt/config.json
98               subPath: config.json
99             # NOTE: This is tied to the PATH_TO_CACERT env variable
100             - mountPath: /opt/cert/
101               name: tls-info
102           env:
103             - name: CONSUL_HOST
104               value: consul.{{ include "common.namespace" . }}
105             - name: PATH_TO_CACERT
106               value: "/opt/cert/cacert.pem"
107             - name: SCH_ARGS
108               value: "prod /opt/config.json"
109       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
110       volumes:
111         - name: {{ include "common.fullname" . }}-sch-config
112           configMap:
113             name: {{ include "common.fullname" . }}-configmap
114         - emptyDir: {}
115           name: tls-info
116       imagePullSecrets:
117       - name: "{{ include "common.namespace" . }}-docker-registry-key"