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