config seg vid deployment
[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     spec:
26       initContainers:
27       - command:
28         - /root/ready.py
29         args:
30         - --container-name
31         - portalapps
32         env:
33         - name: NAMESPACE
34           valueFrom:
35             fieldRef:
36               apiVersion: v1
37               fieldPath: metadata.namespace
38         image: {{ .Values.image.readiness }}
39         imagePullPolicy: {{ .Values.pullPolicy }}
40         name: vnc-portal-readiness
41       - command:
42         - /root/ready.py
43         args:
44         - --container-name
45         - pap
46         env:
47         - name: NAMESPACE
48           value: {{ .Values.nsPrefix }}-policy
49         image: {{ .Values.image.readiness }}
50         imagePullPolicy: {{ .Values.pullPolicy }}
51         name: vnc-pap-readiness
52       - command:
53         - /root/ready.py
54         args:
55         - --container-name
56         - sdc-fe
57         env:
58         - name: NAMESPACE
59           value: {{ .Values.nsPrefix }}-sdc
60         image: {{ .Values.image.readiness }}
61         imagePullPolicy: {{ .Values.pullPolicy }}
62         name: vnc-sdc-readiness
63       - command:
64         - /root/ready.py
65         args:
66         - --container-name
67         - vid-server
68         env:
69         - name: NAMESPACE
70           value: {{ .Values.nsPrefix }}-vid
71         image: {{ .Values.image.readiness }}
72         imagePullPolicy: {{ .Values.pullPolicy }}
73         name: vnc-vid-readiness
74       - command: ["/bin/sh","-c"]
75         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"]
76         image: {{ .Values.image.ubuntuInit }}
77         imagePullPolicy: {{ .Values.pullPolicy }}
78         name: vnc-init-hosts
79         volumeMounts:
80         - name: ubuntu-init
81           mountPath: /ubuntu-init/
82       containers:
83       - image: {{ .Values.image.ubuntuDesktop }}
84         imagePullPolicy: {{ .Values.pullPolicy }}
85         lifecycle:
86           postStart:
87             exec:
88               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"]
89         env:
90         - name: VNC_PASSWORD
91           value: password
92         name: vnc-portal
93         volumeMounts:
94         - mountPath: /etc/localtime
95           name: localtime
96           readOnly: true
97         - mountPath: /ubuntu-init/
98           name: ubuntu-init
99         - mountPath: /root/.init_profile/profiles.ini
100           name: vnc-profiles-ini
101           subPath: profiles.ini
102         securityContext:
103           privileged: true
104       securityContext: {}
105       volumes:
106         - name: localtime
107           hostPath:
108             path: /etc/localtime
109         - name: ubuntu-init
110           emptyDir: {}
111         - name: vnc-profiles-ini
112           configMap:
113             name: vnc-profiles-ini
114       imagePullSecrets:
115       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
116 #{{ end }}