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