summaryrefslogtreecommitdiffstats
path: root/kubernetes/portal/templates/portal-vnc-dep.yaml
blob: 0680a8ab24e1f50fa3dc44ee0025cb35162c13da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#{{ if not .Values.disablePortalVncPortal }}
kind: ConfigMap
metadata:
  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: portal-vnc
  name: portal-vnc
  namespace: "{{ .Values.nsPrefix }}"
spec:
  replicas: {{ .Values.vncPortalReplicas }}
  selector:
    matchLabels:
      app: portal-vnc
  template:
    metadata:
      labels:
        app: portal-vnc
      name: portal-vnc
    spec:
      initContainers:
      - command:
        - /root/ready.py
        args:
        - --container-name
        - portalapps
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        image: {{ .Values.image.readiness }}
        imagePullPolicy: {{ .Values.pullPolicy }}
        name: portal-vnc-readiness
      - command:
        - /root/ready.py
        args:
        - --container-name
        - pap
        env:
        - name: NAMESPACE
          value: {{ .Values.nsPrefix }}
        image: {{ .Values.image.readiness }}
        imagePullPolicy: {{ .Values.pullPolicy }}
        name: vnc-pap-readiness
      - command:
        - /root/ready.py
        args:
        - --container-name
        - sdc-fe
        env:
        - name: NAMESPACE
          value: {{ .Values.nsPrefix }}
        image: {{ .Values.image.readiness }}
        imagePullPolicy: {{ .Values.pullPolicy }}
        name: vnc-sdc-readiness
      - command:
        - /root/ready.py
        args:
        - --container-name
        - vid-server
        env:
        - name: NAMESPACE
          value: {{ .Values.nsPrefix }}
        image: {{ .Values.image.readiness }}
        imagePullPolicy: {{ .Values.pullPolicy }}
        name: vnc-vid-readiness
      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; (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: portal-vnc
        volumeMounts:
        - mountPath: /etc/localtime
          name: localtime
          readOnly: true
        - 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: {}
      volumes:
        - name: localtime
          hostPath:
            path: /etc/localtime
        - name: vnc-profiles-ini
          configMap:
            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 }}