Add option to disable specific deployments
[oom.git] / kubernetes / sdc / templates / sdc-fe.yaml
1 #{{ if not .Values.disableSdcSdcFe }}
2 apiVersion: extensions/v1beta1
3 kind: Deployment
4 metadata:
5   labels:
6     app: sdc-fe
7   name: sdc-fe
8   namespace: "{{ .Values.nsPrefix }}-sdc"
9 spec:
10   selector:
11     matchLabels:
12       app: sdc-fe
13   template:
14     metadata:
15       labels:
16         app: sdc-fe
17       name: sdc-fe
18       annotations:
19         pod.beta.kubernetes.io/init-containers: '[
20           {
21               "args": [
22                   "--container-name",
23                   "sdc-es",
24                   "--container-name",
25                   "sdc-cs",
26                   "--container-name",
27                   "sdc-kb",
28                   "--container-name",
29                   "sdc-be"
30               ],
31               "command": [
32                   "/root/ready.py"
33               ],
34               "env": [
35                   {
36                       "name": "NAMESPACE",
37                       "valueFrom": {
38                           "fieldRef": {
39                               "apiVersion": "v1",
40                               "fieldPath": "metadata.namespace"
41                           }
42                       }
43                   }
44               ],
45               "image": "{{ .Values.image.readiness }}",
46               "imagePullPolicy": "{{ .Values.pullPolicy }}",
47               "name": "sdc-fe-readiness"
48           }
49           ]'
50     spec:
51       containers:
52       - name: sdc-fe
53         env:
54         - name: ENVNAME
55           value: AUTO
56         - name: HOST_IP
57           valueFrom:
58             fieldRef:
59               fieldPath: status.podIP
60         image: {{ .Values.image.sdcFrontend }}
61         imagePullPolicy: {{ .Values.pullPolicy }}
62         volumeMounts:
63         - mountPath: /usr/share/elasticsearch/data/
64           name: sdc-sdc-es-es
65         - mountPath: /root/chef-solo/environments/
66           name: sdc-environments
67         - mountPath: /etc/localtime
68           name: sdc-localtime
69           readOnly: true
70         - mountPath: /var/lib/jetty/logs
71           name: sdc-logs
72         - mountPath: /root/chef-solo/cookbooks/sdc-catalog-fe/recipes/FE_2_setup_configuration.rb
73           name: sdc-fe-config
74         - mountPath: /tmp/logback.xml
75           name: sdc-logback
76         lifecycle:
77           postStart:
78             exec:
79               command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/catalog-fe/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
80         ports:
81         - containerPort: 9443
82         - containerPort: 8181
83         readinessProbe:
84           tcpSocket:
85             port: 8181
86           initialDelaySeconds: 5
87           periodSeconds: 10
88       - image: {{ .Values.image.filebeat }}
89         imagePullPolicy: {{ .Values.pullPolicy }}
90         name: filebeat-onap
91         volumeMounts:
92         - mountPath: /usr/share/filebeat/filebeat.yml
93           name: filebeat-conf
94         - mountPath: /var/log/onap
95           name: sdc-logs-2
96         - mountPath: /usr/share/filebeat/data
97           name: sdc-data-filebeat
98       volumes:
99         - name: filebeat-conf
100           hostPath:
101             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
102         - name: sdc-logs-2
103           emptyDir: {}
104         - name: sdc-data-filebeat
105           emptyDir: {}
106         - name: sdc-logback
107           hostPath:
108             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/sdc/fe/logback.xml
109         - name: sdc-sdc-es-es
110           hostPath:
111             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-es/ES
112         - name: sdc-environments
113           hostPath:
114             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/environments
115         - name: sdc-localtime
116           hostPath:
117             path:  /etc/localtime
118         - name:  sdc-logs
119           hostPath:
120             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
121         - name:  sdc-fe-config
122           hostPath:
123             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-fe/FE_2_setup_configuration.rb
124       imagePullSecrets:
125       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
126 #{{ end }}