blob: 10f7a1d9f331999aecef5c815231434ea3849501 [file] [log] [blame]
mayankg2703ced85142018-03-20 05:42:53 +00001# Copyright © 2017 Amdocs, Bell Canada
Durgpal7ad40692018-08-03 07:28:36 +00002# Modifications Copyright © 2018 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
mayankg2703c7985462018-03-29 14:24:23 +000016apiVersion: apps/v1beta1
17kind: 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 "+" "_" }}
24 release: {{ .Release.Name }}
25 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" . }}
36 release: {{ .Release.Name }}
37 spec:
38 initContainers:
39 - command:
40 - /root/ready.py
41 args:
42 - --container-name
43 - {{ .Values.global.mariadb.nameOverride }}
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
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 }}
62 command:
63 - /bin/bash
64 - -c
65 - ./do-start.sh
66 {{- if eq .Values.liveness.enabled true }}
67 livenessProbe:
68 tcpSocket:
69 port: {{ .Values.service.externalPort }}
70 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
71 periodSeconds: {{ .Values.liveness.periodSeconds }}
72 {{- end }}
73 readinessProbe:
74 tcpSocket:
75 port: {{ .Values.service.externalPort }}
76 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
77 periodSeconds: {{ .Values.readiness.periodSeconds }}
78 env:
79 - name: REPLICAS
80 value: "{{ .Values.replicaCount }}"
81 volumeMounts:
82 - mountPath: /etc/localtime
83 name: localtime
84 readOnly: true
mayankg2703ced85142018-03-20 05:42:53 +000085 - mountPath: /tmp/policy-install/config/feature-healthcheck.conf
86 name: drools-secret
87 subPath: feature-healthcheck.conf
Jorge Hernandez328eadb2018-05-15 07:52:21 -050088 - mountPath: /tmp/policy-install/config/feature-pooling-dmaap.conf
89 name: drools-config
90 subPath: feature-pooling-dmaap.conf
mayankg2703ced85142018-03-20 05:42:53 +000091 - mountPath: /tmp/policy-install/config/base.conf
92 name: drools-config
93 subPath: base.conf
94 - mountPath: /tmp/policy-install/config/policy-management.conf
95 name: drools-config
96 subPath: policy-management.conf
97 - mountPath: /tmp/policy-install/config/drools-tweaks.sh
98 name: drools-config
99 subPath: drools-tweaks.sh
Jorge Hernandez63ec8bc2018-04-10 19:35:13 -0500100 - mountPath: /tmp/policy-install/config/apps-install.sh
101 name: drools-config
102 subPath: apps-install.sh
Jorge Hernandezd38b89b2018-05-03 14:08:42 -0500103 - mountPath: /tmp/policy-install/config/drools-preinstall.sh
104 name: drools-config
105 subPath: drools-preinstall.sh
mayankg2703ced85142018-03-20 05:42:53 +0000106 - mountPath: /usr/share/maven/conf/settings.xml
107 name: drools-settingsxml
108 subPath: settings.xml
109 - mountPath: /var/log/onap
110 name: policy-logs
111 - mountPath: /tmp/logback.xml
112 name: policy-logback
113 subPath: logback.xml
mayankg2703ced85142018-03-20 05:42:53 +0000114 lifecycle:
115 postStart:
116 exec:
117 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/opt/app/policy/config/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
118 resources:
119{{ toYaml .Values.resources | indent 12 }}
120 {{- if .Values.nodeSelector }}
121 - image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.loggingImage }}"
122 imagePullPolicy: {{ .Values.pullPolicy }}
123 name: filebeat-onap
124 volumeMounts:
125 - mountPath: /usr/share/filebeat/filebeat.yml
126 name: filebeat-conf
127 subPath: filebeat.yml
128 - mountPath: /var/log/onap
129 name: policy-logs
130 - mountPath: /usr/share/filebeat/data
131 name: policy-data-filebeat
132 nodeSelector:
133{{ toYaml .Values.nodeSelector | indent 10 }}
134 {{- end -}}
135 {{- if .Values.affinity }}
136 affinity:
137{{ toYaml .Values.affinity | indent 10 }}
138 {{- end }}
139 volumes:
140 - name: localtime
141 hostPath:
142 path: /etc/localtime
143 - name: filebeat-conf
144 configMap:
145 name: {{ .Release.Name }}-filebeat-configmap
146 - name: policy-logs
147 emptyDir: {}
148 - name: policy-data-filebeat
149 emptyDir: {}
150 - name: policy-logback
151 configMap:
152 name: {{ include "common.fullname" . }}-log-configmap
153 - name: drools-settingsxml
154 configMap:
155 name: {{ include "common.fullname" . }}-settings-configmap
156 - name: drools-config
157 configMap:
158 name: {{ include "common.fullname" . }}-configmap
159 items:
160 - key: base.conf
161 path: base.conf
162 mode: 0755
Jorge Hernandez328eadb2018-05-15 07:52:21 -0500163 - key: feature-pooling-dmaap.conf
164 path: feature-pooling-dmaap.conf
165 mode: 0755
mayankg2703ced85142018-03-20 05:42:53 +0000166 - key: policy-management.conf
167 path: policy-management.conf
168 mode: 0755
169 - key: drools-tweaks.sh
170 path: drools-tweaks.sh
171 mode: 0755
Jorge Hernandezd38b89b2018-05-03 14:08:42 -0500172 - key: apps-install.sh
173 path: apps-install.sh
174 mode: 0755
175 - key: drools-preinstall.sh
176 path: drools-preinstall.sh
177 mode: 0755
mayankg2703ced85142018-03-20 05:42:53 +0000178 - name: drools-secret
179 secret:
180 secretName: {{ include "common.fullname" . }}-secret
181 items:
mayankg2703ced85142018-03-20 05:42:53 +0000182 - key: feature-healthcheck.conf
183 path: feature-healthcheck.conf
184 mode: 0644
mayankg2703ced85142018-03-20 05:42:53 +0000185 imagePullSecrets:
186 - name: "{{ include "common.namespace" . }}-docker-registry-key"