blob: b326aaf63ce73c78e65db5514a7fbe7b638530b6 [file] [log] [blame]
kj52dfb132018-03-27 15:50:39 +03001# Copyright © 2017 Amdocs, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
kj52dfb132018-03-27 15:50:39 +030024 heritage: {{ .Release.Service }}
25spec:
Instrumentalcc3a0bd2019-05-01 14:18:49 -050026 replicas: {{ .Values.global.aaf.cass.replicas }}
kj52dfb132018-03-27 15:50:39 +030027 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010031 release: {{ include "common.release" . }}
kj52dfb132018-03-27 15:50:39 +030032 spec:
kj52dfb132018-03-27 15:50:39 +030033 containers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000034 - name: {{ include "common.name" . }}
Instrumental0c7bc942019-08-06 16:36:13 -050035 image: {{ .Values.global.repository }}/{{.Values.global.aaf.cass.image}}
kj52dfb132018-03-27 15:50:39 +030036 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Instrumentalcc3a0bd2019-05-01 14:18:49 -050037 # installing with cmd "onap" will not only initialize the DB, but add ONAP bootstrap data as well
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000038 command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"]
Instrumentalcc3a0bd2019-05-01 14:18:49 -050039 lifecycle:
40 preStop:
41 exec:
42 command: ["/bin/sh","-c","rm /opt/app/aaf/status/aaf-cass"]
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000043 ports:
Instrumentalcc3a0bd2019-05-01 14:18:49 -050044 - name: storage
45 containerPort: {{.Values.global.aaf.cass.storage_port}}
46 - name: ssl-storage
47 containerPort: {{.Values.global.aaf.cass.ssl_storage_port}}
48 - name: native-trans
49 containerPort: {{.Values.global.aaf.cass.native_trans_port}}
50 - name: rpc
51 containerPort: {{.Values.global.aaf.cass.rpc_port}}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000052 env:
53 - name: CASSANDRA_CLUSTER_NAME
Instrumentalcc3a0bd2019-05-01 14:18:49 -050054 value: {{.Values.global.aaf.cass.cluster_name}}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000055 - name: CASSANDRA_DC
Instrumentalcc3a0bd2019-05-01 14:18:49 -050056 value: {{.Values.global.aaf.cass.dc}}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000057 - name: HEAP_NEWSIZE
Instrumentalcc3a0bd2019-05-01 14:18:49 -050058 value: {{.Values.global.aaf.cass.heap_new_size}}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000059 - name: MAX_HEAP_SIZE
Instrumentalcc3a0bd2019-05-01 14:18:49 -050060 value: {{.Values.global.aaf.cass.max_heap_size}}
61 - name: MY_POD_NAME
62 valueFrom:
63 fieldRef:
64 fieldPath: metadata.name
65 - name: MY_POD_NAMESPACE
66 valueFrom:
67 fieldRef:
68 fieldPath: metadata.namespace
69 - name: MY_POD_IP
70 valueFrom:
71 fieldRef:
72 fieldPath: status.podIP
kj52dfb132018-03-27 15:50:39 +030073 volumeMounts:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000074 - mountPath: /var/lib/cassandra
Instrumentalcc3a0bd2019-05-01 14:18:49 -050075 name: aaf-cass-vol
76 - mountPath: /opt/app/aaf/status
77 name: aaf-status-vol
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000078 - mountPath: /etc/localtime
79 name: localtime
80 readOnly: true
kj52dfb132018-03-27 15:50:39 +030081 {{- if eq .Values.liveness.enabled true }}
82 livenessProbe:
83 tcpSocket:
Instrumentalcc3a0bd2019-05-01 14:18:49 -050084 port: {{.Values.global.aaf.cass.native_trans_port}}
kj52dfb132018-03-27 15:50:39 +030085 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
86 periodSeconds: {{ .Values.liveness.periodSeconds }}
87 {{ end -}}
88 readinessProbe:
Mike Elliotta91e2bf2018-10-15 11:43:53 -040089 tcpSocket:
Instrumentalcc3a0bd2019-05-01 14:18:49 -050090 port: {{.Values.global.aaf.cass.native_trans_port}}
kj52dfb132018-03-27 15:50:39 +030091 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
92 periodSeconds: {{ .Values.readiness.periodSeconds }}
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000093 resources:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000094{{ include "common.resources" . | indent 10 }}
kj52dfb132018-03-27 15:50:39 +030095 {{- if .Values.nodeSelector }}
96 nodeSelector:
97{{ toYaml .Values.nodeSelector | indent 10 }}
98 {{- end -}}
99 {{- if .Values.affinity }}
100 affinity:
101{{ toYaml .Values.affinity | indent 10 }}
102 {{- end }}
kj52dfb132018-03-27 15:50:39 +0300103 volumes:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000104 - name: localtime
105 hostPath:
106 path: /etc/localtime
Instrumentalcc3a0bd2019-05-01 14:18:49 -0500107 - name: aaf-status-vol
108 persistentVolumeClaim:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100109 claimName: {{ include "common.release" . }}-aaf-status
Instrumentalcc3a0bd2019-05-01 14:18:49 -0500110 - name: aaf-cass-vol
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000111 {{- if .Values.persistence.enabled }}
112 persistentVolumeClaim:
Sylvain Desbureaux7a235752019-11-28 15:01:45 +0100113 claimName: {{ include "common.fullname" . }}-data
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000114 {{- else }}
115 emptyDir: {}
116 {{- end }}
kj52dfb132018-03-27 15:50:39 +0300117 imagePullSecrets:
Instrumental378109d2018-10-16 20:40:41 -0500118 - name: "{{ include "common.namespace" . }}-docker-registry-key"