Merge "Add champ subchart to oom aai"
[oom.git] / kubernetes / sdnc / templates / sdnc-statefulset.yaml
1 # 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
15 #{{ if not .Values.disableSdncSdnc }}
16 apiVersion: apps/v1beta1
17 kind: StatefulSet
18 metadata:
19   name: sdnc
20   namespace: "{{ .Values.nsPrefix }}"
21 spec:
22   serviceName: "sdnhost-cluster"
23   replicas: {{ .Values.numberOfODLReplicas }}
24   podManagementPolicy: Parallel
25   selector:
26     matchLabels:
27       app: sdnc
28   template:
29     metadata:
30       labels:
31         app: sdnc
32       name: sdnc
33     spec:
34       initContainers:
35       - command:
36         - /root/ready.py
37         args:
38         - --container-name
39         - sdnc-db-container
40         env:
41         - name: NAMESPACE
42           valueFrom:
43             fieldRef:
44               apiVersion: v1
45               fieldPath: metadata.namespace
46         image: {{ .Values.image.readiness }}
47         imagePullPolicy: {{ .Values.pullPolicy }}
48         name: sdnc-readiness
49       containers:
50       - command:
51         - bash
52         - "-c"
53         - |
54           sed -i 's/dbhost/sdnc-dbhost-0.dbhost.{{ .Values.nsPrefix }}.svc.cluster.local/g' /opt/onap/sdnc/data/properties/svclogic.properties
55           sed -i 's/^\(org.onap.ccsdk.sli.jdbc.hosts=\).*/\1sdnc-dbhost-0.dbhost.{{ .Values.nsPrefix }}.svc.cluster.local/' /opt/onap/sdnc/data/properties/dblib.properties
56           /opt/onap/sdnc/bin/startODL.sh
57         env:
58         - name: MYSQL_ROOT_PASSWORD
59           value: openECOMP1.0
60         - name: SDNC_CONFIG_DIR
61           value: /opt/onap/sdnc/data/properties
62         - name: ENABLE_ODL_CLUSTER
63           value: "{{ .Values.enableODLCluster }}"
64         - name: SDNC_REPLICAS
65           value: "{{ .Values.numberOfODLReplicas }}"
66         image: {{ .Values.image.sdnc }}
67         imagePullPolicy: {{ .Values.pullPolicy }}
68         name: sdnc-controller-container
69         volumeMounts:
70         - mountPath: /etc/localtime
71           name: localtime
72           readOnly: true
73         - mountPath: /opt/onap/sdnc/data/properties/admportal.json
74           name: sdnc-conf
75           subPath: admportal.json
76         - mountPath: /opt/onap/sdnc/data/properties/aaiclient.properties
77           name: sdnc-conf
78           subPath: aaiclient.properties
79         - mountPath: /var/log/onap
80           name: sdnc-logs
81         - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
82           name: sdnc-logging-cfg-config
83           subPath: org.ops4j.pax.logging.cfg
84         ports:
85         - containerPort: 8181
86         - containerPort: 8101
87         - containerPort: 2550
88         - containerPort: 8080
89         readinessProbe:
90           tcpSocket:
91             port: 8181
92           initialDelaySeconds: 5
93           periodSeconds: 10
94       - image: {{ .Values.image.filebeat }}
95         imagePullPolicy: {{ .Values.pullPolicy }}
96         name: filebeat-onap
97         volumeMounts:
98         - mountPath: /usr/share/filebeat/filebeat.yml
99           name: filebeat-conf
100           subPath: filebeat.yml
101         - mountPath: /var/log/onap
102           name: sdnc-logs
103         - mountPath: /usr/share/filebeat/data
104           name: sdnc-data-filebeat
105       volumes:
106         - name: localtime
107           hostPath:
108             path: /etc/localtime
109         - name: filebeat-conf
110           configMap:
111             name: sdnc-log-configmap
112         - name: sdnc-logging-cfg-config
113           configMap:
114             name: sdnc-logging-cfg-configmap
115         - name: sdnc-logs
116           emptyDir: {}
117         - name: sdnc-data-filebeat
118           emptyDir: {}
119         - name: sdnc-conf
120           configMap:
121             name: sdnc-conf-configmap
122             items:
123             - key: admportal.json
124               path: admportal.json
125               mode: 0755
126             - key: aaiclient.properties
127               path: aaiclient.properties
128               mode: 0755
129       imagePullSecrets:
130       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
131 #{{ end }}