blob: 309a9f38c6d206b650f4bbbd33c48ccef46d990c [file] [log] [blame]
kj52dfb132018-03-27 15:50:39 +03001# Copyright © 2017 Amdocs, Bell Canada
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +02002# Modifications © 2020 Orange
kj52dfb132018-03-27 15:50:39 +03003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020016apiVersion: apps/v1
kj52dfb132018-03-27 15:50:39 +030017kind: Deployment
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020018metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
kj52dfb132018-03-27 15:50:39 +030019spec:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020020 selector: {{- include "common.selectors" . | nindent 4 }}
21 replicas: {{ .Values.replicaCount }}
kj52dfb132018-03-27 15:50:39 +030022 template:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020023 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
kj52dfb132018-03-27 15:50:39 +030024 spec:
ChrisCec86a532020-03-19 15:53:31 -050025 initContainers:
26 - name: fix-permission
27 command:
28 - /bin/sh
29 args:
30 - -c
31 - |
ChrisCec86a532020-03-19 15:53:31 -050032 chown -R 1000:1000 /opt/app/aaf/status
ChrisCec86a532020-03-19 15:53:31 -050033 chown -R 1000:1000 /var/lib/cassandra
34 image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
35 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
36 volumeMounts:
ChrisCec86a532020-03-19 15:53:31 -050037 - mountPath: /var/lib/cassandra
38 name: aaf-cass-vol
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020039 resources:
40 limits:
41 cpu: 100m
42 memory: 100Mi
43 requests:
44 cpu: 30m
45 memory: 100Mi
kj52dfb132018-03-27 15:50:39 +030046 containers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000047 - name: {{ include "common.name" . }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020048 image: {{ include "common.repository" . }}/{{ .Values.image }}
kj52dfb132018-03-27 15:50:39 +030049 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Instrumentalcc3a0bd2019-05-01 14:18:49 -050050 # installing with cmd "onap" will not only initialize the DB, but add ONAP bootstrap data as well
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000051 command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"]
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020052 ports: {{ include "common.containerPorts" . | nindent 10 }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000053 env:
54 - name: CASSANDRA_CLUSTER_NAME
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020055 value: {{ .Values.config.cluster_name }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000056 - name: CASSANDRA_DC
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020057 value: {{ .Values.config.dc }}
ChrisCec86a532020-03-19 15:53:31 -050058 - name: CQLSH
59 value: "/opt/cassandra/bin/cqlsh"
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000060 - name: HEAP_NEWSIZE
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020061 value: {{ .Values.config.heap_new_size }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000062 - name: MAX_HEAP_SIZE
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020063 value: {{ .Values.config.max_heap_size }}
Instrumentalcc3a0bd2019-05-01 14:18:49 -050064 - name: MY_POD_NAME
65 valueFrom:
66 fieldRef:
67 fieldPath: metadata.name
68 - name: MY_POD_NAMESPACE
69 valueFrom:
70 fieldRef:
71 fieldPath: metadata.namespace
72 - name: MY_POD_IP
73 valueFrom:
74 fieldRef:
75 fieldPath: status.podIP
kj52dfb132018-03-27 15:50:39 +030076 volumeMounts:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000077 - mountPath: /var/lib/cassandra
Instrumentalcc3a0bd2019-05-01 14:18:49 -050078 name: aaf-cass-vol
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000079 - mountPath: /etc/localtime
80 name: localtime
81 readOnly: true
kj52dfb132018-03-27 15:50:39 +030082 {{- if eq .Values.liveness.enabled true }}
83 livenessProbe:
84 tcpSocket:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020085 port: tcp-cql
kj52dfb132018-03-27 15:50:39 +030086 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
87 periodSeconds: {{ .Values.liveness.periodSeconds }}
88 {{ end -}}
89 readinessProbe:
Mike Elliotta91e2bf2018-10-15 11:43:53 -040090 tcpSocket:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020091 port: tcp-cql
kj52dfb132018-03-27 15:50:39 +030092 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
93 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020094 resources: {{ include "common.resources" . | nindent 10 }}
kj52dfb132018-03-27 15:50:39 +030095 {{- if .Values.nodeSelector }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020096 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
kj52dfb132018-03-27 15:50:39 +030097 {{- end -}}
98 {{- if .Values.affinity }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020099 affinity: {{ toYaml .Values.affinity | nindent 10 }}
kj52dfb132018-03-27 15:50:39 +0300100 {{- end }}
kj52dfb132018-03-27 15:50:39 +0300101 volumes:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000102 - name: localtime
103 hostPath:
104 path: /etc/localtime
Instrumentalcc3a0bd2019-05-01 14:18:49 -0500105 - name: aaf-cass-vol
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000106 {{- if .Values.persistence.enabled }}
107 persistentVolumeClaim:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +0200108 claimName: {{ include "common.fullname" . }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000109 {{- else }}
110 emptyDir: {}
111 {{- end }}
kj52dfb132018-03-27 15:50:39 +0300112 imagePullSecrets:
Instrumental378109d2018-10-16 20:40:41 -0500113 - name: "{{ include "common.namespace" . }}-docker-registry-key"