blob: dd813b410792aa170906d0ea34d169fe6b0a5b94 [file] [log] [blame]
mayankg2703ced85142018-03-20 05:42:53 +00001# Copyright © 2017 Amdocs, Bell Canada
Jorge Hernandezaa5ba982019-03-25 19:13:39 -05002# Modifications Copyright © 2018-2019 AT&T
mayankg2703ced85142018-03-20 05:42:53 +00003#
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-Lis4fad3022020-07-31 10:18:21 +020016apiVersion: apps/v1
mayankg2703c7985462018-03-29 14:24:23 +000017kind: StatefulSet
mayankg2703ced85142018-03-20 05:42:53 +000018metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
mayankg2703ced85142018-03-20 05:42:53 +000025 heritage: {{ .Release.Service }}
26spec:
Mahendra Raghuwanshic1395ec2018-04-26 03:19:03 +000027 serviceName: {{ include "common.servicename" . }}
mayankg2703ced85142018-03-20 05:42:53 +000028 replicas: {{ .Values.replicaCount }}
mayankg2703c7985462018-03-29 14:24:23 +000029 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
mayankg2703ced85142018-03-20 05:42:53 +000032 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
mayankg2703ced85142018-03-20 05:42:53 +000037 spec:
38 initContainers:
39 - command:
40 - /root/ready.py
41 args:
42 - --container-name
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010043 - {{ include "common.release" . }}-galera-config
mayankg2703ced85142018-03-20 05:42:53 +000044 - --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
mayankg2703ced85142018-03-20 05:42:53 +000055 containers:
56 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000057 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mayankg2703ced85142018-03-20 05:42:53 +000058 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
59 ports:
60 - containerPort: {{ .Values.service.externalPort }}
61 - containerPort: {{ .Values.service.externalPort2 }}
mayankg2703ced85142018-03-20 05:42:53 +000062 {{- 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 }}"
Krzysztof Opasiak68b1c922020-03-26 23:59:36 +010077 - name: SQL_USER
78 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
79 - name: SQL_PASSWORD
80 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000081 volumeMounts:
82 - mountPath: /etc/localtime
83 name: localtime
84 readOnly: true
jhh01096592019-09-04 07:47:25 -050085 {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
86 - mountPath: /tmp/policy-install/config/{{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +000087 name: drools-secret
jhh01096592019-09-04 07:47:25 -050088 subPath: {{ base $path }}
89 {{- end }}
90 {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
91 - mountPath: /tmp/policy-install/config/{{ base $path }}
Jorge Hernandez328eadb2018-05-15 07:52:21 -050092 name: drools-config
jhh01096592019-09-04 07:47:25 -050093 subPath: {{ base $path }}
94 {{- end }}
mayankg2703ced85142018-03-20 05:42:53 +000095 - mountPath: /var/log/onap
96 name: policy-logs
mayankg2703ced85142018-03-20 05:42:53 +000097 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000098{{ include "common.resources" . | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000099 {{- if .Values.nodeSelector }}
100 - image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.loggingImage }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +0000101 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
mayankg2703ced85142018-03-20 05:42:53 +0000102 name: filebeat-onap
103 volumeMounts:
104 - mountPath: /usr/share/filebeat/filebeat.yml
105 name: filebeat-conf
106 subPath: filebeat.yml
107 - mountPath: /var/log/onap
108 name: policy-logs
109 - mountPath: /usr/share/filebeat/data
110 name: policy-data-filebeat
111 nodeSelector:
112{{ toYaml .Values.nodeSelector | indent 10 }}
113 {{- end -}}
114 {{- if .Values.affinity }}
115 affinity:
116{{ toYaml .Values.affinity | indent 10 }}
117 {{- end }}
118 volumes:
119 - name: localtime
120 hostPath:
121 path: /etc/localtime
122 - name: filebeat-conf
123 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100124 name: {{ include "common.release" . }}-filebeat-configmap
mayankg2703ced85142018-03-20 05:42:53 +0000125 - name: policy-logs
126 emptyDir: {}
127 - name: policy-data-filebeat
128 emptyDir: {}
mayankg2703ced85142018-03-20 05:42:53 +0000129 - name: drools-config
130 configMap:
131 name: {{ include "common.fullname" . }}-configmap
132 items:
jhh01096592019-09-04 07:47:25 -0500133 {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
134 - key: {{ base $path }}
135 path: {{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +0000136 mode: 0755
jhh01096592019-09-04 07:47:25 -0500137 {{- end }}
mayankg2703ced85142018-03-20 05:42:53 +0000138 - name: drools-secret
139 secret:
140 secretName: {{ include "common.fullname" . }}-secret
141 items:
jhh01096592019-09-04 07:47:25 -0500142 {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
143 - key: {{ base $path }}
144 path: {{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +0000145 mode: 0644
jhh01096592019-09-04 07:47:25 -0500146 {{- end }}
mayankg2703ced85142018-03-20 05:42:53 +0000147 imagePullSecrets:
148 - name: "{{ include "common.namespace" . }}-docker-registry-key"