blob: 53d5a366f7df256a9f2ba74686fbefb5485fce8b [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:
andreas-geisslerf84cccd2021-07-07 15:40:41 +020026 imagePullSecrets:
27 - name: "{{ include "common.namespace" . }}-docker-registry-key"
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000028 initContainers:
29 - name: {{ include "common.name" . }}-cassandra-readiness
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010030 image: {{ include "repositoryGenerator.image.readiness" . }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000031 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
32 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020033 - /app/ready.py
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000034 args:
35 - -j
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010036 - "{{ include "common.release" . }}-music-cassandra-config"
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000037 env:
38 - name: NAMESPACE
39 valueFrom:
40 fieldRef:
41 apiVersion: v1
42 fieldPath: metadata.namespace
krishnaa96ad1a3ec2021-02-05 15:24:06 +053043 {{ include "common.certInitializer.initContainer" . | indent 8 | trim }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000044 - command:
45 - sh
46 args:
47 - -c
krishnaa96ad1a3ec2021-02-05 15:24:06 +053048 - "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 +000049 env:
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000050 - 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 }}
krishnaa96ad1a3ec2021-02-05 15:24:06 +053054 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000055 - mountPath: /config-input
56 name: properties-music-scrubbed
57 - mountPath: /config
58 name: properties-music
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010059 image: {{ include "repositoryGenerator.image.envsubst" . }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000060 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 Desbureaux589ecb92020-11-19 17:19:06 +010065 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000066 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 Latusek78234a52020-09-15 11:07:56 +020083{{ include "common.resources" . | indent 12 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000084 env:
85 - name: SPRING_OPTS
86 value: "{{ .Values.springOpts }}"
87 - name: JAVA_OPTS
88 value: "{{ .Values.javaOpts }}"
89 - name: DEBUG
90 value: "{{ .Values.debug }}"
krishnaa96ad1a3ec2021-02-05 15:24:06 +053091 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000092 - 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
krishnaa96ad1a3ec2021-02-05 15:24:06 +0530104 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +0000105 - 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