removing proxy sample
[oom.git] / kubernetes / portal / templates / portal-vnc-dep.yaml
1 #{{ if not .Values.disablePortalVncPortal }}
2 kind: ConfigMap
3 metadata:
4   name: vnc-profiles-ini
5   namespace: "{{ .Values.nsPrefix }}-portal"
6 data:
7 {{ (.Files.Glob "resources/vnc/init_profile/profiles.ini").AsConfig | indent 2 }}
8 ---
9 apiVersion: extensions/v1beta1
10 kind: Deployment
11 metadata:
12   labels:
13     app: vnc-portal
14   name: vnc-portal
15   namespace: "{{ .Values.nsPrefix }}-portal"
16 spec:
17   selector:
18     matchLabels:
19       app: vnc-portal
20   template:
21     metadata:
22       labels:
23         app: vnc-portal
24       name: vnc-portal
25       annotations:
26         pod.beta.kubernetes.io/init-containers: '[
27           {
28               "args": [
29                   "--container-name",
30                   "portalapps"
31               ],
32               "command": [
33                   "/root/ready.py"
34               ],
35               "env": [
36                   {
37                       "name": "NAMESPACE",
38                       "valueFrom": {
39                           "fieldRef": {
40                               "apiVersion": "v1",
41                               "fieldPath": "metadata.namespace"
42                           }
43                       }
44                   }
45               ],
46               "image": "{{ .Values.image.readiness }}",
47               "imagePullPolicy": "{{ .Values.pullPolicy }}",
48               "name": "vnc-portal-readiness"
49           },
50           {
51               "args": [
52                   "--container-name",
53                   "pap"
54               ],
55               "command": [
56                   "/root/ready.py"
57               ],
58               "env": [
59                   {
60                       "name": "NAMESPACE",
61                       "value": "{{ .Values.nsPrefix }}-policy"
62                   }
63               ],
64               "image": "{{ .Values.image.readiness }}",
65               "imagePullPolicy": "{{ .Values.pullPolicy }}",
66               "name": "vnc-pap-readiness"
67           },
68           {
69               "args": [
70                   "--container-name",
71                   "sdc-fe"
72               ],
73               "command": [
74                   "/root/ready.py"
75               ],
76               "env": [
77                   {
78                       "name": "NAMESPACE",
79                       "value": "{{ .Values.nsPrefix }}-sdc"
80                   }
81               ],
82               "image": "{{ .Values.image.readiness }}",
83               "imagePullPolicy": "{{ .Values.pullPolicy }}",
84               "name": "vnc-sdc-readiness"
85           },
86           {
87               "args": [
88                   "--container-name",
89                   "vid-server"
90               ],
91               "command": [
92                   "/root/ready.py"
93               ],
94               "env": [
95                   {
96                       "name": "NAMESPACE",
97                       "value": "{{ .Values.nsPrefix }}-vid"
98                   }
99               ],
100               "image": "{{ .Values.image.readiness }}",
101               "imagePullPolicy": "{{ .Values.pullPolicy }}",
102               "name": "vnc-vid-readiness"
103           },
104           {
105               "command": ["/bin/sh","-c"],
106               "args": ["echo `host sdc-be.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.api.be.simpledemo.onap.org  >> /ubuntu-init/hosts; echo `host portalapps.{{ .Values.nsPrefix }}-portal | awk ''{print$4}''` portal.api.simpledemo.onap.org  >> /ubuntu-init/hosts; echo `host pap.{{ .Values.nsPrefix }}-policy | awk ''{print$4}''` policy.api.simpledemo.onap.org  >> /ubuntu-init/hosts; echo `host sdc-fe.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.api.simpledemo.onap.org  >> /ubuntu-init/hosts; echo `host vid-server.{{ .Values.nsPrefix }}-vid | awk ''{print$4}''` vid.api.simpledemo.onap.org >> /ubuntu-init/hosts; echo `host sparky-be.{{ .Values.nsPrefix }}-aai | awk ''{print$4}''` aai.api.simpledemo.onap.org  >> /ubuntu-init/hosts; echo `host cli.{{ .Values.nsPrefix }}-cli | awk ''{print$4}''` cli.api.simpledemo.onap.org  >> /ubuntu-init/hosts"],
107               "image": "{{ .Values.image.ubuntuInit }}",
108               "imagePullPolicy": "{{ .Values.pullPolicy }}",
109               "name": "vnc-init-hosts",
110               "volumeMounts": [
111                 {
112                   "name": "ubuntu-init",
113                   "mountPath": "/ubuntu-init/"
114                 }
115               ]
116           }
117           ]'
118     spec:
119       containers:
120       - image: {{ .Values.image.ubuntuDesktop }}
121         imagePullPolicy: {{ .Values.pullPolicy }}
122         lifecycle:
123           postStart:
124             exec:
125               command: ["/bin/sh", "-c", "mkdir -p /root/.mozilla/firefox/onap.default; cp /root/.init_profile/profiles.ini /root/.mozilla/firefox/; echo 'user_pref(\"browser.tabs.remote.autostart.2\", false);' > /root/.mozilla/firefox/onap.default/prefs.js; cat /ubuntu-init/hosts >> /etc/hosts"]
126         env:
127         - name: VNC_PASSWORD
128           value: password
129         name: vnc-portal
130         volumeMounts:
131         - mountPath: /etc/localtime
132           name: localtime
133           readOnly: true
134         - mountPath: /ubuntu-init/
135           name: ubuntu-init
136         - mountPath: /root/.init_profile/profiles.ini
137           name: vnc-profiles-ini
138           subPath: profiles.ini
139         securityContext:
140           privileged: true
141       securityContext: {}
142       volumes:
143         - name: localtime
144           hostPath:
145             path: /etc/localtime
146         - name: ubuntu-init
147           emptyDir: {}
148         - name: vnc-profiles-ini
149           configMap:
150             name: vnc-profiles-ini
151       imagePullSecrets:
152       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
153 #{{ end }}