Jakub Latusek | a6d04ad | 2020-10-21 13:26:45 +0200 | [diff] [blame] | 1 | {{/* |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 3 | # Modifications © 2020 Orange |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 4 | # |
| 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 Latusek | a6d04ad | 2020-10-21 13:26:45 +0200 | [diff] [blame] | 16 | */}} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 17 | |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 18 | apiVersion: apps/v1 |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 19 | kind: Deployment |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 21 | spec: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 23 | replicas: {{ .Values.replicaCount }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 24 | template: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 25 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 26 | spec: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 27 | initContainers: |
| 28 | - name: fix-permission |
| 29 | command: |
| 30 | - /bin/sh |
| 31 | args: |
| 32 | - -c |
| 33 | - | |
Sylvain Desbureaux | ef76640 | 2021-02-11 18:12:46 +0100 | [diff] [blame^] | 34 | echo "*** Move files from configmap to emptyDir" |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 35 | cp -L /config-input-dats/* /config-dats/ |
Sylvain Desbureaux | ef76640 | 2021-02-11 18:12:46 +0100 | [diff] [blame^] | 36 | echo "*** set righ user to the different folders" |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 37 | chown -R 1000:1000 /config-dats |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 38 | chown -R 1000:1000 /var/lib/cassandra |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 39 | chown -R 1000:1000 /status |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 40 | image: {{ include "repositoryGenerator.image.busybox" . }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 41 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 42 | volumeMounts: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 43 | - mountPath: /var/lib/cassandra |
| 44 | name: aaf-cass-vol |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 45 | - mountPath: /config-input-dats |
| 46 | name: config-cass-init-dats |
| 47 | - mountPath: /config-dats |
| 48 | name: config-cass-dats |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 49 | - mountPath: /status |
| 50 | name: aaf-status |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 51 | resources: |
| 52 | limits: |
| 53 | cpu: 100m |
| 54 | memory: 100Mi |
| 55 | requests: |
| 56 | cpu: 30m |
| 57 | memory: 100Mi |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 58 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 59 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 60 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 62 | # installing with cmd "onap" will not only initialize the DB, but add ONAP bootstrap data as well |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 63 | command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"] |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 64 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 65 | env: |
| 66 | - name: CASSANDRA_CLUSTER_NAME |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 67 | value: {{ .Values.config.cluster_name }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 68 | - name: CASSANDRA_DC |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 69 | value: {{ .Values.config.dc }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 70 | - name: CQLSH |
| 71 | value: "/opt/cassandra/bin/cqlsh" |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 72 | - name: HEAP_NEWSIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 73 | value: {{ .Values.config.heap_new_size }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 74 | - name: MAX_HEAP_SIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 75 | value: {{ .Values.config.max_heap_size }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 76 | - name: MY_POD_NAME |
| 77 | valueFrom: |
| 78 | fieldRef: |
| 79 | fieldPath: metadata.name |
| 80 | - name: MY_POD_NAMESPACE |
| 81 | valueFrom: |
| 82 | fieldRef: |
| 83 | fieldPath: metadata.namespace |
| 84 | - name: MY_POD_IP |
| 85 | valueFrom: |
| 86 | fieldRef: |
| 87 | fieldPath: status.podIP |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 88 | volumeMounts: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 89 | - mountPath: /var/lib/cassandra |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 90 | name: aaf-cass-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 91 | - mountPath: /etc/localtime |
| 92 | name: localtime |
| 93 | readOnly: true |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 94 | - mountPath: /opt/app/aaf/cass_init/dats |
| 95 | name: config-cass-dats |
| 96 | - mountPath: /opt/app/aaf/status |
| 97 | name: aaf-status |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 98 | {{- if eq .Values.liveness.enabled true }} |
| 99 | livenessProbe: |
| 100 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 101 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 102 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 103 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 104 | {{ end -}} |
| 105 | readinessProbe: |
Mike Elliott | a91e2bf | 2018-10-15 11:43:53 -0400 | [diff] [blame] | 106 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 107 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 108 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 109 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 110 | resources: {{ include "common.resources" . | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 111 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 112 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 113 | {{- end -}} |
| 114 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 115 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 116 | {{- end }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 117 | volumes: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 118 | - name: localtime |
| 119 | hostPath: |
| 120 | path: /etc/localtime |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 121 | - name: aaf-status |
| 122 | emptyDir: {} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 123 | - name: aaf-cass-vol |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 124 | {{- if .Values.persistence.enabled }} |
| 125 | persistentVolumeClaim: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 126 | claimName: {{ include "common.fullname" . }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 127 | {{- else }} |
| 128 | emptyDir: {} |
| 129 | {{- end }} |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 130 | - name: config-cass-init-dats |
| 131 | configMap: |
| 132 | name: {{ include "common.fullname" . }}-cass-init-dats |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame] | 133 | - name: config-cass-dats |
| 134 | emptyDir: {} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 135 | imagePullSecrets: |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 136 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |