blob: cf0ce8f899d7d53f4efd0db79f6046627a8fcc30 [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
41 - command:
42 - sh
43 args:
44 - -c
45 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
46 env:
47 - name: KEYSTORE_PASSWORD
48 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "music-keystore-pw" "key" "password") | indent 12}}
49 - name: CASSA_USER
50 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cassa-secret" "key" "login") | indent 12 }}
51 - name: CASSA_PASSWORD
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cassa-secret" "key" "password") | indent 12 }}
53 volumeMounts:
54 - mountPath: /config-input
55 name: properties-music-scrubbed
56 - mountPath: /config
57 name: properties-music
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010058 image: {{ include "repositoryGenerator.image.envsubst" . }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 name: {{ include "common.name" . }}-update-config
61 containers:
62 # MUSIC Container
63 - name: "{{ include "common.name" . }}-springboot"
Sylvain Desbureaux589ecb92020-11-19 17:19:06 +010064 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000065 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66 ports: {{ include "common.containerPorts" . | nindent 12 }}
67 # disable liveness probe when breakpoints set in debugger
68 # so K8s doesn't restart unresponsive container
69 {{ if eq .Values.liveness.enabled true }}
70 livenessProbe:
71 tcpSocket:
72 port: {{ .Values.liveness.port }}
73 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
74 periodSeconds: {{ .Values.liveness.periodSeconds }}
75 {{ end -}}
76 readinessProbe:
77 tcpSocket:
78 port: {{ .Values.readiness.port }}
79 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
80 periodSeconds: {{ .Values.readiness.periodSeconds }}
81 resources:
Jakub Latusek78234a52020-09-15 11:07:56 +020082{{ include "common.resources" . | indent 12 }}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000083 env:
84 - name: SPRING_OPTS
85 value: "{{ .Values.springOpts }}"
86 - name: JAVA_OPTS
87 value: "{{ .Values.javaOpts }}"
88 - name: DEBUG
89 value: "{{ .Values.debug }}"
90 volumeMounts:
91 - name: localtime
92 mountPath: /etc/localtime
93 readOnly: true
94 - name: properties-music
95 mountPath: /opt/app/music/etc/music.properties
96 subPath: music.properties
97 - name: properties-music
98 mountPath: /opt/app/music/etc/music-sb.properties
99 subPath: music-sb.properties
100 - name: properties-music-scrubbed
101 mountPath: /opt/app/music/etc/logback.xml
102 subPath: logback.xml
103 - name: certs-aaf
104 mountPath: /opt/app/aafcertman/
105 volumes:
106 - name: shared-data
107 emptyDir: {}
108 - name: certificate-vol
109 emptyDir: {}
110 - name: localtime
111 hostPath:
112 path: /etc/localtime
113 - name: properties-music-scrubbed
114 configMap:
115 name: {{ include "common.fullname" . }}
116 - name: properties-music
117 emptyDir:
118 medium: Memory
119 - name: certs-aaf
120 secret:
121 secretName: {{ include "common.secret.getSecretNameFast" (dict "global" . "uid" "music-certs") }}