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 |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 4 | # Modifications Copyright © 2024 Deutsche Telekom |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 17 | */}} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 18 | |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 19 | apiVersion: apps/v1 |
mayankg2703 | c798546 | 2018-03-29 14:24:23 +0000 | [diff] [blame] | 20 | kind: StatefulSet |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 21 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 22 | spec: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 23 | selector: {{- include "common.selectors" . | nindent 4 }} |
Mahendra Raghuwanshi | c1395ec | 2018-04-26 03:19:03 +0000 | [diff] [blame] | 24 | serviceName: {{ include "common.servicename" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 25 | replicas: {{ .Values.replicaCount }} |
| 26 | template: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 27 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 28 | spec: |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 29 | {{ include "common.podSecurityContext" . | indent 6 | trim }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 30 | initContainers: |
| 31 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 32 | - /app/ready.py |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 33 | args: |
| 34 | - --job-name |
| 35 | - {{ include "common.release" . }}-policy-galera-config |
| 36 | env: |
| 37 | - name: NAMESPACE |
| 38 | valueFrom: |
| 39 | fieldRef: |
| 40 | apiVersion: v1 |
| 41 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 42 | image: {{ include "repositoryGenerator.image.readiness" . }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 43 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 44 | {{ include "common.containerSecurityContext" . | indent 8 | trim }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 45 | name: {{ include "common.name" . }}-db-readiness |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 46 | resources: |
| 47 | limits: |
| 48 | cpu: "100m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 49 | memory: "500Mi" |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 50 | requests: |
| 51 | cpu: "3m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 52 | memory: "20Mi" |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 53 | {{- if not .Values.nexus.offline }} |
| 54 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 55 | - /app/ready.py |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 56 | args: |
Andreas Geissler | ee11910 | 2024-04-11 13:53:39 +0200 | [diff] [blame] | 57 | - --service-name |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 58 | - {{ .Values.nexus.name }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 59 | env: |
| 60 | - name: NAMESPACE |
| 61 | valueFrom: |
| 62 | fieldRef: |
| 63 | apiVersion: v1 |
| 64 | fieldPath: metadata.namespace |
rameshiyer27 | bc8a6a4 | 2024-03-11 17:18:11 +0000 | [diff] [blame] | 65 | - name: KAFKA_URL |
| 66 | value: {{ include "common.release" . }}-{{ .Values.global.kafkaBootstrap }} |
| 67 | - name: SASL |
| 68 | value: {{ .Values.kafkaUser.authenticationType | upper }} |
| 69 | - name: GROUP_ID |
| 70 | value: {{ .Values.config.kafka.consumer.groupId }} |
| 71 | - name: PAP_TOPIC |
| 72 | value: {{ .Values.config.app.listener.policyPdpPapTopic }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 73 | image: {{ include "repositoryGenerator.image.readiness" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 74 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 75 | {{ include "common.containerSecurityContext" . | indent 8 | trim }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 76 | name: {{ include "common.name" . }}-readiness |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 77 | resources: |
| 78 | limits: |
| 79 | cpu: "100m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 80 | memory: "500Mi" |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 81 | requests: |
| 82 | cpu: "3m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 83 | memory: "20Mi" |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 84 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 85 | containers: |
| 86 | - name: {{ include "common.name" . }} |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 87 | {{ include "common.containerSecurityContext" . | indent 10 | trim }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 88 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 89 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Taka Cho | 9658ce8 | 2020-12-10 14:34:18 -0500 | [diff] [blame] | 90 | command: ["sh","-c"] |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 91 | args: ["/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot"] |
| 92 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 93 | {{- if eq .Values.liveness.enabled true }} |
| 94 | livenessProbe: |
jhh | 0d1c0e8 | 2022-04-08 14:36:15 -0500 | [diff] [blame] | 95 | httpGet: |
| 96 | path: /healthcheck/controllers |
| 97 | port: 6968 |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 98 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 99 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
jhh | 0d1c0e8 | 2022-04-08 14:36:15 -0500 | [diff] [blame] | 100 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 101 | {{- end }} |
| 102 | readinessProbe: |
| 103 | tcpSocket: |
Andreas Geissler | f10c555 | 2023-03-21 18:09:46 +0100 | [diff] [blame] | 104 | port: {{ .Values.service.internalPort }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 105 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 106 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 107 | env: |
| 108 | - name: REPLICAS |
| 109 | value: "{{ .Values.replicaCount }}" |
Krzysztof Opasiak | 68b1c92 | 2020-03-26 23:59:36 +0100 | [diff] [blame] | 110 | - name: SQL_USER |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 111 | {{- 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] | 112 | - name: SQL_PASSWORD |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 113 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 114 | volumeMounts: |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 115 | - name: logs |
| 116 | mountPath: /var/log/onap |
| 117 | - name: empty-dir |
| 118 | mountPath: /tmp |
| 119 | subPath: tmp-dir |
| 120 | - mountPath: /opt/app/policy/etc/profile.d/base.conf |
| 121 | subPath: base.conf |
| 122 | name: drools-config |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 123 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 124 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 125 | name: drools-secret |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 126 | subPath: {{ base $path }} |
| 127 | {{- end }} |
| 128 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 129 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
Jorge Hernandez | 328eadb | 2018-05-15 07:52:21 -0500 | [diff] [blame] | 130 | name: drools-config |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 131 | subPath: {{ base $path }} |
| 132 | {{- end }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 133 | resources: {{ include "common.resources" . | nindent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 134 | {{- if .Values.nodeSelector }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 135 | nodeSelector: |
| 136 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 137 | {{- end -}} |
| 138 | {{- if .Values.affinity }} |
| 139 | affinity: |
| 140 | {{ toYaml .Values.affinity | indent 10 }} |
| 141 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 142 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 143 | volumes: |
Andreas Geissler | 5768113 | 2024-07-29 10:18:26 +0200 | [diff] [blame^] | 144 | - name: empty-dir |
| 145 | emptyDir: |
| 146 | sizeLimit: {{ .Values.dirSizes.emptyDir.sizeLimit }} |
| 147 | - name: logs |
| 148 | emptyDir: |
| 149 | sizeLimit: {{ .Values.dirSizes.logDir.sizeLimit }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 150 | - name: drools-config |
| 151 | configMap: |
| 152 | name: {{ include "common.fullname" . }}-configmap |
| 153 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 154 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 155 | - key: {{ base $path }} |
| 156 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 157 | mode: 0755 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 158 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 159 | - name: drools-secret |
| 160 | secret: |
| 161 | secretName: {{ include "common.fullname" . }}-secret |
| 162 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 163 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 164 | - key: {{ base $path }} |
| 165 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 166 | mode: 0644 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 167 | {{- end }} |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame] | 168 | {{- include "common.imagePullSecrets" . | nindent 6 }} |