blob: 68ccb5a74604f467ab36c066a853c179fa46fcf6 [file] [log] [blame]
yurynfcef9942017-10-26 17:10:50 +03001#{{ if not .Values.disablePolicyPap }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -04002apiVersion: extensions/v1beta1
3kind: Deployment
4metadata:
5 name: pap
Mandeep Khinda0e8f8892017-08-25 03:31:17 +00006 namespace: "{{ .Values.nsPrefix }}-policy"
Mandeep Khindad6ea9872017-06-24 11:49:37 -04007spec:
vaibhav_16decf785cf32018-02-15 10:15:44 +00008 replicas: {{ .Values.papReplicas }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -04009 selector:
10 matchLabels:
11 app: pap
12 template:
13 metadata:
14 labels:
15 app: pap
16 name: pap
Mandeep Khindad6ea9872017-06-24 11:49:37 -040017 spec:
vasundhra86243b72017-11-22 11:56:23 +000018 initContainers:
19 - command:
20 - /root/ready.py
21 args:
22 - --container-name
vasundhra86243b72017-11-22 11:56:23 +000023 - mariadb
24 env:
25 - name: NAMESPACE
26 valueFrom:
27 fieldRef:
28 apiVersion: v1
29 fieldPath: metadata.namespace
30 image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}"
31 imagePullPolicy: {{ .Values.pullPolicy }}
32 name: pap-readiness
33 - command: ["/bin/bash", "-c", "echo $POD_IP > /config/ip_addr.txt"]
34 env:
35 - name: POD_IP
36 valueFrom:
37 fieldRef:
38 apiVersion: v1
39 fieldPath: status.podIP
40 volumeMounts:
41 - mountPath: /config/
42 name: pe
43 image: {{ .Values.image.ubuntu }}
44 imagePullPolicy: {{ .Values.pullPolicy }}
45 name: generate-ip-addr-txt
Mandeep Khindad6ea9872017-06-24 11:49:37 -040046 containers:
47 - command:
48 - /bin/bash
49 - ./do-start.sh
50 - pap
Eric Aucdaafde2017-08-31 16:18:11 -040051 image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
kerenj3b697f62017-08-23 11:21:21 +000052 imagePullPolicy: {{ .Values.pullPolicy }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -040053 name: pap
Alexis de Talhouƫtdf4db0b2017-12-11 08:36:25 -050054 env:
55 - name: PRELOAD_POLICIES
56 value: "true"
Mandeep Khindad6ea9872017-06-24 11:49:37 -040057 ports:
58 - containerPort: 8443
59 - containerPort: 9091
60 readinessProbe:
61 tcpSocket:
62 port: 9091
63 initialDelaySeconds: 5
64 periodSeconds: 10
65 volumeMounts:
yuryn8b3bc5a2017-09-13 19:21:03 +030066 - mountPath: /etc/localtime
67 name: localtime
68 readOnly: true
Mandeep Khindad6ea9872017-06-24 11:49:37 -040069 - mountPath: /tmp/policy-install/config/
70 name: pe
yurynd0707be2017-09-27 14:54:18 +030071 - mountPath: /var/log/onap
72 name: policy-logs
73 - mountPath: /tmp/policy-install/logback.xml
74 name: policy-sdk-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +000075 subPath: logback.xml
yurynd0707be2017-09-27 14:54:18 +030076 - mountPath: /tmp/logback.xml
77 name: policy-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +000078 subPath: logback.xml
yurynd0707be2017-09-27 14:54:18 +030079 lifecycle:
80 postStart:
81 exec:
82 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/opt/app/policy/servers/pap/webapps/pap/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; export SRC=/tmp/policy-install/logback.xml; export DST=/opt/app/policy/servers/console/webapps/onap/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
83 - image: {{ .Values.image.filebeat }}
84 imagePullPolicy: {{ .Values.pullPolicy }}
85 name: filebeat-onap
86 volumeMounts:
87 - mountPath: /usr/share/filebeat/filebeat.yml
88 name: filebeat-conf
vaibhav_16dec8de39a72018-01-17 12:22:52 +000089 subPath: filebeat.yml
yurynd0707be2017-09-27 14:54:18 +030090 - mountPath: /var/log/onap
91 name: policy-logs
92 - mountPath: /usr/share/filebeat/data
93 name: policy-data-filebeat
Mandeep Khindad6ea9872017-06-24 11:49:37 -040094 volumes:
yuryn8b3bc5a2017-09-13 19:21:03 +030095 - name: localtime
96 hostPath:
97 path: /etc/localtime
yurynd0707be2017-09-27 14:54:18 +030098 - name: filebeat-conf
vaibhav_16dec8de39a72018-01-17 12:22:52 +000099 configMap:
100 name: policy-filebeat-configmap
yurynd0707be2017-09-27 14:54:18 +0300101 - name: policy-logs
102 emptyDir: {}
103 - name: policy-data-filebeat
104 emptyDir: {}
105 - name: policy-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000106 configMap:
107 name: policy-pap-log-configmap
yurynd0707be2017-09-27 14:54:18 +0300108 - name: policy-sdk-logback
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000109 configMap:
110 name: policy-sdk-log-configmap
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400111 - name: pe
vaibhav_16dec8de39a72018-01-17 12:22:52 +0000112 configMap:
113 name: policy-dep-pe-configmap
114 defaultMode: 0755
Borislav Glozman5197e2e2017-07-24 10:45:28 +0300115 imagePullSecrets:
Mandeep Khinda0e8f8892017-08-25 03:31:17 +0000116 - name: "{{ .Values.nsPrefix }}-docker-registry-key"
vasundhra86243b72017-11-22 11:56:23 +0000117#{{ end }}