blob: 63175c4c4bdb34f8c9feb99c637f8d1cb04a8c92 [file] [log] [blame]
jmac065e2ce2018-03-29 01:18:02 +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
15apiVersion: apps/v1beta1
16kind: StatefulSet
17metadata:
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:
BorislavG1ffbd992018-04-24 07:56:27 +000026 serviceName: {{ include "common.servicename" . }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000027 replicas: {{ .Values.replicaCount }}
28 podManagementPolicy: Parallel
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
33 release: {{ .Release.Name }}
34 spec:
35 initContainers:
36 - command:
37 - /root/ready.py
38 args:
39 - --container-name
40 - {{ .Values.mysql.nameOverride }}
41 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.namespace
47 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49 name: {{ include "common.name" . }}-readiness
50 containers:
51 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000052 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +000053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 command: ["/bin/bash"]
55 args: ["-c", "/opt/sdnc/bin/startODL.sh"]
56 ports:
57 - containerPort: {{ .Values.service.internalPort }}
58 - containerPort: {{ .Values.service.internalPort2 }}
59 - containerPort: {{ .Values.service.internalPort3 }}
60 - containerPort: {{ .Values.service.clusterPort }}
61 readinessProbe:
62 tcpSocket:
63 port: {{ .Values.service.internalPort }}
64 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.readiness.periodSeconds }}
66 env:
67 - name: MYSQL_ROOT_PASSWORD
68 valueFrom:
69 secretKeyRef:
70 name: {{ template "common.fullname" . }}
71 key: db-root-password
jmaca68f4cb2018-05-10 22:44:19 +000072 - name: ODL_ADMIN_PASSWORD
73 valueFrom:
74 secretKeyRef:
75 name: {{ template "common.fullname" . }}-odl
76 key: odl-password
jmac065e2ce2018-03-29 01:18:02 +000077 - name: SDNC_CONFIG_DIR
78 value: "{{ .Values.config.configDir }}"
79 - name: ENABLE_ODL_CLUSTER
80 value: "{{ .Values.config.enableClustering }}"
81 - name: SDNC_REPLICAS
82 value: "{{ .Values.replicaCount }}"
83 - name: MYSQL_HOST
jmacc21cb7d2018-04-16 19:54:54 +000084 value: "{{.Values.mysql.service.name}}.{{.Release.Namespace}}"
jmac065e2ce2018-03-29 01:18:02 +000085 volumeMounts:
86 - mountPath: /etc/localtime
87 name: localtime
88 readOnly: true
89 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
90 name: sdnc-logging-cfg-config
91 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +000092 - mountPath: {{ .Values.config.binDir }}/startODL.sh
93 name: bin
jmac065e2ce2018-03-29 01:18:02 +000094 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +000095 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
96 name: bin
jmac065e2ce2018-03-29 01:18:02 +000097 subPath: installSdncDb.sh
jmaca68f4cb2018-05-10 22:44:19 +000098 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
99 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000100 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000101 - mountPath: {{ .Values.config.configDir }}/dblib.properties
102 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000103 subPath: dblib.properties
jmaca68f4cb2018-05-10 22:44:19 +0000104 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
105 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000106 subPath: svclogic.properties
107 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000108 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000109 subPath: svclogic.properties
jmac8d6dc962018-04-26 14:26:55 +0000110 - mountPath: {{ .Values.persistence.mdsalPath }}
111 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000112 - mountPath: /var/log/onap
113 name: logs
114 resources:
115{{ toYaml .Values.resources | indent 12 }}
116 {{- if .Values.nodeSelector }}
117 nodeSelector:
118{{ toYaml .Values.nodeSelector | indent 10 }}
119 {{- end -}}
120 {{- if .Values.affinity }}
121 affinity:
122{{ toYaml .Values.affinity | indent 10 }}
123 {{- end }}
124
125 # side car containers
126 - name: filebeat-onap
127 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
128 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
129 volumeMounts:
130 - mountPath: /usr/share/filebeat/filebeat.yml
131 name: filebeat-conf
132 subPath: filebeat.yml
133 - mountPath: /var/log/onap
134 name: logs
135 - mountPath: /usr/share/filebeat/data
136 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000137 imagePullSecrets:
138 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000139 volumes:
140 - name: localtime
141 hostPath:
142 path: /etc/localtime
143 - name: logs
144 emptyDir: {}
145 - name: data-filebeat
146 emptyDir: {}
147 - name: filebeat-conf
148 configMap:
149 name: {{ include "common.fullname" . }}-filebeat-configmap
150 - name: sdnc-logging-cfg-config
151 configMap:
152 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000153 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000154 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000155 name: {{ include "common.fullname" . }}-bin
156 defaultMode: 0755
157 - name: properties
jmac065e2ce2018-03-29 01:18:02 +0000158 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000159 name: {{ include "common.fullname" . }}-properties
160 defaultMode: 0644
jmac8d6dc962018-04-26 14:26:55 +0000161 {{ if not .Values.persistence.enabled }}
162 - name: {{ include "common.fullname" . }}-data
163 emptyDir: {}
164 {{ else }}
165 volumeClaimTemplates:
166 - metadata:
167 name: {{ include "common.fullname" . }}-data
168 labels:
169 name: {{ include "common.fullname" . }}
170 spec:
171 accessModes: [ {{ .Values.persistence.accessMode }} ]
172 storageClassName: {{ include "common.fullname" . }}-data
173 resources:
174 requests:
175 storage: {{ .Values.persistence.size }}
BorislavGdf11cd52018-05-06 12:55:20 +0000176 {{ end }}