vaibhav_16dec | e04b2fe | 2018-03-22 09:07:12 +0000 | [diff] [blame^] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
yuryn | fcef994 | 2017-10-26 17:10:50 +0300 | [diff] [blame] | 15 | #{{ if not .Values.disablePolicyPap }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 16 | apiVersion: extensions/v1beta1 |
| 17 | kind: Deployment |
| 18 | metadata: |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 19 | name: policy-pap |
| 20 | namespace: "{{ .Values.nsPrefix }}" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 21 | spec: |
vaibhav_16dec | f785cf3 | 2018-02-15 10:15:44 +0000 | [diff] [blame] | 22 | replicas: {{ .Values.papReplicas }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 23 | selector: |
| 24 | matchLabels: |
| 25 | app: pap |
| 26 | template: |
| 27 | metadata: |
| 28 | labels: |
| 29 | app: pap |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 30 | name: policy-pap |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 31 | spec: |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 32 | initContainers: |
| 33 | - command: |
| 34 | - /root/ready.py |
| 35 | args: |
| 36 | - --container-name |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 37 | - mariadb |
| 38 | env: |
| 39 | - name: NAMESPACE |
| 40 | valueFrom: |
| 41 | fieldRef: |
| 42 | apiVersion: v1 |
| 43 | fieldPath: metadata.namespace |
| 44 | image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}" |
| 45 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 46 | name: pap-readiness |
| 47 | - command: ["/bin/bash", "-c", "echo $POD_IP > /config/ip_addr.txt"] |
| 48 | env: |
| 49 | - name: POD_IP |
| 50 | valueFrom: |
| 51 | fieldRef: |
| 52 | apiVersion: v1 |
| 53 | fieldPath: status.podIP |
| 54 | volumeMounts: |
| 55 | - mountPath: /config/ |
| 56 | name: pe |
| 57 | image: {{ .Values.image.ubuntu }} |
| 58 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 59 | name: generate-ip-addr-txt |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 60 | containers: |
| 61 | - command: |
| 62 | - /bin/bash |
| 63 | - ./do-start.sh |
| 64 | - pap |
Eric Au | cdaafde | 2017-08-31 16:18:11 -0400 | [diff] [blame] | 65 | image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}" |
kerenj | 3b697f6 | 2017-08-23 11:21:21 +0000 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.pullPolicy }} |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 67 | name: pap |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 68 | env: |
| 69 | - name: PRELOAD_POLICIES |
| 70 | value: "true" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 71 | ports: |
| 72 | - containerPort: 8443 |
| 73 | - containerPort: 9091 |
| 74 | readinessProbe: |
| 75 | tcpSocket: |
| 76 | port: 9091 |
| 77 | initialDelaySeconds: 5 |
| 78 | periodSeconds: 10 |
| 79 | volumeMounts: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 80 | - mountPath: /etc/localtime |
| 81 | name: localtime |
| 82 | readOnly: true |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 83 | - mountPath: /tmp/policy-install/config/ |
| 84 | name: pe |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 85 | - mountPath: /var/log/onap |
| 86 | name: policy-logs |
| 87 | - mountPath: /tmp/policy-install/logback.xml |
| 88 | name: policy-sdk-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 89 | subPath: logback.xml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 90 | - mountPath: /tmp/logback.xml |
| 91 | name: policy-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 92 | subPath: logback.xml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 93 | lifecycle: |
| 94 | postStart: |
| 95 | exec: |
| 96 | 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"] |
| 97 | - image: {{ .Values.image.filebeat }} |
| 98 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 99 | name: filebeat-onap |
| 100 | volumeMounts: |
| 101 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 102 | name: filebeat-conf |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 103 | subPath: filebeat.yml |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 104 | - mountPath: /var/log/onap |
| 105 | name: policy-logs |
| 106 | - mountPath: /usr/share/filebeat/data |
| 107 | name: policy-data-filebeat |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 108 | volumes: |
yuryn | 8b3bc5a | 2017-09-13 19:21:03 +0300 | [diff] [blame] | 109 | - name: localtime |
| 110 | hostPath: |
| 111 | path: /etc/localtime |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 112 | - name: filebeat-conf |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 113 | configMap: |
| 114 | name: policy-filebeat-configmap |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 115 | - name: policy-logs |
| 116 | emptyDir: {} |
| 117 | - name: policy-data-filebeat |
| 118 | emptyDir: {} |
| 119 | - name: policy-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 120 | configMap: |
| 121 | name: policy-pap-log-configmap |
yuryn | d0707be | 2017-09-27 14:54:18 +0300 | [diff] [blame] | 122 | - name: policy-sdk-logback |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 123 | configMap: |
| 124 | name: policy-sdk-log-configmap |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 125 | - name: pe |
vaibhav_16dec | 8de39a7 | 2018-01-17 12:22:52 +0000 | [diff] [blame] | 126 | configMap: |
| 127 | name: policy-dep-pe-configmap |
| 128 | defaultMode: 0755 |
Borislav Glozman | 5197e2e | 2017-07-24 10:45:28 +0300 | [diff] [blame] | 129 | imagePullSecrets: |
Mandeep Khinda | 0e8f889 | 2017-08-25 03:31:17 +0000 | [diff] [blame] | 130 | - name: "{{ .Values.nsPrefix }}-docker-registry-key" |
vasundhra | 86243b7 | 2017-11-22 11:56:23 +0000 | [diff] [blame] | 131 | #{{ end }} |