blob: c664d034bb9cce1926bf0744baa7417573e742f8 [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 "+" "_" }}
23 release: {{ .Release.Name }}
24 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" . }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000031 release: {{ .Release.Name }}
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" . }}
Instrumentalcc3a0bd2019-05-01 14:18:49 -050035 image: {{ .Values.global.repository }}/onap/aaf/aaf_cass:{{.Values.global.aaf.imageVersion}}
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:
109 claimName: {{ .Release.Name }}-aaf-status-pvc
110 - name: aaf-cass-vol
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000111 {{- if .Values.persistence.enabled }}
112 persistentVolumeClaim:
Instrumentalcc3a0bd2019-05-01 14:18:49 -0500113 claimName: {{ include "common.fullname" . }}-pvc
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"