mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 2 | # Modifications Copyright © 2018-2020 AT&T Intellectual Property |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 16 | apiVersion: apps/v1 |
mayankg2703 | c798546 | 2018-03-29 14:24:23 +0000 | [diff] [blame] | 17 | kind: StatefulSet |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 18 | metadata: |
| 19 | name: {{ include "common.fullname" . }} |
| 20 | namespace: {{ include "common.namespace" . }} |
| 21 | labels: |
| 22 | app: {{ include "common.name" . }} |
| 23 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 24 | release: {{ include "common.release" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
Mahendra Raghuwanshi | c1395ec | 2018-04-26 03:19:03 +0000 | [diff] [blame] | 27 | serviceName: {{ include "common.servicename" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 28 | replicas: {{ .Values.replicaCount }} |
mayankg2703 | c798546 | 2018-03-29 14:24:23 +0000 | [diff] [blame] | 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 36 | release: {{ include "common.release" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 37 | spec: |
| 38 | initContainers: |
| 39 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 40 | - /app/ready.py |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 41 | args: |
| 42 | - --job-name |
| 43 | - {{ include "common.release" . }}-policy-galera-config |
| 44 | env: |
| 45 | - name: NAMESPACE |
| 46 | valueFrom: |
| 47 | fieldRef: |
| 48 | apiVersion: v1 |
| 49 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 50 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 52 | name: {{ include "common.name" . }}-db-readiness |
| 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: |
| 57 | - --container-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 |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 65 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | name: {{ include "common.name" . }}-readiness |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 68 | {{- end }} |
| 69 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 70 | containers: |
| 71 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 72 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 73 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 74 | command: ["bash","-c"] |
| 75 | args: ["if [ -f {{ .Values.certInitializer.credsPath }}/.ci ]; then \ |
| 76 | source {{ .Values.certInitializer.credsPath }}/.ci; fi;\ |
jhh | bf8d8a9 | 2020-09-10 14:01:49 -0500 | [diff] [blame] | 77 | 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] | 78 | /opt/app/policy/bin/pdpd-cl-entrypoint.sh boot"] |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 79 | ports: |
| 80 | - containerPort: {{ .Values.service.externalPort }} |
| 81 | - containerPort: {{ .Values.service.externalPort2 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 82 | {{- if eq .Values.liveness.enabled true }} |
| 83 | livenessProbe: |
| 84 | tcpSocket: |
| 85 | port: {{ .Values.service.externalPort }} |
| 86 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 87 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 88 | {{- end }} |
| 89 | readinessProbe: |
| 90 | tcpSocket: |
| 91 | port: {{ .Values.service.externalPort }} |
| 92 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 93 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 94 | env: |
| 95 | - name: REPLICAS |
| 96 | value: "{{ .Values.replicaCount }}" |
Krzysztof Opasiak | 68b1c92 | 2020-03-26 23:59:36 +0100 | [diff] [blame] | 97 | - name: SQL_USER |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 98 | {{- 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] | 99 | - name: SQL_PASSWORD |
Krzysztof Opasiak | 4372e83 | 2020-09-01 19:17:20 +0200 | [diff] [blame] | 100 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 101 | volumeMounts: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 102 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 103 | - mountPath: /etc/localtime |
| 104 | name: localtime |
| 105 | readOnly: true |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 106 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 107 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 108 | name: drools-secret |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 109 | subPath: {{ base $path }} |
| 110 | {{- end }} |
| 111 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 112 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
Jorge Hernandez | 328eadb | 2018-05-15 07:52:21 -0500 | [diff] [blame] | 113 | name: drools-config |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 114 | subPath: {{ base $path }} |
| 115 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 116 | resources: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 117 | {{ include "common.resources" . }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 118 | {{- if .Values.nodeSelector }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 119 | nodeSelector: |
| 120 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 121 | {{- end -}} |
| 122 | {{- if .Values.affinity }} |
| 123 | affinity: |
| 124 | {{ toYaml .Values.affinity | indent 10 }} |
| 125 | {{- end }} |
| 126 | volumes: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 127 | {{ include "common.certInitializer.volumes" . | indent 8 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 128 | - name: localtime |
| 129 | hostPath: |
| 130 | path: /etc/localtime |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 131 | - name: drools-config |
| 132 | configMap: |
| 133 | name: {{ include "common.fullname" . }}-configmap |
| 134 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 135 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 136 | - key: {{ base $path }} |
| 137 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 138 | mode: 0755 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 139 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 140 | - name: drools-secret |
| 141 | secret: |
| 142 | secretName: {{ include "common.fullname" . }}-secret |
| 143 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 144 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 145 | - key: {{ base $path }} |
| 146 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 147 | mode: 0644 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 148 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 149 | imagePullSecrets: |
| 150 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |