Containers time zone sync
[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.nsPrefix }}-portal"
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": "{{ .Values.nsPrefix }}-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": "{{ .Values.nsPrefix }}-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": "{{ .Values.nsPrefix }}-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.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.api.be.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host portalapps.{{ .Values.nsPrefix }}-portal | awk ''{print$4}''` portal.api.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host pap.{{ .Values.nsPrefix }}-policy | awk ''{print$4}''` policy.api.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host sdc-fe.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.api.simpledemo.openecomp.org  >> /ubuntu-init/hosts; echo `host vid-server.{{ .Values.nsPrefix }}-vid | awk ''{print$4}''` vid.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host sparky-be.{{ .Values.nsPrefix }}-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         name: vnc-portal
122         volumeMounts:
123         - mountPath: /etc/localtime
124           name: localtime
125           readOnly: true
126         - mountPath: /ubuntu-init/
127           name: ubuntu-init
128         securityContext:
129           privileged: true
130       securityContext: {}
131       volumes:
132         - name: localtime
133           hostPath:
134             path: /etc/localtime
135         - name: ubuntu-init
136           emptyDir: {}
137       imagePullSecrets:
138       - name: "{{ .Values.nsPrefix }}-docker-registry-key"