blob: a01138ea3a599a7457a4692adbb6c0fe5cc617dd [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/}}
{{- if .Values.config.webui.deploy }}
{{ tuple "webui" . | include "5g-control-plane.service_account" }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: webui
labels:
{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 8 }}
{{- with .Values.config.webui.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if .Values.nodeSelectors.enabled }}
nodeSelector:
{{ .Values.nodeSelectors.webui.label }}: {{ .Values.nodeSelectors.webui.value }}
{{- end }}
serviceAccountName: webui
{{- if .Values.images.credentials }}
imagePullSecrets:
- name: {{ .Release.Name }}.registry
{{- end }}
initContainers:
- name: wait-nrf-module
image: {{ .Values.images.tags.init | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
{{- if .Values.config.coreDump.enabled }}
{{ tuple "webui" . | include "5g-control-plane.coredump_init" | indent 6 }}
{{- end }}
containers:
- name: webui
image: {{ .Values.images.tags.webui }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
{{- if .Values.config.coreDump.enabled }}
securityContext:
runAsUser: 0
{{- end }}
stdin: true
tty: true
command: ["/opt/cp/scripts/webui-run.sh"]
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.webui | indent 10 }}
{{- end }}
volumeMounts:
- name: cp-script
mountPath: /opt/cp/scripts/webui-run.sh
subPath: webui-run.sh
- name: cp-config
mountPath: /free5gc/config
{{- if .Values.config.coreDump.enabled }}
- name: coredump
mountPath: /tmp/coredump
{{- end }}
volumes:
- name: cp-script
configMap:
name: webui
defaultMode: 493
- name: cp-config
configMap:
name: webui
defaultMode: 420
{{- if .Values.config.coreDump.enabled }}
- name: host-rootfs
hostPath:
path: /
- name: coredump
hostPath:
path: {{ .Values.config.coreDump.path }}
{{- end }}
{{- end }}