blob: 50889561cfd31bf0bc6b91ba7f59204f406f2717 [file] [log] [blame]
Jakub Latuseka6d04ad2020-10-21 13:26:45 +02001{{/*
kj52dfb132018-03-27 15:50:39 +03002# Copyright © 2017 Amdocs, Bell Canada
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +02003# Modifications © 2020 Orange
kj52dfb132018-03-27 15:50:39 +03004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latuseka6d04ad2020-10-21 13:26:45 +020016*/}}
kj52dfb132018-03-27 15:50:39 +030017
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020018apiVersion: apps/v1
kj52dfb132018-03-27 15:50:39 +030019kind: Deployment
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
kj52dfb132018-03-27 15:50:39 +030021spec:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020022 selector: {{- include "common.selectors" . | nindent 4 }}
23 replicas: {{ .Values.replicaCount }}
kj52dfb132018-03-27 15:50:39 +030024 template:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020025 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
kj52dfb132018-03-27 15:50:39 +030026 spec:
ChrisCec86a532020-03-19 15:53:31 -050027 initContainers:
28 - name: fix-permission
29 command:
30 - /bin/sh
31 args:
32 - -c
33 - |
ChrisCec86a532020-03-19 15:53:31 -050034 chown -R 1000:1000 /opt/app/aaf/status
ChrisCec86a532020-03-19 15:53:31 -050035 chown -R 1000:1000 /var/lib/cassandra
36 image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
37 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 volumeMounts:
ChrisCec86a532020-03-19 15:53:31 -050039 - mountPath: /var/lib/cassandra
40 name: aaf-cass-vol
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020041 resources:
42 limits:
43 cpu: 100m
44 memory: 100Mi
45 requests:
46 cpu: 30m
47 memory: 100Mi
kj52dfb132018-03-27 15:50:39 +030048 containers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000049 - name: {{ include "common.name" . }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020050 image: {{ include "common.repository" . }}/{{ .Values.image }}
kj52dfb132018-03-27 15:50:39 +030051 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Instrumentalcc3a0bd2019-05-01 14:18:49 -050052 # installing with cmd "onap" will not only initialize the DB, but add ONAP bootstrap data as well
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000053 command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"]
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020054 ports: {{ include "common.containerPorts" . | nindent 10 }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000055 env:
56 - name: CASSANDRA_CLUSTER_NAME
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020057 value: {{ .Values.config.cluster_name }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000058 - name: CASSANDRA_DC
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020059 value: {{ .Values.config.dc }}
ChrisCec86a532020-03-19 15:53:31 -050060 - name: CQLSH
61 value: "/opt/cassandra/bin/cqlsh"
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000062 - name: HEAP_NEWSIZE
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020063 value: {{ .Values.config.heap_new_size }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000064 - name: MAX_HEAP_SIZE
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020065 value: {{ .Values.config.max_heap_size }}
Instrumentalcc3a0bd2019-05-01 14:18:49 -050066 - name: MY_POD_NAME
67 valueFrom:
68 fieldRef:
69 fieldPath: metadata.name
70 - name: MY_POD_NAMESPACE
71 valueFrom:
72 fieldRef:
73 fieldPath: metadata.namespace
74 - name: MY_POD_IP
75 valueFrom:
76 fieldRef:
77 fieldPath: status.podIP
kj52dfb132018-03-27 15:50:39 +030078 volumeMounts:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000079 - mountPath: /var/lib/cassandra
Instrumentalcc3a0bd2019-05-01 14:18:49 -050080 name: aaf-cass-vol
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000081 - mountPath: /etc/localtime
82 name: localtime
83 readOnly: true
kj52dfb132018-03-27 15:50:39 +030084 {{- if eq .Values.liveness.enabled true }}
85 livenessProbe:
86 tcpSocket:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020087 port: tcp-cql
kj52dfb132018-03-27 15:50:39 +030088 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
89 periodSeconds: {{ .Values.liveness.periodSeconds }}
90 {{ end -}}
91 readinessProbe:
Mike Elliotta91e2bf2018-10-15 11:43:53 -040092 tcpSocket:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020093 port: tcp-cql
kj52dfb132018-03-27 15:50:39 +030094 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
95 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020096 resources: {{ include "common.resources" . | nindent 10 }}
kj52dfb132018-03-27 15:50:39 +030097 {{- if .Values.nodeSelector }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020098 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
kj52dfb132018-03-27 15:50:39 +030099 {{- end -}}
100 {{- if .Values.affinity }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +0200101 affinity: {{ toYaml .Values.affinity | nindent 10 }}
kj52dfb132018-03-27 15:50:39 +0300102 {{- 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-cass-vol
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000108 {{- if .Values.persistence.enabled }}
109 persistentVolumeClaim:
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +0200110 claimName: {{ include "common.fullname" . }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000111 {{- else }}
112 emptyDir: {}
113 {{- end }}
kj52dfb132018-03-27 15:50:39 +0300114 imagePullSecrets:
Instrumental378109d2018-10-16 20:40:41 -0500115 - name: "{{ include "common.namespace" . }}-docker-registry-key"