portal K8S-Helm Parameterization
[oom.git] / kubernetes / portal / templates / portal-vnc-dep.yaml
1 apiVersion: extensions/v1beta1
2 kind: Deployment
3 metadata:
4   labels:
5     app: vnc-portal
6   name: vnc-portal
7   namespace: {{ .Values.NS }}
8 spec:
9   selector:
10     matchLabels:
11       app: vnc-portal
12   template:
13     metadata:
14       labels:
15         app: vnc-portal
16       name: vnc-portal
17       annotations:
18         pod.beta.kubernetes.io/init-containers: '[
19           {
20               "args": [
21                   "--container-name",
22                   "portalapps"
23               ],
24               "command": [
25                   "/root/ready.py"
26               ],
27               "env": [
28                   {
29                       "name": "NAMESPACE",
30                       "valueFrom": {
31                           "fieldRef": {
32                               "apiVersion": "v1",
33                               "fieldPath": "metadata.namespace"
34                           }
35                       }
36                   }
37               ],
38               "image": "{{ .Values.image.readiness }}",
39               "imagePullPolicy": "{{ .Values.pullPolicy }}",
40               "name": "vnc-portal-readiness"
41           },
42           {
43               "args": [
44                   "--container-name",
45                   "pap"
46               ],
47               "command": [
48                   "/root/ready.py"
49               ],
50               "env": [
51                   {
52                       "name": "NAMESPACE",
53                       "value": "onap-policy"
54                   }
55               ],
56               "image": "{{ .Values.image.readiness }}",
57               "imagePullPolicy": "{{ .Values.pullPolicy }}",
58               "name": "vnc-pap-readiness"
59           },
60           {
61               "args": [
62                   "--container-name",
63                   "sdc-fe"
64               ],
65               "command": [
66                   "/root/ready.py"
67               ],
68               "env": [
69                   {
70                       "name": "NAMESPACE",
71                       "value": "onap-sdc"
72                   }
73               ],
74               "image": "{{ .Values.image.readiness }}",
75               "imagePullPolicy": "{{ .Values.pullPolicy }}",
76               "name": "vnc-sdc-readiness"
77           },
78           {
79               "args": [
80                   "--container-name",
81                   "vid-server"
82               ],
83               "command": [
84                   "/root/ready.py"
85               ],
86               "env": [
87                   {
88                       "name": "NAMESPACE",
89                       "value": "onap-vid"
90                   }
91               ],
92               "image": "{{ .Values.image.readiness }}",
93               "imagePullPolicy": "{{ .Values.pullPolicy }}",
94               "name": "vnc-vid-readiness"
95           },
96           {
97               "command": ["/bin/sh","-c"],
98               "args": ["echo `host sdc-be.onap-sdc | awk ''{print$4}''` sdc.api.be.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host portalapps.onap-portal | awk ''{print$4}''` portal.api.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host pap.onap-policy | awk ''{print$4}''` policy.api.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host sdc-fe.onap-sdc | awk ''{print$4}''` sdc.ui.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host vid-server.onap-vid | awk ''{print$4}''` vid.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host sparky-fe.onap-aai | awk ''{print$4}''` aai.api.simpledemo.openecomp.org  >> /ubuntu-init/hosts"],
99               "image": "{{ .Values.image.ubuntuInit }}",
100               "imagePullPolicy": "{{ .Values.pullPolicy }}",
101               "name": "vnc-init-hosts",
102               "volumeMounts": [
103                 {
104                   "name": "ubuntu-init",
105                   "mountPath": "/ubuntu-init/"
106                 }
107               ]
108           }
109           ]'
110     spec:
111       containers:
112       - image: {{ .Values.image.ubuntuDesktop }}
113         imagePullPolicy: {{ .Values.pullPolicy }}
114         lifecycle:
115           postStart:
116             exec:
117               command: ["/bin/sh", "-c", "cat /ubuntu-init/hosts >> /etc/hosts"]
118         env:
119         - name: VNC_PASSWORD
120           value: password
121         imagePullPolicy: IfNotPresent
122         name: vnc-portal
123         volumeMounts:
124         - mountPath: /ubuntu-init/
125           name: ubuntu-init
126         securityContext:
127           privileged: true
128       securityContext: {}
129       volumes:
130         - name: ubuntu-init
131           emptyDir: {}
132       imagePullSecrets:
133       - name: onap-docker-registry-key