blob: 68b415e9897c3bb41423001b233d94969d15d649 [file] [log] [blame]
mayankg2703ced85142018-03-20 05:42:53 +00001# Copyright © 2017 Amdocs, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
mayankg2703c7985462018-03-29 14:24:23 +000015apiVersion: apps/v1beta1
16kind: StatefulSet
mayankg2703ced85142018-03-20 05:42:53 +000017metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25spec:
Mahendra Raghuwanshic1395ec2018-04-26 03:19:03 +000026 serviceName: {{ include "common.servicename" . }}
mayankg2703ced85142018-03-20 05:42:53 +000027 replicas: {{ .Values.replicaCount }}
mayankg2703c7985462018-03-29 14:24:23 +000028 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
mayankg2703ced85142018-03-20 05:42:53 +000031 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
35 release: {{ .Release.Name }}
36 spec:
37 initContainers:
38 - command:
39 - /root/ready.py
40 args:
41 - --container-name
42 - {{ .Values.global.mariadb.nameOverride }}
43 - --container-name
44 - {{ .Values.global.nexus.nameOverride }}
45 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
51 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 name: {{ include "common.name" . }}-readiness
54 hostAliases:
mayankg2703c7985462018-03-29 14:24:23 +000055 - ip: "{{ .Values.config.aaiServiceClusterIp }}"
mayankg2703ced85142018-03-20 05:42:53 +000056 hostnames:
57 - "aai.api.simpledemo.openecomp.org"
58 containers:
59 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000060 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
mayankg2703ced85142018-03-20 05:42:53 +000061 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 ports:
63 - containerPort: {{ .Values.service.externalPort }}
64 - containerPort: {{ .Values.service.externalPort2 }}
65 command:
66 - /bin/bash
67 - -c
68 - ./do-start.sh
69 {{- if eq .Values.liveness.enabled true }}
70 livenessProbe:
71 tcpSocket:
72 port: {{ .Values.service.externalPort }}
73 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
74 periodSeconds: {{ .Values.liveness.periodSeconds }}
75 {{- end }}
76 readinessProbe:
77 tcpSocket:
78 port: {{ .Values.service.externalPort }}
79 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
80 periodSeconds: {{ .Values.readiness.periodSeconds }}
81 env:
82 - name: REPLICAS
83 value: "{{ .Values.replicaCount }}"
84 volumeMounts:
85 - mountPath: /etc/localtime
86 name: localtime
87 readOnly: true
mayankg2703ced85142018-03-20 05:42:53 +000088 - mountPath: /tmp/policy-install/config/feature-healthcheck.conf
89 name: drools-secret
90 subPath: feature-healthcheck.conf
Jorge Hernandez328eadb2018-05-15 07:52:21 -050091 - mountPath: /tmp/policy-install/config/feature-pooling-dmaap.conf
92 name: drools-config
93 subPath: feature-pooling-dmaap.conf
mayankg2703ced85142018-03-20 05:42:53 +000094 - mountPath: /tmp/policy-install/config/base.conf
95 name: drools-config
96 subPath: base.conf
97 - mountPath: /tmp/policy-install/config/policy-management.conf
98 name: drools-config
99 subPath: policy-management.conf
100 - mountPath: /tmp/policy-install/config/drools-tweaks.sh
101 name: drools-config
102 subPath: drools-tweaks.sh
Jorge Hernandez63ec8bc2018-04-10 19:35:13 -0500103 - mountPath: /tmp/policy-install/config/apps-install.sh
104 name: drools-config
105 subPath: apps-install.sh
Jorge Hernandezd38b89b2018-05-03 14:08:42 -0500106 - mountPath: /tmp/policy-install/config/drools-preinstall.sh
107 name: drools-config
108 subPath: drools-preinstall.sh
mayankg2703ced85142018-03-20 05:42:53 +0000109 - mountPath: /usr/share/maven/conf/settings.xml
110 name: drools-settingsxml
111 subPath: settings.xml
112 - mountPath: /var/log/onap
113 name: policy-logs
114 - mountPath: /tmp/logback.xml
115 name: policy-logback
116 subPath: logback.xml
mayankg2703ced85142018-03-20 05:42:53 +0000117 lifecycle:
118 postStart:
119 exec:
120 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"]
121 resources:
122{{ toYaml .Values.resources | indent 12 }}
123 {{- if .Values.nodeSelector }}
124 - image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.loggingImage }}"
125 imagePullPolicy: {{ .Values.pullPolicy }}
126 name: filebeat-onap
127 volumeMounts:
128 - mountPath: /usr/share/filebeat/filebeat.yml
129 name: filebeat-conf
130 subPath: filebeat.yml
131 - mountPath: /var/log/onap
132 name: policy-logs
133 - mountPath: /usr/share/filebeat/data
134 name: policy-data-filebeat
135 nodeSelector:
136{{ toYaml .Values.nodeSelector | indent 10 }}
137 {{- end -}}
138 {{- if .Values.affinity }}
139 affinity:
140{{ toYaml .Values.affinity | indent 10 }}
141 {{- end }}
142 volumes:
143 - name: localtime
144 hostPath:
145 path: /etc/localtime
146 - name: filebeat-conf
147 configMap:
148 name: {{ .Release.Name }}-filebeat-configmap
149 - name: policy-logs
150 emptyDir: {}
151 - name: policy-data-filebeat
152 emptyDir: {}
153 - name: policy-logback
154 configMap:
155 name: {{ include "common.fullname" . }}-log-configmap
156 - name: drools-settingsxml
157 configMap:
158 name: {{ include "common.fullname" . }}-settings-configmap
159 - name: drools-config
160 configMap:
161 name: {{ include "common.fullname" . }}-configmap
162 items:
163 - key: base.conf
164 path: base.conf
165 mode: 0755
Jorge Hernandez328eadb2018-05-15 07:52:21 -0500166 - key: feature-pooling-dmaap.conf
167 path: feature-pooling-dmaap.conf
168 mode: 0755
mayankg2703ced85142018-03-20 05:42:53 +0000169 - key: policy-management.conf
170 path: policy-management.conf
171 mode: 0755
172 - key: drools-tweaks.sh
173 path: drools-tweaks.sh
174 mode: 0755
Jorge Hernandezd38b89b2018-05-03 14:08:42 -0500175 - key: apps-install.sh
176 path: apps-install.sh
177 mode: 0755
178 - key: drools-preinstall.sh
179 path: drools-preinstall.sh
180 mode: 0755
mayankg2703ced85142018-03-20 05:42:53 +0000181 - name: drools-secret
182 secret:
183 secretName: {{ include "common.fullname" . }}-secret
184 items:
mayankg2703ced85142018-03-20 05:42:53 +0000185 - key: feature-healthcheck.conf
186 path: feature-healthcheck.conf
187 mode: 0644
mayankg2703ced85142018-03-20 05:42:53 +0000188 imagePullSecrets:
189 - name: "{{ include "common.namespace" . }}-docker-registry-key"