aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/portal/templates
diff options
context:
space:
mode:
authoryuryn <Yury.Novitsky@Amdocs.com>2017-11-09 20:07:02 +0200
committeryuryn <Yury.Novitsky@Amdocs.com>2018-01-17 23:31:42 +0200
commitd9f6ecd1c5b5296d8bb198b13430d437a6f7a54a (patch)
tree62e22c5462dd8d26e724d302d72620a755636d56 /kubernetes/portal/templates
parent58a0c10a49c79962adfd43d179ad8043c5aa1e81 (diff)
Refresh /etc/hosts in VNC - reviewed
Change-Id: Ie2c9648e067867d00c035dd9f35560be2ecd6724 Issue-ID: OOM-413 Signed-off-by: yuryn <Yury.Novitsky@Amdocs.com>
Diffstat (limited to 'kubernetes/portal/templates')
-rw-r--r--kubernetes/portal/templates/portal-vnc-dep.yaml29
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..b200d8fc15 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; 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 }}