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 |
| 16 | annotations: |
| 17 | pod.beta.kubernetes.io/init-containers: '[ |
| 18 | { |
| 19 | "args": [ |
| 20 | "--container-name", |
| 21 | "nexus", |
| 22 | "--container-name", |
| 23 | "mariadb" |
| 24 | ], |
| 25 | "command": [ |
| 26 | "/root/ready.py" |
| 27 | ], |
| 28 | "env": [ |
| 29 | { |
| 30 | "name": "NAMESPACE", |
| 31 | "valueFrom": { |
| 32 | "fieldRef": { |
| 33 | "apiVersion": "v1", |
| 34 | "fieldPath": "metadata.namespace" |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | ], |
Eric Au | cdaafde | 2017-08-31 16:18:11 -0400 | [diff] [blame] | 39 | "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}", |
kerenj | 3b697f6 | 2017-08-23 11:21:21 +0000 | [diff] [blame] | 40 | "imagePullPolicy": "{{ .Values.pullPolicy }}", |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 41 | "name": "pap-readiness" |
| 42 | }, |
| 43 | { |
| 44 | "env": [ |
| 45 | { |
| 46 | "name": "POD_IP", |
| 47 | "valueFrom": { |
| 48 | "fieldRef": { |
| 49 | "apiVersion": "v1", |
| 50 | "fieldPath": "status.podIP" |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | ], |
| 55 | "command": ["/bin/bash", "-c", "echo $POD_IP > /config/ip_addr.txt"], |
| 56 | "volumeMounts": [ |
| 57 | { |
| 58 | "mountPath": "/config/", |
| 59 | "name": "pe" |
| 60 | } |
| 61 | ], |
kerenj | 3b697f6 | 2017-08-23 11:21:21 +0000 | [diff] [blame] | 62 | "image": "{{ .Values.image.ubuntu }}", |
| 63 | "imagePullPolicy": "{{ .Values.pullPolicy }}", |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 64 | "name": "generate-ip-addr-txt" |
| 65 | } |
| 66 | ]' |
| 67 | spec: |
| 68 | containers: |
| 69 | - command: |
| 70 | - /bin/bash |
| 71 | - ./do-start.sh |
| 72 | - pap |
Eric Au | cdaafde | 2017-08-31 16:18:11 -0400 | [diff] [blame] | 73 | image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}" |
kerenj | 3b697f6 | 2017-08-23 11:21:21 +0000 | [diff] [blame] | 74 | imagePullPolicy: {{ .Values.pullPolicy }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 75 | name: pap |
| 76 | ports: |
| 77 | - containerPort: 8443 |
| 78 | - containerPort: 9091 |
| 79 | readinessProbe: |
| 80 | tcpSocket: |
| 81 | port: 9091 |
| 82 | initialDelaySeconds: 5 |
| 83 | periodSeconds: 10 |
| 84 | volumeMounts: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 85 | - mountPath: /etc/localtime |
| 86 | name: localtime |
| 87 | readOnly: true |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 88 | - mountPath: /tmp/policy-install/config/ |
| 89 | name: pe |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 90 | - mountPath: /var/log/onap |
| 91 | name: policy-logs |
| 92 | - mountPath: /tmp/policy-install/logback.xml |
| 93 | name: policy-sdk-logback |
| 94 | - mountPath: /tmp/logback.xml |
| 95 | name: policy-logback |
| 96 | lifecycle: |
| 97 | postStart: |
| 98 | exec: |
| 99 | 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"] |
| 100 | - image: {{ .Values.image.filebeat }} |
| 101 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 102 | name: filebeat-onap |
| 103 | volumeMounts: |
| 104 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 105 | name: filebeat-conf |
| 106 | - mountPath: /var/log/onap |
| 107 | name: policy-logs |
| 108 | - mountPath: /usr/share/filebeat/data |
| 109 | name: policy-data-filebeat |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 110 | volumes: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 111 | - name: localtime |
| 112 | hostPath: |
| 113 | path: /etc/localtime |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 114 | - name: filebeat-conf |
| 115 | hostPath: |
| 116 | path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml |
| 117 | - name: policy-logs |
| 118 | emptyDir: {} |
| 119 | - name: policy-data-filebeat |
| 120 | emptyDir: {} |
| 121 | - name: policy-logback |
| 122 | hostPath: |
| 123 | path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/xacml-pap-rest/logback.xml |
| 124 | - name: policy-sdk-logback |
| 125 | hostPath: |
| 126 | path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/policy/ep_sdk_app/logback.xml |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 127 | - name: pe |
| 128 | hostPath: |
Mandeep Khinda | 0e8f889 | 2017-08-25 03:31:17 +0000 | [diff] [blame] | 129 | path: /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/pe/ |
Borislav Glozman | 5197e2e | 2017-07-24 10:45:28 +0300 | [diff] [blame] | 130 | imagePullSecrets: |
Mandeep Khinda | 0e8f889 | 2017-08-25 03:31:17 +0000 | [diff] [blame] | 131 | - name: "{{ .Values.nsPrefix }}-docker-registry-key" |
yuryn | fcef994 | 2017-10-26 17:10:50 +0300 | [diff] [blame] | 132 | #{{ end }} |