blob: 232f5b157685e841b6673abb67c22ccd9a805dc7 [file] [log] [blame]
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00001# 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
yurynfcef9942017-10-26 17:10:50 +030015#{{ if not .Values.disablePortalVncPortal }}
yurynde049022017-12-21 14:31:21 +020016kind: ConfigMap
17metadata:
BorislavG8bfc6cf2018-02-27 15:04:26 +000018 name: portal-vnc-profiles-ini
19 namespace: "{{ .Values.nsPrefix }}"
yurynde049022017-12-21 14:31:21 +020020data:
21{{ (.Files.Glob "resources/vnc/init_profile/profiles.ini").AsConfig | indent 2 }}
22---
yurynd9f6ecd2017-11-09 20:07:02 +020023apiVersion: v1
24kind: ConfigMap
25metadata:
BorislavG8bfc6cf2018-02-27 15:04:26 +000026 name: portal-vnc-update-hosts
27 namespace: "{{ .Values.nsPrefix }}"
yurynd9f6ecd2017-11-09 20:07:02 +020028data:
29{{ (.Files.Glob "resources/scripts/update_hosts.sh").AsConfig | indent 2 }}
30---
Mandeep Khindad6ea9872017-06-24 11:49:37 -040031apiVersion: extensions/v1beta1
32kind: Deployment
33metadata:
34 labels:
BorislavG8bfc6cf2018-02-27 15:04:26 +000035 app: portal-vnc
36 name: portal-vnc
37 namespace: "{{ .Values.nsPrefix }}"
Mandeep Khindad6ea9872017-06-24 11:49:37 -040038spec:
vaibhav_16dec49302052018-02-15 10:00:06 +000039 replicas: {{ .Values.vncPortalReplicas }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -040040 selector:
41 matchLabels:
BorislavG8bfc6cf2018-02-27 15:04:26 +000042 app: portal-vnc
Mandeep Khindad6ea9872017-06-24 11:49:37 -040043 template:
44 metadata:
45 labels:
BorislavG8bfc6cf2018-02-27 15:04:26 +000046 app: portal-vnc
47 name: portal-vnc
Mandeep Khindad6ea9872017-06-24 11:49:37 -040048 spec:
vasundhra6f620442017-11-22 12:26:25 +000049 initContainers:
50 - command:
51 - /root/ready.py
52 args:
53 - --container-name
54 - portalapps
55 env:
56 - name: NAMESPACE
57 valueFrom:
58 fieldRef:
59 apiVersion: v1
60 fieldPath: metadata.namespace
61 image: {{ .Values.image.readiness }}
62 imagePullPolicy: {{ .Values.pullPolicy }}
BorislavG8bfc6cf2018-02-27 15:04:26 +000063 name: portal-vnc-readiness
vasundhra6f620442017-11-22 12:26:25 +000064 - command:
65 - /root/ready.py
66 args:
67 - --container-name
68 - pap
69 env:
70 - name: NAMESPACE
BorislavG8bfc6cf2018-02-27 15:04:26 +000071 value: {{ .Values.nsPrefix }}
vasundhra6f620442017-11-22 12:26:25 +000072 image: {{ .Values.image.readiness }}
73 imagePullPolicy: {{ .Values.pullPolicy }}
74 name: vnc-pap-readiness
75 - command:
76 - /root/ready.py
77 args:
78 - --container-name
79 - sdc-fe
80 env:
81 - name: NAMESPACE
BorislavG8bfc6cf2018-02-27 15:04:26 +000082 value: {{ .Values.nsPrefix }}
vasundhra6f620442017-11-22 12:26:25 +000083 image: {{ .Values.image.readiness }}
84 imagePullPolicy: {{ .Values.pullPolicy }}
85 name: vnc-sdc-readiness
86 - command:
87 - /root/ready.py
88 args:
89 - --container-name
90 - vid-server
91 env:
92 - name: NAMESPACE
BorislavG8bfc6cf2018-02-27 15:04:26 +000093 value: {{ .Values.nsPrefix }}
vasundhra6f620442017-11-22 12:26:25 +000094 image: {{ .Values.image.readiness }}
95 imagePullPolicy: {{ .Values.pullPolicy }}
96 name: vnc-vid-readiness
Mandeep Khindad6ea9872017-06-24 11:49:37 -040097 containers:
kerenjcbac0102017-08-23 10:22:33 +000098 - image: {{ .Values.image.ubuntuDesktop }}
99 imagePullPolicy: {{ .Values.pullPolicy }}
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400100 lifecycle:
101 postStart:
102 exec:
BorislavG8bfc6cf2018-02-27 15:04:26 +0000103 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; (while true; do /tmp/update_hosts.sh sdc-be.{{ .Values.nsPrefix }} sdc.api.be.simpledemo.onap.org; /tmp/update_hosts.sh portalapps.{{ .Values.nsPrefix }} portal.api.simpledemo.onap.org; /tmp/update_hosts.sh pap.{{ .Values.nsPrefix }} policy.api.simpledemo.onap.org; /tmp/update_hosts.sh sdc-fe.{{ .Values.nsPrefix }} sdc.api.simpledemo.onap.org; /tmp/update_hosts.sh vid-server.{{ .Values.nsPrefix }} vid.api.simpledemo.onap.org; /tmp/update_hosts.sh sparky-be.{{ .Values.nsPrefix }} aai.api.simpledemo.onap.org; /tmp/update_hosts.sh cli.{{ .Values.nsPrefix }} cli.api.simpledemo.onap.org; sleep 10; done) > update_hosts.log 2>&1 &"]
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400104 env:
105 - name: VNC_PASSWORD
106 value: password
BorislavG8bfc6cf2018-02-27 15:04:26 +0000107 name: portal-vnc
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400108 volumeMounts:
yuryn8b3bc5a2017-09-13 19:21:03 +0300109 - mountPath: /etc/localtime
110 name: localtime
111 readOnly: true
yurynde049022017-12-21 14:31:21 +0200112 - mountPath: /root/.init_profile/profiles.ini
113 name: vnc-profiles-ini
114 subPath: profiles.ini
yurynd9f6ecd2017-11-09 20:07:02 +0200115 - mountPath: /tmp/update_hosts.sh
116 name: vnc-update-hosts
117 subPath: update_hosts.sh
Mandeep Khindad6ea9872017-06-24 11:49:37 -0400118 securityContext:
119 privileged: true
120 securityContext: {}
121 volumes:
yuryn8b3bc5a2017-09-13 19:21:03 +0300122 - name: localtime
123 hostPath:
124 path: /etc/localtime
yurynde049022017-12-21 14:31:21 +0200125 - name: vnc-profiles-ini
126 configMap:
BorislavG8bfc6cf2018-02-27 15:04:26 +0000127 name: portal-vnc-profiles-ini
yurynd9f6ecd2017-11-09 20:07:02 +0200128 - name: vnc-update-hosts
129 configMap:
BorislavG8bfc6cf2018-02-27 15:04:26 +0000130 name: portal-vnc-update-hosts
yurynd9f6ecd2017-11-09 20:07:02 +0200131 defaultMode: 0755
Borislav Glozman5197e2e2017-07-24 10:45:28 +0300132 imagePullSecrets:
Mandeep Khinda0e8f8892017-08-25 03:31:17 +0000133 - name: "{{ .Values.nsPrefix }}-docker-registry-key"
vasundhra6f620442017-11-22 12:26:25 +0000134#{{ end }}