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 |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 20 | metadata: |
| 21 | name: {{ include "common.fullname" . }} |
| 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
| 24 | app: {{ include "common.name" . }} |
| 25 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 26 | release: {{ include "common.release" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 27 | heritage: {{ .Release.Service }} |
| 28 | spec: |
Mahendra Raghuwanshi | c1395ec | 2018-04-26 03:19:03 +0000 | [diff] [blame] | 29 | serviceName: {{ include "common.servicename" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 30 | replicas: {{ .Values.replicaCount }} |
mayankg2703 | c798546 | 2018-03-29 14:24:23 +0000 | [diff] [blame] | 31 | selector: |
| 32 | matchLabels: |
| 33 | app: {{ include "common.name" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 34 | template: |
| 35 | metadata: |
| 36 | labels: |
| 37 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 38 | release: {{ include "common.release" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 39 | spec: |
| 40 | initContainers: |
| 41 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 42 | - /app/ready.py |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 43 | args: |
| 44 | - --job-name |
| 45 | - {{ include "common.release" . }}-policy-galera-config |
| 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 52 | image: {{ include "repositoryGenerator.image.readiness" . }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | name: {{ include "common.name" . }}-db-readiness |
| 55 | {{- if not .Values.nexus.offline }} |
| 56 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 57 | - /app/ready.py |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 58 | args: |
| 59 | - --container-name |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 60 | - {{ .Values.nexus.name }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 61 | env: |
| 62 | - name: NAMESPACE |
| 63 | valueFrom: |
| 64 | fieldRef: |
| 65 | apiVersion: v1 |
| 66 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 67 | image: {{ include "repositoryGenerator.image.readiness" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 68 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 69 | name: {{ include "common.name" . }}-readiness |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 70 | {{- end }} |
| 71 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 72 | containers: |
| 73 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 74 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 75 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Taka Cho | 9658ce8 | 2020-12-10 14:34:18 -0500 | [diff] [blame] | 76 | command: ["sh","-c"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 77 | args: ["if [ -f {{ .Values.certInitializer.credsPath }}/.ci ]; then \ |
| 78 | source {{ .Values.certInitializer.credsPath }}/.ci; fi;\ |
jhh | bf8d8a9 | 2020-09-10 14:01:49 -0500 | [diff] [blame] | 79 | cp {{ .Values.certInitializer.credsPath }}/org.onap.policy.p12 ${POLICY_HOME}/etc/ssl/policy-keystore;\ |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 80 | /opt/app/policy/bin/pdpd-cl-entrypoint.sh boot"] |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 81 | ports: |
| 82 | - containerPort: {{ .Values.service.externalPort }} |
| 83 | - containerPort: {{ .Values.service.externalPort2 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 84 | {{- if eq .Values.liveness.enabled true }} |
| 85 | livenessProbe: |
jhh | 0d1c0e8 | 2022-04-08 14:36:15 -0500 | [diff] [blame] | 86 | httpGet: |
| 87 | path: /healthcheck/controllers |
| 88 | port: 6968 |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 89 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 90 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
jhh | 0d1c0e8 | 2022-04-08 14:36:15 -0500 | [diff] [blame] | 91 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 92 | {{- end }} |
| 93 | readinessProbe: |
| 94 | tcpSocket: |
| 95 | port: {{ .Values.service.externalPort }} |
| 96 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 97 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 98 | env: |
| 99 | - name: REPLICAS |
| 100 | value: "{{ .Values.replicaCount }}" |
Krzysztof Opasiak | 68b1c92 | 2020-03-26 23:59:36 +0100 | [diff] [blame] | 101 | - name: SQL_USER |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 102 | {{- 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] | 103 | - name: SQL_PASSWORD |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 104 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 105 | volumeMounts: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 106 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 107 | - mountPath: /etc/localtime |
| 108 | name: localtime |
| 109 | readOnly: true |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 110 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 111 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 112 | name: drools-secret |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 113 | subPath: {{ base $path }} |
| 114 | {{- end }} |
| 115 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 116 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
Jorge Hernandez | 328eadb | 2018-05-15 07:52:21 -0500 | [diff] [blame] | 117 | name: drools-config |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 118 | subPath: {{ base $path }} |
| 119 | {{- end }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 120 | resources: {{ include "common.resources" . | nindent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 121 | {{- if .Values.nodeSelector }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 122 | nodeSelector: |
| 123 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 124 | {{- end -}} |
| 125 | {{- if .Values.affinity }} |
| 126 | affinity: |
| 127 | {{ toYaml .Values.affinity | indent 10 }} |
| 128 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 129 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 130 | volumes: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 131 | {{ include "common.certInitializer.volumes" . | indent 8 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 132 | - name: localtime |
| 133 | hostPath: |
| 134 | path: /etc/localtime |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 135 | - name: drools-config |
| 136 | configMap: |
| 137 | name: {{ include "common.fullname" . }}-configmap |
| 138 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 139 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 140 | - key: {{ base $path }} |
| 141 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 142 | mode: 0755 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 143 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 144 | - name: drools-secret |
| 145 | secret: |
| 146 | secretName: {{ include "common.fullname" . }}-secret |
| 147 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 148 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 149 | - key: {{ base $path }} |
| 150 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 151 | mode: 0644 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 152 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 153 | imagePullSecrets: |
| 154 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |