X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fportal%2Ftemplates%2Fportal-vnc-dep.yaml;h=f3418e7bb8c784e1f408a6034247c538776940c7;hb=efce48f73d3162f7705980c549968c799aee936f;hp=536ac37396fc934b577a139b6ccc14d144fb8186;hpb=de049024ceac6dfe48c8e4d06464c419569b61d7;p=oom.git diff --git a/kubernetes/portal/templates/portal-vnc-dep.yaml b/kubernetes/portal/templates/portal-vnc-dep.yaml index 536ac37396..f3418e7bb8 100644 --- a/kubernetes/portal/templates/portal-vnc-dep.yaml +++ b/kubernetes/portal/templates/portal-vnc-dep.yaml @@ -1,27 +1,50 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + #{{ if not .Values.disablePortalVncPortal }} kind: ConfigMap metadata: - name: vnc-profiles-ini - namespace: "{{ .Values.nsPrefix }}-portal" + name: portal-vnc-profiles-ini + namespace: "{{ .Values.nsPrefix }}" data: {{ (.Files.Glob "resources/vnc/init_profile/profiles.ini").AsConfig | indent 2 }} --- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-vnc-update-hosts + namespace: "{{ .Values.nsPrefix }}" +data: +{{ (.Files.Glob "resources/scripts/update_hosts.sh").AsConfig | indent 2 }} +--- apiVersion: extensions/v1beta1 kind: Deployment metadata: labels: - app: vnc-portal - name: vnc-portal - namespace: "{{ .Values.nsPrefix }}-portal" + app: portal-vnc + name: portal-vnc + namespace: "{{ .Values.nsPrefix }}" spec: + replicas: {{ .Values.vncPortalReplicas }} selector: matchLabels: - app: vnc-portal + app: portal-vnc template: metadata: labels: - app: vnc-portal - name: vnc-portal + app: portal-vnc + name: portal-vnc spec: initContainers: - command: @@ -37,7 +60,8 @@ spec: fieldPath: metadata.namespace image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} - name: vnc-portal-readiness + name: portal-vnc-readiness +{{- if empty .Values.disablePolicyPap | not }} - command: - /root/ready.py args: @@ -45,10 +69,11 @@ spec: - pap env: - name: NAMESPACE - value: {{ .Values.nsPrefix }}-policy + value: {{ .Values.nsPrefix }} image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} name: vnc-pap-readiness +{{- end }} - command: - /root/ready.py args: @@ -56,7 +81,7 @@ spec: - sdc-fe env: - name: NAMESPACE - value: {{ .Values.nsPrefix }}-sdc + value: {{ .Values.nsPrefix }} image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} name: vnc-sdc-readiness @@ -67,38 +92,31 @@ spec: - vid-server env: - name: NAMESPACE - value: {{ .Values.nsPrefix }}-vid + value: {{ .Values.nsPrefix }} 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.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 &"] env: - name: VNC_PASSWORD value: password - name: vnc-portal + name: portal-vnc volumeMounts: - 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 +124,14 @@ spec: - name: localtime hostPath: path: /etc/localtime - - name: ubuntu-init - emptyDir: {} - name: vnc-profiles-ini configMap: - name: vnc-profiles-ini + name: portal-vnc-profiles-ini + - name: vnc-update-hosts + configMap: + name: portal-vnc-update-hosts + defaultMode: 0755 imagePullSecrets: - name: "{{ .Values.nsPrefix }}-docker-registry-key" #{{ end }} +