blob: 1e5d3c537725d4800ad62b06919556f358f306e9 [file] [log] [blame]
Jakub Latusek3659d9f2020-09-14 16:21:55 +02001{{/*
Tschaen, Brendan08d7b632020-04-02 19:49:13 +00002# 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 Latusek3659d9f2020-09-14 16:21:55 +020015*/}}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000016
17apiVersion: apps/v1
18kind: Deployment
19metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20spec:
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 Desbureaux589ecb92020-11-19 17:19:06 +010028 image: {{ include "repositoryGenerator.image.readiness" . }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000029 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
30 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020031 - /app/ready.py
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000032 args:
33 - -j
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010034 - "{{ include "common.release" . }}-music-cassandra-config"
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000035 env:
36 - name: NAMESPACE
37 valueFrom:
38 fieldRef:
39 apiVersion: v1
40 fieldPath: metadata.namespace
krishnaa96ad1a3ec2021-02-05 15:24:06 +053041 {{ include "common.certInitializer.initContainer" . | indent 8 | trim }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000042 - command:
43 - sh
44 args:
45 - -c
krishnaa96ad1a3ec2021-02-05 15:24:06 +053046 - "export KEYSTORE_PASSWORD=$(cat /opt/app/aafcertman/local/.pass); cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000047 env:
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000048 - 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 }}
krishnaa96ad1a3ec2021-02-05 15:24:06 +053052 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000053 - mountPath: /config-input
54 name: properties-music-scrubbed
55 - mountPath: /config
56 name: properties-music
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010057 image: {{ include "repositoryGenerator.image.envsubst" . }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000058 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 Desbureaux589ecb92020-11-19 17:19:06 +010063 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000064 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 Latusek78234a52020-09-15 11:07:56 +020081{{ include "common.resources" . | indent 12 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000082 env:
83 - name: SPRING_OPTS
84 value: "{{ .Values.springOpts }}"
85 - name: JAVA_OPTS
86 value: "{{ .Values.javaOpts }}"
87 - name: DEBUG
88 value: "{{ .Values.debug }}"
krishnaa96ad1a3ec2021-02-05 15:24:06 +053089 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000090 - 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
krishnaa96ad1a3ec2021-02-05 15:24:06 +0530102 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +0000103 - 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