mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
Jorge Hernandez | aa5ba98 | 2019-03-25 19:13:39 -0500 | [diff] [blame] | 2 | # Modifications Copyright © 2018-2019 AT&T |
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 | |
mayankg2703 | c798546 | 2018-03-29 14:24:23 +0000 | [diff] [blame] | 16 | apiVersion: apps/v1beta1 |
| 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: |
| 40 | - /root/ready.py |
| 41 | args: |
| 42 | - --container-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 43 | - {{ include "common.release" . }}-galera-config |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 44 | - --container-name |
| 45 | - {{ .Values.global.nexus.nameOverride }} |
| 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
| 52 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | name: {{ include "common.name" . }}-readiness |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 55 | containers: |
| 56 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 57 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 58 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 59 | ports: |
| 60 | - containerPort: {{ .Values.service.externalPort }} |
| 61 | - containerPort: {{ .Values.service.externalPort2 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 62 | {{- if eq .Values.liveness.enabled true }} |
| 63 | livenessProbe: |
| 64 | tcpSocket: |
| 65 | port: {{ .Values.service.externalPort }} |
| 66 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 67 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 68 | {{- end }} |
| 69 | readinessProbe: |
| 70 | tcpSocket: |
| 71 | port: {{ .Values.service.externalPort }} |
| 72 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 73 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 74 | env: |
| 75 | - name: REPLICAS |
| 76 | value: "{{ .Values.replicaCount }}" |
| 77 | volumeMounts: |
| 78 | - mountPath: /etc/localtime |
| 79 | name: localtime |
| 80 | readOnly: true |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 81 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 82 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 83 | name: drools-secret |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 84 | subPath: {{ base $path }} |
| 85 | {{- end }} |
| 86 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 87 | - mountPath: /tmp/policy-install/config/{{ base $path }} |
Jorge Hernandez | 328eadb | 2018-05-15 07:52:21 -0500 | [diff] [blame] | 88 | name: drools-config |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 89 | subPath: {{ base $path }} |
| 90 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 91 | - mountPath: /var/log/onap |
| 92 | name: policy-logs |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 93 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 94 | {{ include "common.resources" . | indent 12 }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 95 | {{- if .Values.nodeSelector }} |
| 96 | - image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.loggingImage }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 97 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 98 | name: filebeat-onap |
| 99 | volumeMounts: |
| 100 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 101 | name: filebeat-conf |
| 102 | subPath: filebeat.yml |
| 103 | - mountPath: /var/log/onap |
| 104 | name: policy-logs |
| 105 | - mountPath: /usr/share/filebeat/data |
| 106 | name: policy-data-filebeat |
| 107 | nodeSelector: |
| 108 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 109 | {{- end -}} |
| 110 | {{- if .Values.affinity }} |
| 111 | affinity: |
| 112 | {{ toYaml .Values.affinity | indent 10 }} |
| 113 | {{- end }} |
| 114 | volumes: |
| 115 | - name: localtime |
| 116 | hostPath: |
| 117 | path: /etc/localtime |
| 118 | - name: filebeat-conf |
| 119 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame^] | 120 | name: {{ include "common.release" . }}-filebeat-configmap |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 121 | - name: policy-logs |
| 122 | emptyDir: {} |
| 123 | - name: policy-data-filebeat |
| 124 | emptyDir: {} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 125 | - name: drools-config |
| 126 | configMap: |
| 127 | name: {{ include "common.fullname" . }}-configmap |
| 128 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 129 | {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }} |
| 130 | - key: {{ base $path }} |
| 131 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 132 | mode: 0755 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 133 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 134 | - name: drools-secret |
| 135 | secret: |
| 136 | secretName: {{ include "common.fullname" . }}-secret |
| 137 | items: |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 138 | {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }} |
| 139 | - key: {{ base $path }} |
| 140 | path: {{ base $path }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 141 | mode: 0644 |
jhh | 0109659 | 2019-09-04 07:47:25 -0500 | [diff] [blame] | 142 | {{- end }} |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 143 | imagePullSecrets: |
| 144 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |