kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 1 | # 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 | |
| 15 | apiVersion: extensions/v1beta1 |
| 16 | kind: Deployment |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 23 | release: {{ include "common.release" . }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 26 | replicas: {{ .Values.global.aaf.cass.replicas }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 27 | template: |
| 28 | metadata: |
| 29 | labels: |
| 30 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 31 | release: {{ include "common.release" . }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 32 | spec: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame^] | 33 | initContainers: |
| 34 | - name: fix-permission |
| 35 | command: |
| 36 | - /bin/sh |
| 37 | args: |
| 38 | - -c |
| 39 | - | |
| 40 | chmod -R 775 /opt/app/aaf/status |
| 41 | chown -R 1000:1000 /opt/app/aaf/status |
| 42 | chmod -R 775 /var/lib/cassandra |
| 43 | chown -R 1000:1000 /var/lib/cassandra |
| 44 | image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}" |
| 45 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 46 | volumeMounts: |
| 47 | - mountPath: /opt/app/aaf/status |
| 48 | name: aaf-status-vol |
| 49 | - mountPath: /var/lib/cassandra |
| 50 | name: aaf-cass-vol |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 51 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 52 | - name: {{ include "common.name" . }} |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 53 | image: {{ .Values.global.repository }}/{{.Values.global.aaf.cass.image}} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 54 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 55 | # 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] | 56 | command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"] |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 57 | lifecycle: |
| 58 | preStop: |
| 59 | exec: |
| 60 | command: ["/bin/sh","-c","rm /opt/app/aaf/status/aaf-cass"] |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 61 | ports: |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 62 | - name: storage |
| 63 | containerPort: {{.Values.global.aaf.cass.storage_port}} |
| 64 | - name: ssl-storage |
| 65 | containerPort: {{.Values.global.aaf.cass.ssl_storage_port}} |
| 66 | - name: native-trans |
| 67 | containerPort: {{.Values.global.aaf.cass.native_trans_port}} |
| 68 | - name: rpc |
| 69 | containerPort: {{.Values.global.aaf.cass.rpc_port}} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 70 | env: |
| 71 | - name: CASSANDRA_CLUSTER_NAME |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 72 | value: {{.Values.global.aaf.cass.cluster_name}} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 73 | - name: CASSANDRA_DC |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 74 | value: {{.Values.global.aaf.cass.dc}} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame^] | 75 | - name: CQLSH |
| 76 | value: "/opt/cassandra/bin/cqlsh" |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 77 | - name: HEAP_NEWSIZE |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 78 | value: {{.Values.global.aaf.cass.heap_new_size}} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 79 | - name: MAX_HEAP_SIZE |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 80 | value: {{.Values.global.aaf.cass.max_heap_size}} |
| 81 | - name: MY_POD_NAME |
| 82 | valueFrom: |
| 83 | fieldRef: |
| 84 | fieldPath: metadata.name |
| 85 | - name: MY_POD_NAMESPACE |
| 86 | valueFrom: |
| 87 | fieldRef: |
| 88 | fieldPath: metadata.namespace |
| 89 | - name: MY_POD_IP |
| 90 | valueFrom: |
| 91 | fieldRef: |
| 92 | fieldPath: status.podIP |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 93 | volumeMounts: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 94 | - mountPath: /var/lib/cassandra |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 95 | name: aaf-cass-vol |
| 96 | - mountPath: /opt/app/aaf/status |
| 97 | name: aaf-status-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 98 | - mountPath: /etc/localtime |
| 99 | name: localtime |
| 100 | readOnly: true |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 101 | {{- if eq .Values.liveness.enabled true }} |
| 102 | livenessProbe: |
| 103 | tcpSocket: |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 104 | port: {{.Values.global.aaf.cass.native_trans_port}} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 105 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 106 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 107 | {{ end -}} |
| 108 | readinessProbe: |
Mike Elliott | a91e2bf | 2018-10-15 11:43:53 -0400 | [diff] [blame] | 109 | tcpSocket: |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 110 | port: {{.Values.global.aaf.cass.native_trans_port}} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 111 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 112 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 113 | resources: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 114 | {{ include "common.resources" . | indent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 115 | {{- if .Values.nodeSelector }} |
| 116 | nodeSelector: |
| 117 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 118 | {{- end -}} |
| 119 | {{- if .Values.affinity }} |
| 120 | affinity: |
| 121 | {{ toYaml .Values.affinity | indent 10 }} |
| 122 | {{- end }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 123 | volumes: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 124 | - name: localtime |
| 125 | hostPath: |
| 126 | path: /etc/localtime |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 127 | - name: aaf-status-vol |
| 128 | persistentVolumeClaim: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 129 | claimName: {{ include "common.release" . }}-aaf-status |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 130 | - name: aaf-cass-vol |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 131 | {{- if .Values.persistence.enabled }} |
| 132 | persistentVolumeClaim: |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 133 | claimName: {{ include "common.fullname" . }}-data |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 134 | {{- else }} |
| 135 | emptyDir: {} |
| 136 | {{- end }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 137 | imagePullSecrets: |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 138 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |