kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 2 | # Modifications © 2020 Orange |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 16 | apiVersion: apps/v1 |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 17 | kind: Deployment |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 19 | spec: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 20 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 21 | replicas: {{ .Values.replicaCount }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 22 | template: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 23 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 24 | spec: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 25 | initContainers: |
| 26 | - name: fix-permission |
| 27 | command: |
| 28 | - /bin/sh |
| 29 | args: |
| 30 | - -c |
| 31 | - | |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 32 | chown -R 1000:1000 /opt/app/aaf/status |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 33 | chown -R 1000:1000 /var/lib/cassandra |
| 34 | image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}" |
| 35 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 36 | volumeMounts: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 37 | - mountPath: /var/lib/cassandra |
| 38 | name: aaf-cass-vol |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 39 | resources: |
| 40 | limits: |
| 41 | cpu: 100m |
| 42 | memory: 100Mi |
| 43 | requests: |
| 44 | cpu: 30m |
| 45 | memory: 100Mi |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 46 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 47 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 48 | image: {{ include "common.repository" . }}/{{ .Values.image }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 49 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 50 | # 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] | 51 | command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"] |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 52 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 53 | env: |
| 54 | - name: CASSANDRA_CLUSTER_NAME |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 55 | value: {{ .Values.config.cluster_name }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 56 | - name: CASSANDRA_DC |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 57 | value: {{ .Values.config.dc }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 58 | - name: CQLSH |
| 59 | value: "/opt/cassandra/bin/cqlsh" |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 60 | - name: HEAP_NEWSIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 61 | value: {{ .Values.config.heap_new_size }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 62 | - name: MAX_HEAP_SIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 63 | value: {{ .Values.config.max_heap_size }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 64 | - name: MY_POD_NAME |
| 65 | valueFrom: |
| 66 | fieldRef: |
| 67 | fieldPath: metadata.name |
| 68 | - name: MY_POD_NAMESPACE |
| 69 | valueFrom: |
| 70 | fieldRef: |
| 71 | fieldPath: metadata.namespace |
| 72 | - name: MY_POD_IP |
| 73 | valueFrom: |
| 74 | fieldRef: |
| 75 | fieldPath: status.podIP |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 76 | volumeMounts: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 77 | - mountPath: /var/lib/cassandra |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 78 | name: aaf-cass-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 79 | - mountPath: /etc/localtime |
| 80 | name: localtime |
| 81 | readOnly: true |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 82 | {{- if eq .Values.liveness.enabled true }} |
| 83 | livenessProbe: |
| 84 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 85 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 86 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 87 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 88 | {{ end -}} |
| 89 | readinessProbe: |
Mike Elliott | a91e2bf | 2018-10-15 11:43:53 -0400 | [diff] [blame] | 90 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 91 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 92 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 93 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 94 | resources: {{ include "common.resources" . | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 95 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 96 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 97 | {{- end -}} |
| 98 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 99 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 100 | {{- end }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 101 | volumes: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 102 | - name: localtime |
| 103 | hostPath: |
| 104 | path: /etc/localtime |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 105 | - name: aaf-cass-vol |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 106 | {{- if .Values.persistence.enabled }} |
| 107 | persistentVolumeClaim: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 108 | claimName: {{ include "common.fullname" . }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 109 | {{- else }} |
| 110 | emptyDir: {} |
| 111 | {{- end }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 112 | imagePullSecrets: |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 113 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |