Add option to disable specific deployments
[oom.git] / kubernetes / portal / templates / portal-vnc-dep.yaml
1 #{{ if not .Values.disablePortalVncPortal }}
2 apiVersion: extensions/v1beta1
3 kind: Deployment
4 metadata:
5   labels:
6     app: vnc-portal
7   name: vnc-portal
8   namespace: "{{ .Values.nsPrefix }}-portal"
9 spec:
10   selector:
11     matchLabels:
12       app: vnc-portal
13   template:
14     metadata:
15       labels:
16         app: vnc-portal
17       name: vnc-portal
18       annotations:
19         pod.beta.kubernetes.io/init-containers: '[
20           {
21               "args": [
22                   "--container-name",
23                   "portalapps"
24               ],
25               "command": [
26                   "/root/ready.py"
27               ],
28               "env": [
29                   {
30                       "name": "NAMESPACE",
31                       "valueFrom": {
32                           "fieldRef": {
33                               "apiVersion": "v1",
34                               "fieldPath": "metadata.namespace"
35                           }
36                       }
37                   }
38               ],
39               "image": "{{ .Values.image.readiness }}",
40               "imagePullPolicy": "{{ .Values.pullPolicy }}",
41               "name": "vnc-portal-readiness"
42           },
43           {
44               "args": [
45                   "--container-name",
46                   "pap"
47               ],
48               "command": [
49                   "/root/ready.py"
50               ],
51               "env": [
52                   {
53                       "name": "NAMESPACE",
54                       "value": "{{ .Values.nsPrefix }}-policy"
55                   }
56               ],
57               "image": "{{ .Values.image.readiness }}",
58               "imagePullPolicy": "{{ .Values.pullPolicy }}",
59               "name": "vnc-pap-readiness"
60           },
61           {
62               "args": [
63                   "--container-name",
64                   "sdc-fe"
65               ],
66               "command": [
67                   "/root/ready.py"
68               ],
69               "env": [
70                   {
71                       "name": "NAMESPACE",
72                       "value": "{{ .Values.nsPrefix }}-sdc"
73                   }
74               ],
75               "image": "{{ .Values.image.readiness }}",
76               "imagePullPolicy": "{{ .Values.pullPolicy }}",
77               "name": "vnc-sdc-readiness"
78           },
79           {
80               "args": [
81                   "--container-name",
82                   "vid-server"
83               ],
84               "command": [
85                   "/root/ready.py"
86               ],
87               "env": [
88                   {
89                       "name": "NAMESPACE",
90                       "value": "{{ .Values.nsPrefix }}-vid"
91                   }
92               ],
93               "image": "{{ .Values.image.readiness }}",
94               "imagePullPolicy": "{{ .Values.pullPolicy }}",
95               "name": "vnc-vid-readiness"
96           },
97           {
98               "command": ["/bin/sh","-c"],
99               "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"],
100               "image": "{{ .Values.image.ubuntuInit }}",
101               "imagePullPolicy": "{{ .Values.pullPolicy }}",
102               "name": "vnc-init-hosts",
103               "volumeMounts": [
104                 {
105                   "name": "ubuntu-init",
106                   "mountPath": "/ubuntu-init/"
107                 }
108               ]
109           }
110           ]'
111     spec:
112       containers:
113       - image: {{ .Values.image.ubuntuDesktop }}
114         imagePullPolicy: {{ .Values.pullPolicy }}
115         lifecycle:
116           postStart:
117             exec:
118               command: ["/bin/sh", "-c", "cat /ubuntu-init/hosts >> /etc/hosts"]
119         env:
120         - name: VNC_PASSWORD
121           value: password
122         name: vnc-portal
123         volumeMounts:
124         - mountPath: /etc/localtime
125           name: localtime
126           readOnly: true
127         - mountPath: /ubuntu-init/
128           name: ubuntu-init
129         securityContext:
130           privileged: true
131       securityContext: {}
132       volumes:
133         - name: localtime
134           hostPath:
135             path: /etc/localtime
136         - name: ubuntu-init
137           emptyDir: {}
138       imagePullSecrets:
139       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
140 #{{ end }}