Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
Durgpal | 7ad4069 | 2018-08-03 07:28:36 +0000 | [diff] [blame] | 3 | # Modifications Copyright © 2018 AT&T |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 4 | # |
| 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 Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
Sylvain Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 17 | |
| 18 | apiVersion: apps/v1 |
sunil unnava | b96a391 | 2018-12-06 09:50:39 -0500 | [diff] [blame] | 19 | kind: StatefulSet |
Sylvain Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 21 | spec: |
Sylvain Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 23 | serviceName: {{ include "common.servicename" . }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 24 | replicas: {{ .Values.replicaCount }} |
| 25 | template: |
Sylvain Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 26 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 27 | spec: |
| 28 | initContainers: |
| 29 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 30 | - /app/ready.py |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 31 | args: |
| 32 | - --container-name |
Dominic Lunanuova | 1ba2b25 | 2018-04-30 19:01:31 +0000 | [diff] [blame] | 33 | - {{ .Values.kafka.name }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 34 | - --container-name |
Dominic Lunanuova | 1ba2b25 | 2018-04-30 19:01:31 +0000 | [diff] [blame] | 35 | - {{ .Values.zookeeper.name }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 36 | env: |
| 37 | - name: NAMESPACE |
| 38 | valueFrom: |
| 39 | fieldRef: |
| 40 | apiVersion: v1 |
| 41 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 42 | image: {{ include "repositoryGenerator.image.readiness" . }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 43 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 44 | name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | e5b6ffc | 2021-02-10 12:11:53 +0100 | [diff] [blame] | 45 | {{ 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 }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 63 | containers: |
su622b | a386565 | 2020-03-25 17:26:51 -0400 | [diff] [blame] | 64 | {{- if .Values.prometheus.jmx.enabled }} |
| 65 | - name: prometheus-jmx-exporter |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 66 | image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }} |
su622b | a386565 | 2020-03-25 17:26:51 -0400 | [diff] [blame] | 67 | 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 }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 85 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 86 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 87 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | e5b6ffc | 2021-02-10 12:11:53 +0100 | [diff] [blame] | 88 | {{- 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 Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 98 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 99 | {{- if eq .Values.liveness.enabled true }} |
| 100 | livenessProbe: |
| 101 | tcpSocket: |
Sylvain Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 102 | port: {{ .Values.liveness.port }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 103 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 104 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
su622b | 8b763cd | 2019-10-14 15:37:37 -0400 | [diff] [blame] | 105 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Sylvain Desbureaux | 8fade99 | 2021-12-06 11:33:11 +0100 | [diff] [blame] | 106 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 107 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
| 108 | {{ end }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 109 | readinessProbe: |
| 110 | tcpSocket: |
Sylvain Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 111 | port: {{ .Values.readiness.port }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 112 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 113 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
su622b | 8b763cd | 2019-10-14 15:37:37 -0400 | [diff] [blame] | 114 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
Sylvain Desbureaux | 8fade99 | 2021-12-06 11:33:11 +0100 | [diff] [blame] | 115 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 116 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
| 117 | startupProbe: |
| 118 | tcpSocket: |
| 119 | port: {{ .Values.startup.port }} |
| 120 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 121 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 122 | timeoutSeconds: {{ .Values.startup.timeoutSeconds }} |
| 123 | successThreshold: {{ .Values.startup.successThreshold }} |
| 124 | failureThreshold: {{ .Values.startup.failureThreshold }} |
sunil unnava | 49aa92d | 2018-10-17 16:25:50 -0400 | [diff] [blame] | 125 | env: |
| 126 | - name: enableCadi |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 127 | value: "{{ .Values.global.aafEnabled }}" |
Sylvain Desbureaux | e5b6ffc | 2021-02-10 12:11:53 +0100 | [diff] [blame] | 128 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 129 | - mountPath: /etc/localtime |
| 130 | name: localtime |
| 131 | readOnly: true |
| 132 | - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties |
| 133 | subPath: MsgRtrApi.properties |
| 134 | name: appprops |
su622b | fdce659 | 2019-08-08 00:28:29 -0400 | [diff] [blame] | 135 | - mountPath: /appl/dmaapMR1/bundleconfig/etc/logback.xml |
| 136 | subPath: logback.xml |
| 137 | name: logback |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 138 | - mountPath: /appl/dmaapMR1/etc/keyfile |
| 139 | subPath: mykey |
| 140 | name: mykey |
Sylvain Desbureaux | f596a2d | 2021-06-30 15:14:32 +0200 | [diff] [blame] | 141 | {{- if .Values.global.aafEnabled }} |
Sylvain Desbureaux | e5b6ffc | 2021-02-10 12:11:53 +0100 | [diff] [blame] | 142 | - mountPath: /appl/dmaapMR1/etc/runner-web.xml |
| 143 | subPath: runner-web.xml |
| 144 | name: etc |
| 145 | - mountPath: /appl/dmaapMR1/bundleconfig/etc/sysprops/sys-props.properties |
| 146 | subPath: sys-props.properties |
| 147 | name: sys-props |
| 148 | - mountPath: /jetty-config |
| 149 | name: jetty |
Sylvain Desbureaux | f596a2d | 2021-06-30 15:14:32 +0200 | [diff] [blame] | 150 | {{- end }} |
Sylvain Desbureaux | be72888 | 2020-03-06 08:58:23 +0100 | [diff] [blame] | 151 | resources: {{ include "common.resources" . | nindent 12 }} |
farida azmy | 13388ba | 2021-03-17 11:33:28 +0200 | [diff] [blame] | 152 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | e5b6ffc | 2021-02-10 12:11:53 +0100 | [diff] [blame] | 153 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 154 | - name: localtime |
| 155 | hostPath: |
| 156 | path: /etc/localtime |
| 157 | - name: appprops |
| 158 | configMap: |
| 159 | name: {{ include "common.fullname" . }}-msgrtrapi-prop-configmap |
Sylvain Desbureaux | e5b6ffc | 2021-02-10 12:11:53 +0100 | [diff] [blame] | 160 | - name: etc |
| 161 | configMap: |
| 162 | name: {{ include "common.fullname" . }}-etc |
su622b | fdce659 | 2019-08-08 00:28:29 -0400 | [diff] [blame] | 163 | - name: logback |
| 164 | configMap: |
| 165 | name: {{ include "common.fullname" . }}-logback-xml-configmap |
su622b | a386565 | 2020-03-25 17:26:51 -0400 | [diff] [blame] | 166 | {{- if .Values.prometheus.jmx.enabled }} |
| 167 | - name: jmx-config |
| 168 | configMap: |
| 169 | name: {{ include "common.fullname" . }}-prometheus-configmap |
| 170 | {{- end }} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 171 | - name: mykey |
| 172 | secret: |
| 173 | secretName: {{ include "common.fullname" . }}-secret |
Sylvain Desbureaux | e5b6ffc | 2021-02-10 12:11:53 +0100 | [diff] [blame] | 174 | - name: sys-props |
| 175 | configMap: |
| 176 | name: {{ include "common.fullname" . }}-sys-props |
| 177 | - name: jetty |
| 178 | emptyDir: {} |
pramod | ad6382f | 2018-03-28 22:32:00 +0000 | [diff] [blame] | 179 | imagePullSecrets: |
| 180 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |