blob: beacbabd06dd15291e860207fd8467f0cabbc152 [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
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 }}
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 }}"
77 volumeMounts:
78 - mountPath: /etc/localtime
79 name: localtime
80 readOnly: true
mayankg2703ced85142018-03-20 05:42:53 +000081 - mountPath: /tmp/policy-install/config/feature-healthcheck.conf
82 name: drools-secret
83 subPath: feature-healthcheck.conf
Jorge Hernandez328eadb2018-05-15 07:52:21 -050084 - mountPath: /tmp/policy-install/config/feature-pooling-dmaap.conf
85 name: drools-config
86 subPath: feature-pooling-dmaap.conf
mayankg2703ced85142018-03-20 05:42:53 +000087 - mountPath: /tmp/policy-install/config/base.conf
88 name: drools-config
89 subPath: base.conf
mayankg2703ced85142018-03-20 05:42:53 +000090 - mountPath: /var/log/onap
91 name: policy-logs
mayankg2703ced85142018-03-20 05:42:53 +000092 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000093{{ include "common.resources" . | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000094 {{- if .Values.nodeSelector }}
95 - image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.loggingImage }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +000096 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
mayankg2703ced85142018-03-20 05:42:53 +000097 name: filebeat-onap
98 volumeMounts:
99 - mountPath: /usr/share/filebeat/filebeat.yml
100 name: filebeat-conf
101 subPath: filebeat.yml
102 - mountPath: /var/log/onap
103 name: policy-logs
104 - mountPath: /usr/share/filebeat/data
105 name: policy-data-filebeat
106 nodeSelector:
107{{ toYaml .Values.nodeSelector | indent 10 }}
108 {{- end -}}
109 {{- if .Values.affinity }}
110 affinity:
111{{ toYaml .Values.affinity | indent 10 }}
112 {{- end }}
113 volumes:
114 - name: localtime
115 hostPath:
116 path: /etc/localtime
117 - name: filebeat-conf
118 configMap:
119 name: {{ .Release.Name }}-filebeat-configmap
120 - name: policy-logs
121 emptyDir: {}
122 - name: policy-data-filebeat
123 emptyDir: {}
mayankg2703ced85142018-03-20 05:42:53 +0000124 - name: drools-config
125 configMap:
126 name: {{ include "common.fullname" . }}-configmap
127 items:
128 - key: base.conf
129 path: base.conf
130 mode: 0755
Jorge Hernandez328eadb2018-05-15 07:52:21 -0500131 - key: feature-pooling-dmaap.conf
132 path: feature-pooling-dmaap.conf
133 mode: 0755
mayankg2703ced85142018-03-20 05:42:53 +0000134 - name: drools-secret
135 secret:
136 secretName: {{ include "common.fullname" . }}-secret
137 items:
mayankg2703ced85142018-03-20 05:42:53 +0000138 - key: feature-healthcheck.conf
139 path: feature-healthcheck.conf
140 mode: 0644
mayankg2703ced85142018-03-20 05:42:53 +0000141 imagePullSecrets:
142 - name: "{{ include "common.namespace" . }}-docker-registry-key"