Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
jhh | 0d1c0e8 | 2022-04-08 14:36:15 -0500 | [diff] [blame] | 3 | # Modifications Copyright © 2018-2020, 2022 AT&T Intellectual Property |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +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 | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 17 | |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 18 | apiVersion: apps/v1 |
mayankg2703 | c798546 | 2018-03-29 14:24:23 +0000 | [diff] [blame] | 19 | kind: StatefulSet |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 21 | spec: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
Mahendra Raghuwanshi | c1395ec | 2018-04-26 03:19:03 +0000 | [diff] [blame] | 23 | serviceName: {{ include "common.servicename" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 24 | replicas: {{ .Values.replicaCount }} |
| 25 | template: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 26 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +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 |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 31 | args: |
| 32 | - --job-name |
| 33 | - {{ include "common.release" . }}-policy-galera-config |
| 34 | env: |
| 35 | - name: NAMESPACE |
| 36 | valueFrom: |
| 37 | fieldRef: |
| 38 | apiVersion: v1 |
| 39 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 40 | image: {{ include "repositoryGenerator.image.readiness" . }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 41 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 42 | name: {{ include "common.name" . }}-db-readiness |
| 43 | {{- if not .Values.nexus.offline }} |
| 44 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 45 | - /app/ready.py |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 46 | args: |
| 47 | - --container-name |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 48 | - {{ .Values.nexus.name }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 49 | env: |
| 50 | - name: NAMESPACE |
| 51 | valueFrom: |
| 52 | fieldRef: |
| 53 | apiVersion: v1 |
| 54 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 55 | image: {{ include "repositoryGenerator.image.readiness" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 56 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 57 | name: {{ include "common.name" . }}-readiness |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 58 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 59 | containers: |
| 60 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 61 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 62 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Taka Cho | 9658ce8 | 2020-12-10 14:34:18 -0500 | [diff] [blame] | 63 | command: ["sh","-c"] |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 64 | args: ["/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot"] |
| 65 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 66 | {{- if eq .Values.liveness.enabled true }} |
| 67 | livenessProbe: |
jhh | 0d1c0e8 | 2022-04-08 14:36:15 -0500 | [diff] [blame] | 68 | httpGet: |
| 69 | path: /healthcheck/controllers |
| 70 | port: 6968 |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 71 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 72 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
jhh | 0d1c0e8 | 2022-04-08 14:36:15 -0500 | [diff] [blame] | 73 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 74 | {{- end }} |
| 75 | readinessProbe: |
| 76 | tcpSocket: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 77 | port: {{ .Values.service.internalPort }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 78 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 79 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 80 | env: |
| 81 | - name: REPLICAS |
| 82 | value: "{{ .Values.replicaCount }}" |
Krzysztof Opasiak | 68b1c92 | 2020-03-26 23:59:36 +0100 | [diff] [blame] | 83 | - name: SQL_USER |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 84 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }} |
Krzysztof Opasiak | 68b1c92 | 2020-03-26 23:59:36 +0100 | [diff] [blame] | 85 | - name: SQL_PASSWORD |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 86 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 87 | volumeMounts: |
| 88 | - mountPath: /etc/localtime |
| 89 | name: localtime |
| 90 | readOnly: true |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 91 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 92 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 93 | name: drools-secret |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 94 | subPath: {{ base $path }} |
| 95 | {{- end }} |
| 96 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 97 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
Jorge Hernandez | 328eadb | 2018-05-15 07:52:21 -0500 | [diff] [blame] | 98 | name: drools-config |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 99 | subPath: {{ base $path }} |
| 100 | {{- end }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 101 | resources: {{ include "common.resources" . | nindent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 102 | {{- if .Values.nodeSelector }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 103 | nodeSelector: |
| 104 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 105 | {{- end -}} |
| 106 | {{- if .Values.affinity }} |
| 107 | affinity: |
| 108 | {{ toYaml .Values.affinity | indent 10 }} |
| 109 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 110 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 111 | volumes: |
| 112 | - name: localtime |
| 113 | hostPath: |
| 114 | path: /etc/localtime |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 115 | - name: drools-config |
| 116 | configMap: |
| 117 | name: {{ include "common.fullname" . }}-configmap |
| 118 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 119 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 120 | - key: {{ base $path }} |
| 121 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 122 | mode: 0755 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 123 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 124 | - name: drools-secret |
| 125 | secret: |
| 126 | secretName: {{ include "common.fullname" . }}-secret |
| 127 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 128 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 129 | - key: {{ base $path }} |
| 130 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 131 | mode: 0644 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 132 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 133 | imagePullSecrets: |
| 134 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |