diff options
Diffstat (limited to 'kubernetes/portal/templates/portal-vnc-dep.yaml')
-rw-r--r-- | kubernetes/portal/templates/portal-vnc-dep.yaml | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/kubernetes/portal/templates/portal-vnc-dep.yaml b/kubernetes/portal/templates/portal-vnc-dep.yaml index 536ac37396..d5f433816e 100644 --- a/kubernetes/portal/templates/portal-vnc-dep.yaml +++ b/kubernetes/portal/templates/portal-vnc-dep.yaml @@ -6,6 +6,14 @@ metadata: data: {{ (.Files.Glob "resources/vnc/init_profile/profiles.ini").AsConfig | indent 2 }} --- +apiVersion: v1 +kind: ConfigMap +metadata: + name: vnc-update-hosts + namespace: "{{ .Values.nsPrefix }}-portal" +data: +{{ (.Files.Glob "resources/scripts/update_hosts.sh").AsConfig | indent 2 }} +--- apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -71,21 +79,13 @@ spec: image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} name: vnc-vid-readiness - - command: ["/bin/sh","-c"] - 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"] - image: {{ .Values.image.ubuntuInit }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: vnc-init-hosts - volumeMounts: - - name: ubuntu-init - mountPath: /ubuntu-init/ containers: - image: {{ .Values.image.ubuntuDesktop }} imagePullPolicy: {{ .Values.pullPolicy }} lifecycle: postStart: exec: - 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"] + 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 sdc.api.be.simpledemo.onap.org; /tmp/update_hosts.sh portalapps.{{ .Values.nsPrefix }}-portal portal.api.simpledemo.onap.org; /tmp/update_hosts.sh pap.{{ .Values.nsPrefix }}-policy policy.api.simpledemo.onap.org; /tmp/update_hosts.sh sdc-fe.{{ .Values.nsPrefix }}-sdc sdc.api.simpledemo.onap.org; /tmp/update_hosts.sh vid-server.{{ .Values.nsPrefix }}-vid vid.api.simpledemo.onap.org; /tmp/update_hosts.sh sparky-be.{{ .Values.nsPrefix }}-aai aai.api.simpledemo.onap.org; /tmp/update_hosts.sh cli.{{ .Values.nsPrefix }}-cli cli.api.simpledemo.onap.org; sleep 10; done) > update_hosts.log 2>&1 &"] env: - name: VNC_PASSWORD value: password @@ -94,11 +94,12 @@ spec: - mountPath: /etc/localtime name: localtime readOnly: true - - mountPath: /ubuntu-init/ - name: ubuntu-init - mountPath: /root/.init_profile/profiles.ini name: vnc-profiles-ini subPath: profiles.ini + - mountPath: /tmp/update_hosts.sh + name: vnc-update-hosts + subPath: update_hosts.sh securityContext: privileged: true securityContext: {} @@ -106,11 +107,13 @@ spec: - name: localtime hostPath: path: /etc/localtime - - name: ubuntu-init - emptyDir: {} - name: vnc-profiles-ini configMap: name: vnc-profiles-ini + - name: vnc-update-hosts + configMap: + name: vnc-update-hosts + defaultMode: 0755 imagePullSecrets: - name: "{{ .Values.nsPrefix }}-docker-registry-key" #{{ end }} |