Add standardized helm chart for appc
[oom.git] / kubernetes / appc / templates / statefulset.yaml
1 apiVersion: apps/v1beta1
2 kind: StatefulSet
3 metadata:
4   name: {{ include "common.fullname" . }}
5   namespace: {{ include "common.namespace" . }}
6   labels:
7     app: {{ include "common.name" . }}
8     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9     release: {{ .Release.Name }}
10     heritage: {{ .Release.Service }}
11 spec:
12   serviceName: "{{ .Values.service.name }}-cluster"
13   replicas: {{ .Values.replicaCount }}
14   podManagementPolicy: Parallel
15   template:
16     metadata:
17       labels:
18         app: {{ include "common.name" . }}
19         release: {{ .Release.Name }}
20     spec:
21       initContainers:
22       - command:
23         - /root/ready.py
24         args:
25         - --container-name
26         - {{ .Values.mysql.nameOverride }}
27         env:
28         - name: NAMESPACE
29           valueFrom:
30             fieldRef:
31               apiVersion: v1
32               fieldPath: metadata.namespace
33         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
34         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
35         name: {{ include "common.name" . }}-readiness
36       containers:
37         - name: {{ include "common.name" . }}
38           image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
39           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40           command:
41           - /opt/appc/bin/startODL.sh
42           ports:
43           - containerPort: {{ .Values.service.internalPort }}
44           - containerPort: {{ .Values.service.externalPort2 }}
45           readinessProbe:
46             tcpSocket:
47               port: {{ .Values.service.internalPort }}
48             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
49             periodSeconds: {{ .Values.readiness.periodSeconds }}
50           env:
51             - name: MYSQL_ROOT_PASSWORD
52               valueFrom:
53                 secretKeyRef:
54                   name: {{ template "common.fullname" . }}
55                   key: db-root-password
56             - name: SDNC_CONFIG_DIR
57               value: "{{ .Values.config.configDir }}"
58             - name: APPC_CONFIG_DIR
59               value: "{{ .Values.config.configDir }}"
60             - name: DMAAP_TOPIC_ENV
61               value: "{{ .Values.config.dmaapTopic }}"
62             - name: ENABLE_ODL_CLUSTER
63               value: "{{ .Values.config.enableClustering }}"
64             - name: APPC_REPLICAS
65               value: "{{ .Values.replicaCount }}"
66           volumeMounts:
67           - mountPath: /etc/localtime
68             name: localtime
69             readOnly: true
70           - mountPath: /opt/onap/appc/data/properties/dblib.properties
71             name: onap-appc-data-properties
72             subPath: dblib.properties
73           - mountPath: /opt/onap/appc/data/properties/svclogic.properties
74             name: onap-appc-data-properties
75             subPath: svclogic.properties
76           - mountPath: /opt/onap/appc/data/properties/appc.properties
77             name: onap-appc-data-properties
78             subPath: appc.properties
79           - mountPath: /opt/onap/appc/data/properties/aaiclient.properties
80             name: onap-appc-data-properties
81             subPath: aaiclient.properties
82           - mountPath: /opt/onap/appc/svclogic/config/svclogic.properties
83             name: onap-appc-svclogic-config
84             subPath: svclogic.properties
85           - mountPath: /opt/onap/appc/svclogic/bin/showActiveGraphs.sh
86             name: onap-appc-svclogic-bin
87             subPath: showActiveGraphs.sh
88           - mountPath: /opt/onap/appc/bin/startODL.sh
89             name: onap-appc-bin
90             subPath: startODL.sh
91           - mountPath: /opt/onap/appc/bin/installAppcDb.sh
92             name: onap-appc-bin
93             subPath: installAppcDb.sh
94           - mountPath: /opt/onap/sdnc/data/properties/dblib.properties
95             name: onap-sdnc-data-properties
96             subPath: dblib.properties
97           - mountPath: /opt/onap/sdnc/data/properties/svclogic.properties
98             name: onap-sdnc-data-properties
99             subPath: svclogic.properties
100           - mountPath: /opt/onap/sdnc/data/properties/aaiclient.properties
101             name: onap-sdnc-data-properties
102             subPath: aaiclient.properties
103           - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
104             name: onap-sdnc-svclogic-config
105             subPath: svclogic.properties
106           - mountPath: /opt/onap/sdnc/svclogic/bin/showActiveGraphs.sh
107             name: onap-sdnc-svclogic-bin
108             subPath: showActiveGraphs.sh
109           - mountPath: /opt/onap/sdnc/bin/startODL.sh
110             name: onap-sdnc-bin
111             subPath: startODL.sh
112           - mountPath: /opt/onap/sdnc/bin/installSdncDb.sh
113             name: onap-sdnc-bin
114             subPath: installSdncDb.sh
115           - mountPath: /var/log/onap
116             name: logs
117           - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
118             name: log-config
119             subPath: org.ops4j.pax.logging.cfg
120           resources:
121 {{ toYaml .Values.resources | indent 12 }}
122         {{- if .Values.nodeSelector }}
123         nodeSelector:
124 {{ toYaml .Values.nodeSelector | indent 10 }}
125         {{- end -}}
126         {{- if .Values.affinity }}
127         affinity:
128 {{ toYaml .Values.affinity | indent 10 }}
129         {{- end }}
130
131         # side car containers
132         - name: filebeat-onap
133           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
134           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
135           volumeMounts:
136           - mountPath: /usr/share/filebeat/filebeat.yml
137             name: filebeat-conf
138             subPath: filebeat.yml
139           - mountPath: /var/log/onap
140             name: logs
141           - mountPath: /usr/share/filebeat/data
142             name: data-filebeat
143       volumes:
144         - name: localtime
145           hostPath:
146             path: /etc/localtime
147         - name: filebeat-conf
148           configMap:
149             name: {{ include "common.fullname" . }}-filebeat
150         - name: log-config
151           configMap:
152             name: {{ include "common.fullname" . }}-logging-cfg
153         - name: logs
154           emptyDir: {}
155         - name: data-filebeat
156           emptyDir: {}
157         - name: onap-appc-data-properties
158           configMap:
159             name: {{ include "common.fullname" . }}-onap-appc-data-properties
160         - name: onap-appc-svclogic-config
161           configMap:
162             name: {{ include "common.fullname" . }}-onap-appc-svclogic-config
163         - name: onap-appc-svclogic-bin
164           configMap:
165             name: {{ include "common.fullname" . }}-onap-appc-svclogic-bin
166             defaultMode: 0755
167         - name: onap-appc-bin
168           configMap:
169             name: {{ include "common.fullname" . }}-onap-appc-bin
170             defaultMode: 0755
171         - name: onap-sdnc-data-properties
172           configMap:
173             name: {{ include "common.fullname" . }}-onap-sdnc-data-properties
174         - name: onap-sdnc-svclogic-config
175           configMap:
176             name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-config
177         - name: onap-sdnc-svclogic-bin
178           configMap:
179             name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-bin
180             defaultMode: 0755
181         - name: onap-sdnc-bin
182           configMap:
183             name: {{ include "common.fullname" . }}-onap-sdnc-bin
184             defaultMode: 0755
185       imagePullSecrets:
186       - name: "{{ include "common.namespace" . }}-docker-registry-key"