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 | - | |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 34 | chown -R 1000:1000 /opt/app/aaf/status |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 35 | chown -R 1000:1000 /var/lib/cassandra |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame^] | 36 | image: {{ include "repositoryGenerator.image.busybox" . }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 37 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 38 | volumeMounts: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 39 | - mountPath: /var/lib/cassandra |
| 40 | name: aaf-cass-vol |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 41 | resources: |
| 42 | limits: |
| 43 | cpu: 100m |
| 44 | memory: 100Mi |
| 45 | requests: |
| 46 | cpu: 30m |
| 47 | memory: 100Mi |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 48 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 49 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame^] | 50 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 52 | # 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] | 53 | command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"] |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 54 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 55 | env: |
| 56 | - name: CASSANDRA_CLUSTER_NAME |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 57 | value: {{ .Values.config.cluster_name }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 58 | - name: CASSANDRA_DC |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 59 | value: {{ .Values.config.dc }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 60 | - name: CQLSH |
| 61 | value: "/opt/cassandra/bin/cqlsh" |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 62 | - name: HEAP_NEWSIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 63 | value: {{ .Values.config.heap_new_size }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 64 | - name: MAX_HEAP_SIZE |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 65 | value: {{ .Values.config.max_heap_size }} |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 66 | - name: MY_POD_NAME |
| 67 | valueFrom: |
| 68 | fieldRef: |
| 69 | fieldPath: metadata.name |
| 70 | - name: MY_POD_NAMESPACE |
| 71 | valueFrom: |
| 72 | fieldRef: |
| 73 | fieldPath: metadata.namespace |
| 74 | - name: MY_POD_IP |
| 75 | valueFrom: |
| 76 | fieldRef: |
| 77 | fieldPath: status.podIP |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 78 | volumeMounts: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 79 | - mountPath: /var/lib/cassandra |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 80 | name: aaf-cass-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 81 | - mountPath: /etc/localtime |
| 82 | name: localtime |
| 83 | readOnly: true |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 84 | {{- if eq .Values.liveness.enabled true }} |
| 85 | livenessProbe: |
| 86 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 87 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 88 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 89 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 90 | {{ end -}} |
| 91 | readinessProbe: |
Mike Elliott | a91e2bf | 2018-10-15 11:43:53 -0400 | [diff] [blame] | 92 | tcpSocket: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 93 | port: tcp-cql |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 94 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 95 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 96 | resources: {{ include "common.resources" . | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 97 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 98 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 99 | {{- end -}} |
| 100 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 101 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 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-cass-vol |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 108 | {{- if .Values.persistence.enabled }} |
| 109 | persistentVolumeClaim: |
Sylvain Desbureaux | 8f9ef35 | 2020-04-14 15:02:57 +0200 | [diff] [blame] | 110 | claimName: {{ include "common.fullname" . }} |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 111 | {{- else }} |
| 112 | emptyDir: {} |
| 113 | {{- end }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 114 | imagePullSecrets: |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 115 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |