blob: 9bad3417929eabaf359d691153ffccd13962ecc0 [file] [log] [blame]
Jakub Latusek67f4e8d2020-10-21 13:36:29 +02001{{/*
pramodad6382f2018-03-28 22:32:00 +00002# Copyright © 2017 Amdocs, Bell Canada
Durgpal7ad40692018-08-03 07:28:36 +00003# Modifications Copyright © 2018 AT&T
pramodad6382f2018-03-28 22:32:00 +00004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusek67f4e8d2020-10-21 13:36:29 +020016*/}}
Sylvain Desbureauxbe728882020-03-06 08:58:23 +010017
18apiVersion: apps/v1
sunil unnavab96a3912018-12-06 09:50:39 -050019kind: StatefulSet
Sylvain Desbureauxbe728882020-03-06 08:58:23 +010020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
pramodad6382f2018-03-28 22:32:00 +000021spec:
Sylvain Desbureauxbe728882020-03-06 08:58:23 +010022 selector: {{- include "common.selectors" . | nindent 4 }}
23 serviceName: {{ include "common.servicename" . }}
pramodad6382f2018-03-28 22:32:00 +000024 replicas: {{ .Values.replicaCount }}
25 template:
Sylvain Desbureauxbe728882020-03-06 08:58:23 +010026 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
pramodad6382f2018-03-28 22:32:00 +000027 spec:
28 initContainers:
29 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020030 - /app/ready.py
pramodad6382f2018-03-28 22:32:00 +000031 args:
32 - --container-name
Dominic Lunanuova1ba2b252018-04-30 19:01:31 +000033 - {{ .Values.kafka.name }}
pramodad6382f2018-03-28 22:32:00 +000034 - --container-name
Dominic Lunanuova1ba2b252018-04-30 19:01:31 +000035 - {{ .Values.zookeeper.name }}
pramodad6382f2018-03-28 22:32:00 +000036 env:
37 - name: NAMESPACE
38 valueFrom:
39 fieldRef:
40 apiVersion: v1
41 fieldPath: metadata.namespace
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010042 image: {{ include "repositoryGenerator.image.readiness" . }}
pramodad6382f2018-03-28 22:32:00 +000043 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
44 name: {{ include "common.name" . }}-readiness
Sylvain Desbureauxe5b6ffc2021-02-10 12:11:53 +010045 {{ include "common.certInitializer.initContainer" . | indent 6 | trim }}
46 {{- if .Values.global.aafEnabled }}
47 - name: {{ include "common.name" . }}-update-config
48 command:
49 - sh
50 args:
51 - -c
52 - |
53 export $(cat {{ .Values.certInitializer.appMountPath }}/local/mycreds.prop | xargs -0);
54 cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done
55 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
56 - mountPath: /config
57 name: jetty
58 - mountPath: /config-input
59 name: etc
60 image: {{ include "repositoryGenerator.image.envsubst" . }}
61 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 {{- end }}
pramodad6382f2018-03-28 22:32:00 +000063 containers:
su622ba3865652020-03-25 17:26:51 -040064 {{- if .Values.prometheus.jmx.enabled }}
65 - name: prometheus-jmx-exporter
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010066 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}
su622ba3865652020-03-25 17:26:51 -040067 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
68 command:
69 - java
70 - -XX:+UnlockExperimentalVMOptions
71 - -XX:+UseCGroupMemoryLimitForHeap
72 - -XX:MaxRAMFraction=1
73 - -XshowSettings:vm
74 - -jar
75 - jmx_prometheus_httpserver.jar
76 - {{ .Values.prometheus.jmx.port | quote }}
77 - /etc/jmx-kafka/jmx-mrservice-prometheus.yml
78 ports:
79 - containerPort: {{ .Values.prometheus.jmx.port }}
80 resources:
81 volumeMounts:
82 - name: jmx-config
83 mountPath: /etc/jmx-kafka
84 {{- end }}
pramodad6382f2018-03-28 22:32:00 +000085 - name: {{ include "common.name" . }}
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010086 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
pramodad6382f2018-03-28 22:32:00 +000087 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxe5b6ffc2021-02-10 12:11:53 +010088 {{- if .Values.global.aafEnabled }}
89 command:
90 - sh
91 args:
92 - -c
93 - |
94 cp /jetty-config/ajsc-jetty.xml /appl/dmaapMR1/etc/
95 cp /jetty-config/cadi.properties {{ .Values.certInitializer.appMountPath }}/local/cadi.properties
96 /bin/sh /appl/startup.sh
97 {{- end }}
Sylvain Desbureauxbe728882020-03-06 08:58:23 +010098 ports: {{ include "common.containerPorts" . | nindent 10 }}
pramodad6382f2018-03-28 22:32:00 +000099 {{- if eq .Values.liveness.enabled true }}
100 livenessProbe:
101 tcpSocket:
Sylvain Desbureauxbe728882020-03-06 08:58:23 +0100102 port: {{ .Values.liveness.port }}
pramodad6382f2018-03-28 22:32:00 +0000103 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
104 periodSeconds: {{ .Values.liveness.periodSeconds }}
su622b8b763cd2019-10-14 15:37:37 -0400105 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
pramodad6382f2018-03-28 22:32:00 +0000106 {{ end -}}
107 readinessProbe:
108 tcpSocket:
Sylvain Desbureauxbe728882020-03-06 08:58:23 +0100109 port: {{ .Values.readiness.port }}
pramodad6382f2018-03-28 22:32:00 +0000110 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
111 periodSeconds: {{ .Values.readiness.periodSeconds }}
su622b8b763cd2019-10-14 15:37:37 -0400112 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
sunil unnava49aa92d2018-10-17 16:25:50 -0400113 env:
114 - name: enableCadi
efiacore62958b2019-09-27 16:54:36 +0100115 value: "{{ .Values.global.aafEnabled }}"
Sylvain Desbureauxe5b6ffc2021-02-10 12:11:53 +0100116 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
pramodad6382f2018-03-28 22:32:00 +0000117 - mountPath: /etc/localtime
118 name: localtime
119 readOnly: true
120 - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
121 subPath: MsgRtrApi.properties
122 name: appprops
su622bfdce6592019-08-08 00:28:29 -0400123 - mountPath: /appl/dmaapMR1/bundleconfig/etc/logback.xml
124 subPath: logback.xml
125 name: logback
pramodad6382f2018-03-28 22:32:00 +0000126 - mountPath: /appl/dmaapMR1/etc/keyfile
127 subPath: mykey
128 name: mykey
Sylvain Desbureauxf596a2d2021-06-30 15:14:32 +0200129 {{- if .Values.global.aafEnabled }}
Sylvain Desbureauxe5b6ffc2021-02-10 12:11:53 +0100130 - mountPath: /appl/dmaapMR1/etc/runner-web.xml
131 subPath: runner-web.xml
132 name: etc
133 - mountPath: /appl/dmaapMR1/bundleconfig/etc/sysprops/sys-props.properties
134 subPath: sys-props.properties
135 name: sys-props
136 - mountPath: /jetty-config
137 name: jetty
Sylvain Desbureauxf596a2d2021-06-30 15:14:32 +0200138 {{- end }}
Sylvain Desbureauxbe728882020-03-06 08:58:23 +0100139 resources: {{ include "common.resources" . | nindent 12 }}
farida azmy13388ba2021-03-17 11:33:28 +0200140 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureauxe5b6ffc2021-02-10 12:11:53 +0100141 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
pramodad6382f2018-03-28 22:32:00 +0000142 - name: localtime
143 hostPath:
144 path: /etc/localtime
145 - name: appprops
146 configMap:
147 name: {{ include "common.fullname" . }}-msgrtrapi-prop-configmap
Sylvain Desbureauxe5b6ffc2021-02-10 12:11:53 +0100148 - name: etc
149 configMap:
150 name: {{ include "common.fullname" . }}-etc
su622bfdce6592019-08-08 00:28:29 -0400151 - name: logback
152 configMap:
153 name: {{ include "common.fullname" . }}-logback-xml-configmap
su622ba3865652020-03-25 17:26:51 -0400154 {{- if .Values.prometheus.jmx.enabled }}
155 - name: jmx-config
156 configMap:
157 name: {{ include "common.fullname" . }}-prometheus-configmap
158 {{- end }}
pramodad6382f2018-03-28 22:32:00 +0000159 - name: mykey
160 secret:
161 secretName: {{ include "common.fullname" . }}-secret
Sylvain Desbureauxe5b6ffc2021-02-10 12:11:53 +0100162 - name: sys-props
163 configMap:
164 name: {{ include "common.fullname" . }}-sys-props
165 - name: jetty
166 emptyDir: {}
pramodad6382f2018-03-28 22:32:00 +0000167 imagePullSecrets:
168 - name: "{{ include "common.namespace" . }}-docker-registry-key"