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: |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 5 | name: policy-pap |
| 6 | namespace: "{{ .Values.nsPrefix }}" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 7 | spec: |
vaibhav_16dec | f785cf3 | 2018-02-15 10:15:44 +0000 | [diff] [blame] | 8 | replicas: {{ .Values.papReplicas }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 9 | selector: |
| 10 | matchLabels: |
| 11 | app: pap |
| 12 | template: |
| 13 | metadata: |
| 14 | labels: |
| 15 | app: pap |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 16 | name: policy-pap |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 17 | spec: |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 18 | initContainers: |
| 19 | - command: |
| 20 | - /root/ready.py |
| 21 | args: |
| 22 | - --container-name |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 23 | - 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 Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 46 | containers: |
| 47 | - command: |
| 48 | - /bin/bash |
| 49 | - ./do-start.sh |
| 50 | - pap |
Eric Au | cdaafde | 2017-08-31 16:18:11 -0400 | [diff] [blame] | 51 | image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}" |
kerenj | 3b697f6 | 2017-08-23 11:21:21 +0000 | [diff] [blame] | 52 | imagePullPolicy: {{ .Values.pullPolicy }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 53 | name: pap |
Alexis de Talhouƫt | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 54 | env: |
| 55 | - name: PRELOAD_POLICIES |
| 56 | value: "true" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 57 | ports: |
| 58 | - containerPort: 8443 |
| 59 | - containerPort: 9091 |
| 60 | readinessProbe: |
| 61 | tcpSocket: |
| 62 | port: 9091 |
| 63 | initialDelaySeconds: 5 |
| 64 | periodSeconds: 10 |
| 65 | volumeMounts: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 66 | - mountPath: /etc/localtime |
| 67 | name: localtime |
| 68 | readOnly: true |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 69 | - mountPath: /tmp/policy-install/config/ |
| 70 | name: pe |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 71 | - mountPath: /var/log/onap |
| 72 | name: policy-logs |
| 73 | - mountPath: /tmp/policy-install/logback.xml |
| 74 | name: policy-sdk-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 75 | subPath: logback.xml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 76 | - mountPath: /tmp/logback.xml |
| 77 | name: policy-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 78 | subPath: logback.xml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 79 | 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_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 89 | subPath: filebeat.yml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 90 | - mountPath: /var/log/onap |
| 91 | name: policy-logs |
| 92 | - mountPath: /usr/share/filebeat/data |
| 93 | name: policy-data-filebeat |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 94 | volumes: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 95 | - name: localtime |
| 96 | hostPath: |
| 97 | path: /etc/localtime |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 98 | - name: filebeat-conf |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 99 | configMap: |
| 100 | name: policy-filebeat-configmap |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 101 | - name: policy-logs |
| 102 | emptyDir: {} |
| 103 | - name: policy-data-filebeat |
| 104 | emptyDir: {} |
| 105 | - name: policy-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 106 | configMap: |
| 107 | name: policy-pap-log-configmap |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 108 | - name: policy-sdk-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 109 | configMap: |
| 110 | name: policy-sdk-log-configmap |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 111 | - name: pe |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 112 | configMap: |
| 113 | name: policy-dep-pe-configmap |
| 114 | defaultMode: 0755 |
Borislav Glozman | 5197e2e | 2017-07-24 10:45:28 +0300 | [diff] [blame] | 115 | imagePullSecrets: |
Mandeep Khinda | 0e8f889 | 2017-08-25 03:31:17 +0000 | [diff] [blame] | 116 | - name: "{{ .Values.nsPrefix }}-docker-registry-key" |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 117 | #{{ end }} |