blob: a01138ea3a599a7457a4692adbb6c0fe5cc617dd [file] [log] [blame]
Badhrinath987e1d82020-11-20 13:23:58 -06001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.webui.deploy }}
8{{ tuple "webui" . | include "5g-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: Deployment
12metadata:
13 name: webui
14 labels:
15{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 selector:
19 matchLabels:
20{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 6 }}
21 template:
22 metadata:
23 labels:
24{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 8 }}
25 {{- with .Values.config.webui.podAnnotations }}
26 annotations:
27 {{- toYaml . | nindent 8 }}
28 {{- end }}
29 spec:
30 {{- if .Values.nodeSelectors.enabled }}
31 nodeSelector:
32 {{ .Values.nodeSelectors.webui.label }}: {{ .Values.nodeSelectors.webui.value }}
33 {{- end }}
34 serviceAccountName: webui
35 {{- if .Values.images.credentials }}
36 imagePullSecrets:
37 - name: {{ .Release.Name }}.registry
38 {{- end }}
39 initContainers:
40 - name: wait-nrf-module
41 image: {{ .Values.images.tags.init | quote }}
42 imagePullPolicy: {{ .Values.images.pullPolicy }}
43 command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
44 {{- if .Values.config.coreDump.enabled }}
45{{ tuple "webui" . | include "5g-control-plane.coredump_init" | indent 6 }}
46 {{- end }}
47 containers:
48 - name: webui
49 image: {{ .Values.images.tags.webui }}
50 imagePullPolicy: {{ .Values.images.pullPolicy }}
51 {{- if .Values.config.coreDump.enabled }}
52 securityContext:
53 runAsUser: 0
54 {{- end }}
55 stdin: true
56 tty: true
57 command: ["/opt/cp/scripts/webui-run.sh"]
58 {{- if .Values.resources.enabled }}
59 resources:
60{{ toYaml .Values.resources.webui | indent 10 }}
61 {{- end }}
62 volumeMounts:
63 - name: cp-script
64 mountPath: /opt/cp/scripts/webui-run.sh
65 subPath: webui-run.sh
66 - name: cp-config
67 mountPath: /free5gc/config
68 {{- if .Values.config.coreDump.enabled }}
69 - name: coredump
70 mountPath: /tmp/coredump
71 {{- end }}
72 volumes:
73 - name: cp-script
74 configMap:
75 name: webui
76 defaultMode: 493
77 - name: cp-config
78 configMap:
79 name: webui
80 defaultMode: 420
81 {{- if .Values.config.coreDump.enabled }}
82 - name: host-rootfs
83 hostPath:
84 path: /
85 - name: coredump
86 hostPath:
87 path: {{ .Values.config.coreDump.path }}
88 {{- end }}
89{{- end }}