Jakub Latusek | 3659d9f | 2020-09-14 16:21:55 +0200 | [diff] [blame] | 1 | {{/* |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 2 | # Copyright © 2017-2020 AT&T, Amdocs, Bell Canada |
| 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. |
Jakub Latusek | 3659d9f | 2020-09-14 16:21:55 +0200 | [diff] [blame] | 15 | */}} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 16 | |
| 17 | apiVersion: apps/v1 |
| 18 | kind: Deployment |
| 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 20 | spec: |
| 21 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 22 | replicas: {{ .Values.replicaCount }} |
| 23 | template: |
| 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 25 | spec: |
| 26 | initContainers: |
| 27 | - name: {{ include "common.name" . }}-cassandra-readiness |
Sylvain Desbureaux | 589ecb9 | 2020-11-19 17:19:06 +0100 | [diff] [blame] | 28 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 29 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 30 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 31 | - /app/ready.py |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 32 | args: |
| 33 | - -j |
Sylvain Desbureaux | 589ecb9 | 2020-11-19 17:19:06 +0100 | [diff] [blame] | 34 | - "{{ include "common.release" . }}-music-cassandra-config" |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 35 | env: |
| 36 | - name: NAMESPACE |
| 37 | valueFrom: |
| 38 | fieldRef: |
| 39 | apiVersion: v1 |
| 40 | fieldPath: metadata.namespace |
krishnaa96 | ad1a3ec | 2021-02-05 15:24:06 +0530 | [diff] [blame^] | 41 | {{ include "common.certInitializer.initContainer" . | indent 8 | trim }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 42 | - command: |
| 43 | - sh |
| 44 | args: |
| 45 | - -c |
krishnaa96 | ad1a3ec | 2021-02-05 15:24:06 +0530 | [diff] [blame^] | 46 | - "export KEYSTORE_PASSWORD=$(cat /opt/app/aafcertman/local/.pass); cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 47 | env: |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 48 | - name: CASSA_USER |
| 49 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cassa-secret" "key" "login") | indent 12 }} |
| 50 | - name: CASSA_PASSWORD |
| 51 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cassa-secret" "key" "password") | indent 12 }} |
krishnaa96 | ad1a3ec | 2021-02-05 15:24:06 +0530 | [diff] [blame^] | 52 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 53 | - mountPath: /config-input |
| 54 | name: properties-music-scrubbed |
| 55 | - mountPath: /config |
| 56 | name: properties-music |
Sylvain Desbureaux | 589ecb9 | 2020-11-19 17:19:06 +0100 | [diff] [blame] | 57 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 58 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 59 | name: {{ include "common.name" . }}-update-config |
| 60 | containers: |
| 61 | # MUSIC Container |
| 62 | - name: "{{ include "common.name" . }}-springboot" |
Sylvain Desbureaux | 589ecb9 | 2020-11-19 17:19:06 +0100 | [diff] [blame] | 63 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 64 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 65 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
| 66 | # disable liveness probe when breakpoints set in debugger |
| 67 | # so K8s doesn't restart unresponsive container |
| 68 | {{ if eq .Values.liveness.enabled true }} |
| 69 | livenessProbe: |
| 70 | tcpSocket: |
| 71 | port: {{ .Values.liveness.port }} |
| 72 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 73 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 74 | {{ end -}} |
| 75 | readinessProbe: |
| 76 | tcpSocket: |
| 77 | port: {{ .Values.readiness.port }} |
| 78 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 79 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 80 | resources: |
Jakub Latusek | 78234a5 | 2020-09-15 11:07:56 +0200 | [diff] [blame] | 81 | {{ include "common.resources" . | indent 12 }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 82 | env: |
| 83 | - name: SPRING_OPTS |
| 84 | value: "{{ .Values.springOpts }}" |
| 85 | - name: JAVA_OPTS |
| 86 | value: "{{ .Values.javaOpts }}" |
| 87 | - name: DEBUG |
| 88 | value: "{{ .Values.debug }}" |
krishnaa96 | ad1a3ec | 2021-02-05 15:24:06 +0530 | [diff] [blame^] | 89 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 90 | - name: localtime |
| 91 | mountPath: /etc/localtime |
| 92 | readOnly: true |
| 93 | - name: properties-music |
| 94 | mountPath: /opt/app/music/etc/music.properties |
| 95 | subPath: music.properties |
| 96 | - name: properties-music |
| 97 | mountPath: /opt/app/music/etc/music-sb.properties |
| 98 | subPath: music-sb.properties |
| 99 | - name: properties-music-scrubbed |
| 100 | mountPath: /opt/app/music/etc/logback.xml |
| 101 | subPath: logback.xml |
krishnaa96 | ad1a3ec | 2021-02-05 15:24:06 +0530 | [diff] [blame^] | 102 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 103 | - name: shared-data |
| 104 | emptyDir: {} |
| 105 | - name: certificate-vol |
| 106 | emptyDir: {} |
| 107 | - name: localtime |
| 108 | hostPath: |
| 109 | path: /etc/localtime |
| 110 | - name: properties-music-scrubbed |
| 111 | configMap: |
| 112 | name: {{ include "common.fullname" . }} |
| 113 | - name: properties-music |
| 114 | emptyDir: |
| 115 | medium: Memory |