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 | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame^] | 34 | echo "*** input data ***" |
| 35 | ls -l /config-input-data/* |
| 36 | echo "*** input dats ***" |
| 37 | ls -l /config-input-dats/* |
| 38 | cp -L /config-input-data/* /config-data/ |
| 39 | cp -L /config-input-dats/* /config-dats/ |
| 40 | echo "*** output data ***" |
| 41 | ls -l /config-data/* |
| 42 | echo "*** output dats ***" |
| 43 | ls -l /config-dats/* |
| 44 | chown -R 1000:1000 /config-data |
| 45 | chown -R 1000:1000 /config-dats |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 46 | chown -R 1000:1000 /var/lib/cassandra |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame^] | 47 | chown -R 1000:1000 /status |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 48 | image: {{ include "repositoryGenerator.image.busybox" . }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 49 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 50 | volumeMounts: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 51 | - mountPath: /var/lib/cassandra |
| 52 | name: aaf-cass-vol |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame^] | 53 | - mountPath: /config-input-data |
| 54 | name: config-cass-init-data |
| 55 | - mountPath: /config-input-dats |
| 56 | name: config-cass-init-dats |
| 57 | - mountPath: /config-dats |
| 58 | name: config-cass-dats |
| 59 | - mountPath: /config-data |
| 60 | name: config-cass-data |
| 61 | - mountPath: /status |
| 62 | name: aaf-status |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 63 | resources: |
| 64 | limits: |
| 65 | cpu: 100m |
| 66 | memory: 100Mi |
| 67 | requests: |
| 68 | cpu: 30m |
| 69 | memory: 100Mi |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 70 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 71 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 72 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 73 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 74 | # 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] | 75 | command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"] |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 76 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 77 | env: |
| 78 | - name: CASSANDRA_CLUSTER_NAME |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 79 | value: {{ .Values.config.cluster_name }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 80 | - name: CASSANDRA_DC |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 81 | value: {{ .Values.config.dc }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 82 | - name: CQLSH |
| 83 | value: "/opt/cassandra/bin/cqlsh" |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 84 | - name: HEAP_NEWSIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 85 | value: {{ .Values.config.heap_new_size }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 86 | - name: MAX_HEAP_SIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 87 | value: {{ .Values.config.max_heap_size }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 88 | - name: MY_POD_NAME |
| 89 | valueFrom: |
| 90 | fieldRef: |
| 91 | fieldPath: metadata.name |
| 92 | - name: MY_POD_NAMESPACE |
| 93 | valueFrom: |
| 94 | fieldRef: |
| 95 | fieldPath: metadata.namespace |
| 96 | - name: MY_POD_IP |
| 97 | valueFrom: |
| 98 | fieldRef: |
| 99 | fieldPath: status.podIP |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 100 | volumeMounts: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 101 | - mountPath: /var/lib/cassandra |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 102 | name: aaf-cass-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 103 | - mountPath: /etc/localtime |
| 104 | name: localtime |
| 105 | readOnly: true |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame^] | 106 | - mountPath: /opt/app/aaf/cass_init/data |
| 107 | name: config-cass-data |
| 108 | - mountPath: /opt/app/aaf/cass_init/dats |
| 109 | name: config-cass-dats |
| 110 | - mountPath: /opt/app/aaf/status |
| 111 | name: aaf-status |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 112 | {{- if eq .Values.liveness.enabled true }} |
| 113 | livenessProbe: |
| 114 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 115 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 116 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 117 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 118 | {{ end -}} |
| 119 | readinessProbe: |
Mike Elliott | a91e2bf | 2018-10-15 11:43:53 -0400 | [diff] [blame] | 120 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 121 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 122 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 123 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 124 | resources: {{ include "common.resources" . | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 125 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 126 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 127 | {{- end -}} |
| 128 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 129 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 130 | {{- end }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 131 | volumes: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 132 | - name: localtime |
| 133 | hostPath: |
| 134 | path: /etc/localtime |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame^] | 135 | - name: aaf-status |
| 136 | emptyDir: {} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 137 | - name: aaf-cass-vol |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 138 | {{- if .Values.persistence.enabled }} |
| 139 | persistentVolumeClaim: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 140 | claimName: {{ include "common.fullname" . }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 141 | {{- else }} |
| 142 | emptyDir: {} |
| 143 | {{- end }} |
Sylvain Desbureaux | 9e2ca9d | 2021-01-11 08:15:10 +0000 | [diff] [blame^] | 144 | - name: config-cass-init-dats |
| 145 | configMap: |
| 146 | name: {{ include "common.fullname" . }}-cass-init-dats |
| 147 | - name: config-cass-init-data |
| 148 | configMap: |
| 149 | name: {{ include "common.fullname" . }}-cass-init-data |
| 150 | - name: config-cass-dats |
| 151 | emptyDir: {} |
| 152 | - name: config-cass-data |
| 153 | emptyDir: {} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 154 | imagePullSecrets: |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 155 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |