yuryn | fcef994 | 2017-10-26 17:10:50 +0300 | [diff] [blame] | 1 | #{{ if not .Values.disablePolicyPap }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 2 | apiVersion: extensions/v1beta1 |
| 3 | kind: Deployment |
| 4 | metadata: |
| 5 | name: pap |
Mandeep Khinda | 0e8f889 | 2017-08-25 03:31:17 +0000 | [diff] [blame] | 6 | namespace: "{{ .Values.nsPrefix }}-policy" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 7 | spec: |
| 8 | selector: |
| 9 | matchLabels: |
| 10 | app: pap |
| 11 | template: |
| 12 | metadata: |
| 13 | labels: |
| 14 | app: pap |
| 15 | name: pap |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 16 | spec: |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 17 | initContainers: |
| 18 | - command: |
| 19 | - /root/ready.py |
| 20 | args: |
| 21 | - --container-name |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 22 | - mariadb |
| 23 | env: |
| 24 | - name: NAMESPACE |
| 25 | valueFrom: |
| 26 | fieldRef: |
| 27 | apiVersion: v1 |
| 28 | fieldPath: metadata.namespace |
| 29 | image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}" |
| 30 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 31 | name: pap-readiness |
| 32 | - command: ["/bin/bash", "-c", "echo $POD_IP > /config/ip_addr.txt"] |
| 33 | env: |
| 34 | - name: POD_IP |
| 35 | valueFrom: |
| 36 | fieldRef: |
| 37 | apiVersion: v1 |
| 38 | fieldPath: status.podIP |
| 39 | volumeMounts: |
| 40 | - mountPath: /config/ |
| 41 | name: pe |
| 42 | image: {{ .Values.image.ubuntu }} |
| 43 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 44 | name: generate-ip-addr-txt |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 45 | containers: |
| 46 | - command: |
| 47 | - /bin/bash |
| 48 | - ./do-start.sh |
| 49 | - pap |
Eric Au | cdaafde | 2017-08-31 16:18:11 -0400 | [diff] [blame] | 50 | image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}" |
kerenj | 3b697f6 | 2017-08-23 11:21:21 +0000 | [diff] [blame] | 51 | imagePullPolicy: {{ .Values.pullPolicy }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 52 | name: pap |
Alexis de Talhouƫt | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 53 | env: |
| 54 | - name: PRELOAD_POLICIES |
| 55 | value: "true" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 56 | ports: |
| 57 | - containerPort: 8443 |
| 58 | - containerPort: 9091 |
| 59 | readinessProbe: |
| 60 | tcpSocket: |
| 61 | port: 9091 |
| 62 | initialDelaySeconds: 5 |
| 63 | periodSeconds: 10 |
| 64 | volumeMounts: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 65 | - mountPath: /etc/localtime |
| 66 | name: localtime |
| 67 | readOnly: true |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 68 | - mountPath: /tmp/policy-install/config/ |
| 69 | name: pe |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 70 | - mountPath: /var/log/onap |
| 71 | name: policy-logs |
| 72 | - mountPath: /tmp/policy-install/logback.xml |
| 73 | name: policy-sdk-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 74 | subPath: logback.xml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 75 | - mountPath: /tmp/logback.xml |
| 76 | name: policy-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 77 | subPath: logback.xml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 78 | lifecycle: |
| 79 | postStart: |
| 80 | exec: |
| 81 | 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"] |
| 82 | - image: {{ .Values.image.filebeat }} |
| 83 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 84 | name: filebeat-onap |
| 85 | volumeMounts: |
| 86 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 87 | name: filebeat-conf |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 88 | subPath: filebeat.yml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 89 | - mountPath: /var/log/onap |
| 90 | name: policy-logs |
| 91 | - mountPath: /usr/share/filebeat/data |
| 92 | name: policy-data-filebeat |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 93 | volumes: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 94 | - name: localtime |
| 95 | hostPath: |
| 96 | path: /etc/localtime |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 97 | - name: filebeat-conf |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 98 | configMap: |
| 99 | name: policy-filebeat-configmap |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 100 | - name: policy-logs |
| 101 | emptyDir: {} |
| 102 | - name: policy-data-filebeat |
| 103 | emptyDir: {} |
| 104 | - name: policy-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 105 | configMap: |
| 106 | name: policy-pap-log-configmap |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 107 | - name: policy-sdk-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 108 | configMap: |
| 109 | name: policy-sdk-log-configmap |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 110 | - name: pe |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 111 | configMap: |
| 112 | name: policy-dep-pe-configmap |
| 113 | defaultMode: 0755 |
Borislav Glozman | 5197e2e | 2017-07-24 10:45:28 +0300 | [diff] [blame] | 114 | imagePullSecrets: |
Mandeep Khinda | 0e8f889 | 2017-08-25 03:31:17 +0000 | [diff] [blame] | 115 | - name: "{{ .Values.nsPrefix }}-docker-registry-key" |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 116 | #{{ end }} |