Start config4g pod which handles the configuration for 4G network
functions. Config4G receives configuration from simapp/ROC. Config4G
also does the health check for 4G network functions. Send config
if 4G network function is restarted.
Change-Id: I674d0bed095d5c3cbeffb2992a4fccdbbb662509
diff --git a/omec/omec-control-plane/templates/bin/_config4g-run.sh.tpl b/omec/omec-control-plane/templates/bin/_config4g-run.sh.tpl
new file mode 100644
index 0000000..b568195
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_config4g-run.sh.tpl
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Copyright 2020-present Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+set -xe
+
+{{- if .Values.config.coreDump.enabled }}
+cp /free5gc/webconsole/webconsole /tmp/coredump/
+{{- end }}
+
+cd /free5gc
+
+cat config/webuicfg.conf
+
+./webconsole/webconsole -webuicfg config/webuicfg.conf
diff --git a/omec/omec-control-plane/templates/configmap-config4g.yaml b/omec/omec-control-plane/templates/configmap-config4g.yaml
new file mode 100644
index 0000000..7a0b722
--- /dev/null
+++ b/omec/omec-control-plane/templates/configmap-config4g.yaml
@@ -0,0 +1,40 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- if .Values.config.config4g.deploy }}
+
+{{- if not .Values.config.useExistingConfigMap -}}
+{{- $config4gcfg := index .Values.config.config4g.cfgFiles "webuicfg.conf" }}
+{{- $config := index $config4gcfg "configuration" }}
+
+{{- if not (hasKey $config4gcfg "logger") -}}
+{{- $_ := .Values.config.logger | set $config4gcfg "logger" -}}
+{{- end }}
+
+{{- if not (hasKey $config "managedByConfigPod") -}}
+{{- $_ := .Values.config.managedByConfigPod | set $config "managedByConfigPod" -}}
+{{- end }}
+
+
+{{- end }}
+
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: config4g
+ labels:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+ config4g-run.sh: |
+{{ tuple "bin/_config4g-run.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
+{{- if not .Values.config.useExistingConfigMap -}}
+{{- range $key, $value := .Values.config.config4g.cfgFiles }}
+ {{ $key }}: |-
+{{ toYaml $value | indent 4 }}
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/service-config4g.yaml b/omec/omec-control-plane/templates/service-config4g.yaml
new file mode 100644
index 0000000..ab01c6c
--- /dev/null
+++ b/omec/omec-control-plane/templates/service-config4g.yaml
@@ -0,0 +1,52 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- if .Values.config.config4g.deploy }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: config4g
+ labels:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ type: ClusterIP
+ selector:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ ports:
+ - name: prometheus-exporter
+ port: {{ .Values.config.config4g.prometheus.port }}
+ protocol: TCP
+ - name: urlport-http
+ port: {{ .Values.config.config4g.urlport.port }}
+ protocol: TCP
+{{- if or .Values.config.config4g.urlport.nodePort.enabled .Values.config.config4g.prometheus.nodePort.enabled }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: config4g-external
+ labels:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ type: NodePort
+ selector:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ ports:
+{{- if .Values.config.config4g.prometheus.nodePort.enabled }}
+ - name: prometheus-exporter
+ port: {{ .Values.config.config4g.prometheus.port }}
+ protocol: TCP
+ nodePort: {{ .Values.config.config4g.prometheus.nodePort.port }}
+{{- end }}
+{{- if .Values.config.config4g.urlport.nodePort.enabled }}
+ - name: urlport-http
+ port: {{ .Values.config.config4g.urlport.port }}
+ protocol: TCP
+ nodePort: {{ .Values.config.config4g.urlport.nodePort.port }}
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/service-mme.yaml b/omec/omec-control-plane/templates/service-mme.yaml
index 69e8af7..8ae95b9 100644
--- a/omec/omec-control-plane/templates/service-mme.yaml
+++ b/omec/omec-control-plane/templates/service-mme.yaml
@@ -32,6 +32,12 @@
- name: prometheus-exporter
port: {{ .Values.config.mme.prometheus.port }}
protocol: TCP
+ - name: mme-app-config
+ port: 8080
+ protocol: TCP
+ - name: mme-s1ap-config
+ port: 8081
+ protocol: TCP
---
apiVersion: v1
kind: Service
diff --git a/omec/omec-control-plane/templates/statefulset-config4g.yaml b/omec/omec-control-plane/templates/statefulset-config4g.yaml
new file mode 100644
index 0000000..2565d7b
--- /dev/null
+++ b/omec/omec-control-plane/templates/statefulset-config4g.yaml
@@ -0,0 +1,81 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- if .Values.config.config4g.deploy }}
+{{ tuple "config4g" . | include "omec-control-plane.service_account" }}
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: config4g
+ labels:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ serviceName: config4g-headless
+ selector:
+ matchLabels:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+ template:
+ metadata:
+ labels:
+{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+ {{- with .Values.config.config4g.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ serviceAccountName: config4g
+ {{- if hasKey .Values.images "pullSecrets" }}
+ imagePullSecrets:
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
+ {{- end }}
+ containers:
+ - name: config-4g
+ image: {{ .Values.images.tags.config4g }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ runAsUser: 0
+ {{- end }}
+ stdin: true
+ tty: true
+ command: ["/free5gc/script/config4g-run.sh"]
+ env:
+ - name: CONFIGPOD_DEPLOYMENT
+ value: "4G"
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.config4g | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: run-script
+ mountPath: /free5gc/script/config4g-run.sh
+ subPath: config4g-run.sh
+ - name: nf-config
+ mountPath: /free5gc/config
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ volumes:
+ - name: run-script
+ configMap:
+ name: config4g
+ defaultMode: 493
+ - name: nf-config
+ configMap:
+ name: config4g
+ defaultMode: 493
+ {{- if .Values.config.coreDump.enabled }}
+ - name: host-rootfs
+ hostPath:
+ path: /
+ - name: coredump
+ hostPath:
+ path: {{ .Values.config.coreDump.path }}
+ {{- end }}
+{{- end }}