Commit 8138d68c authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

Merge branch 'helm-tutorial' into 'master'

Helm tutorial

See merge request oai/cn5g/oai-cn5g-fed!17
parents 0e59b5e0 2887df4a
......@@ -13,5 +13,4 @@ icon: https://www.mysql.com/common/logos/logo-mysql-170x115.png
sources:
- https://github.com/kubernetes/charts
- https://github.com/docker-library/mysql
deprecated: true
engine: gotpl
engine: gotpl
\ No newline at end of file
# mysql image version
## ref: https://hub.docker.com/r/library/mysql/tags/
##
image: "image-registry.openshift-image-registry.svc:5000/oaicicd-tmp/mysql-internal"
image: "mysql-internal"
imageTag: "5.7.30"
strategy:
type: Recreate
busybox:
image: "image-registry.openshift-image-registry.svc:5000/oaicicd-5gcn-tmp/busybox-internal"
tag: "latest"
image: "busybox"
tag: "1.32"
testFramework:
enabled: false
......@@ -338,8 +338,14 @@ initializationFiles:
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES ('20834123456789','380561234567','35609204079300',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,'+ÖEŸ‚ų\0•,IHÿH',0,0,00000000000000000096,'Px¼X \Z1¡Éx™ß','^œ¤K¬îòˆÕØFeUÿ—à'),('20810000001234','33611123456','35609204079299',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000281454575616225,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','ç4øs@ÖÅÎz€ž~œ'),('31002890832150','33638060059','35611302209414',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012416,'`ÏF®Ý†ôéD¢¼Ï›‰Á¼','ç4øs@ÖÅÎz€ž~œ'),('001010123456789','33600101789','35609204079298',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'\0 \n\r',1,0,00000000000000000351,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','L‹*\\º”›±^Ýù]ö '),('208930000000001','33638030001','35609204079301',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208950000000002','33638050002','35609204079502',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000020471,'\0 \n\r','ç4øs@ÖÅÎz€ž~œ'),('208950000000003','33638050003','35609204079503',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012343,'\0 \n\r','ç4øs@ÖÅÎz€ž~œ'),('208950000000004','33638050004','35609204079504',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000005','33638050005','35609204079505',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000001','33638050001','35609204079501',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208950000000006','33638050006','35609204079506',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000007','33638050007','35609204079507',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208930000000002','33638030002','35609204079302',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208930000000003','33638030003','35609204079303',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208930000000004','33638030004','35609204079304',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208930000000005','33638030005','35609204079305',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208930000000006','33638030006','35609204079306',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208930000000007','33638030007','35609204079307',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208940000000007','33638040007','35609204079407',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208940000000006','33638040006','35609204079406',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208940000000005','33638040005','35609204079405',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208940000000004','33638040004','35609204079404',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208940000000003','33638040003','35609204079403',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208940000000002','33638040002','35609204079402',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208940000000001','33638040001','35609204079401',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ëÐwq¬ègzW®Ð²áZ]','ç4øs@ÖÅÎz€ž~œ'),('208920100001100','33638020001','35609204079201',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001101','33638020001','35609204079201',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'þÈk¦ëp~Љu{´K',1,0,00000281044204937234,'\0 \n\r','Ä$I6;ºÐ+fÑkÉu×|Á'),('208920100001102','33638020002','35609204079202',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001103','33638020003','35609204079203',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001104','33638020004','35609204079204',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001105','33638020005','35609204079205',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001106','33638020006','35609204079206',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'þÈk¦ëp~Љu{´K',1,0,00000000000000006103,'ebd07771ace8677a','Ä$I6;ºÐ+fÑkÉu×|Á'),('208920100001107','33638020007','35609204079207',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001108','33638020008','35609204079208',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001109','33638020009','35609204079209',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208920100001110','33638020010','35609204079210',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208930100001111','33638030011','35609304079211',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208930100001112','33638030012','35609304079212',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006103,'ebd07771ace8677a','ç4øs@ÖÅÎz€ž~œ'),('208930100001113','33638030013','35609304079213',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000006263,'¦SNÜ’’Ivãèe¯6','ç4øs@ÖÅÎz€ž~œ'),('208950000000008','33638050008','35609204079508',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000009','33638050009','35609204079509',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000010','33638050010','35609204079510',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000011','33638050011','35609204079511',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000012','33638050012','35609204079512',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000013','33638050013','35609204079513',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000014','33638050014','35609204079514',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000012215,'56f0261d9d051063','ç4øs@ÖÅÎz€ž~œ'),('208950000000015','33638050015','35609204079515',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'‹¯G?/Д‡ÌË× |hb',1,0,00000000000000000000,'3536663032363164','ç4øs@ÖÅÎz€ž~œ'),('208920100001118','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'þÈk¦ëp~Љu{´K',1,0,00000281044204934762,'~?03îu-%ÞeyÖyý','Ä$I6;ºÐ+fÑkÉu×|Á'),('208920100001121','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'þÈk¦ëp~Љu{´K',1,0,00000281044204935293,'&”‚@xg€]ÿôÄ\nœÛVp','Ä$I6;ºÐ+fÑkÉu×|Á'),('208920100001119','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'þÈk¦ëp~Љu{´K',1,0,00000281044204935293,'269482407867805d','Ä$I6;ºÐ+fÑkÉu×|Á'),('208920100001120','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'þÈk¦ëp~Љu{´K',1,0,00000281044204935293,'3236393438323430','Ä$I6;ºÐ+fÑkÉu×|Á');
INSERT INTO `users` VALUES ('208950000000030','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
INSERT INTO `users` VALUES ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
INSERT INTO `users` VALUES ('208950000000032','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
INSERT INTO `users` VALUES ('208950000000033','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
INSERT INTO `users` VALUES ('208950000000034','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
--
-- Add a new user entry here using use above insert statement as template
--
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......
apiVersion: v2
apiVersion: v1
name: oai-amf
description: A Helm chart for AMF network function
description: Helm chart for AMF network function
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.0
version: 1.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.1.0
appVersion: 1.1.0
keywords:
- 5GCN
......@@ -28,7 +16,6 @@ keywords:
sources:
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf
- https://github.com/OPENAIRINTERFACE/openair-k8s
maintainers:
- name: OPENAIRINTERFACE
......
#!/bin/bash
set -eo pipefail
STATUS=0
AMF_PORT_FOR_NGAP=38412
AMF_PORT_FOR_N11_HTTP=80
AMF_IP_NGAP_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_NGAP | grep inet | awk {'print $2'})
AMF_IP_N11_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_N11 | grep inet | awk {'print $2'})
N2_PORT_STATUS=$(netstat -Snpl | grep -o "$AMF_IP_NGAP_INTERFACE:$AMF_PORT_FOR_NGAP")
N11_PORT_STATUS=$(netstat -tnpl | grep -o "$AMF_IP_N11_INTERFACE:$AMF_PORT_FOR_N11_HTTP")
#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
NB_UNREPLACED_AT=`cat /openair-amf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
if [ $NB_UNREPLACED_AT -ne 0 ]; then
STATUS=1
echo "Healthcheck error: configuration file is not configured properly"
fi
if [[ -z $N2_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: N2 SCTP port $AMF_PORT_FOR_NGAP is not listening"
fi
if [[ -z $N11_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: N11/SBI TCP/HTTP port $AMF_PORT_FOR_N11_HTTP is not listening"
fi
exit $STATUS
......@@ -10,6 +10,4 @@
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-amf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}
......@@ -6,3 +6,10 @@ data:
{{- range $key, $val := .Values.config }}
{{ $key }}: {{ $val | quote }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-health-cm
data:
{{ (.Files.Glob "scripts/live-ready.sh").AsConfig | indent 2 }}
\ No newline at end of file
......@@ -15,40 +15,69 @@ spec:
metadata:
labels:
{{- include "oai-amf.selectorLabels" . | nindent 8 }}
{{- if .Values.multus.create }}
annotations:
k8s.v1.cni.cncf.io/networks: >-
[{
"name": "{{ .Chart.Name }}-{{ .Values.namespace }}-ngap-net1",
"default-route": ["{{ .Values.multus.ngapGateway }}"]
"name": "{{ .Chart.Name }}-{{ .Values.namespace }}-n1-net1",
"default-route": ["{{ .Values.multus.n1Gateway }}"]
}]
{{- end }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: tcpdump
image: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}"
{{- if .Values.start.tcpdump}}
command:
- /bin/sh
- -c
- /usr/sbin/tcpdump -i any -w /pcap/oai-amf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
- /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
{{- if .Values.persistence.sharedvolume}}
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
{{- end}}
- name: amf
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}"
{{- if .Values.resources.define}}
resources:
requests:
memory: {{ .Values.resources.requests.memory | quote }}
cpu: {{ .Values.resources.requests.cpu | quote }}
limits:
memory: {{ .Values.resources.limits.memory | quote }}
cpu: {{ .Values.resources.limits.cpu | quote }}
{{- end}}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
volumeMounts:
- mountPath: /scripts
name: scripts
{{- if .Values.readinessProbe}}
readinessProbe:
exec:
command:
- sh
- /scripts/live-ready.sh
initialDelaySeconds: 5
periodSeconds: 5
{{- end}}
{{- if .Values.livenessProbe}}
livenessProbe:
exec:
command:
- sh
- /scripts/live-ready.sh
initialDelaySeconds: 5
periodSeconds: 5
{{- end}}
ports:
- containerPort: {{ .Values.service.sctpPort }}
name: oai-amf
......@@ -201,11 +230,6 @@ spec:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: smfFqdn0
- name: SELECTED_0
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: selected0
- name: SMF_INSTANCE_ID_1
valueFrom:
configMapKeyRef:
......@@ -226,11 +250,6 @@ spec:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: smfFqdn1
- name: SELECTED_1
valueFrom:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: selected1
- name: NRF_IPV4_ADDRESS
valueFrom:
configMapKeyRef:
......@@ -307,12 +326,21 @@ spec:
name: {{ .Chart.Name }}-configmap
key: operatorKey
volumes:
{{- if .Values.persistence.sharedvolume}}
- name: cn5g-pv
persistentVolumeClaim:
persistenceVolumeClaim:
claimName: cn5g-pvc
{{- end }}
- name: scripts
configMap:
name: {{ .Chart.Name }}-health-cm
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
serviceAccountName: {{ .Values.serviceAccount.name }}
terminationGracePeriodSeconds: 15
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- if .Values.nodeSelector}}
nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }}
{{- end }}
{{- if .Values.nodeName}}
nodeName: {{ .Values.nodeName }}
{{- end }}
\ No newline at end of file
---
{{- if .Values.multus.create }}
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: {{ .Chart.Name }}-{{ .Values.namespace }}-ngap-net1
name: {{ .Chart.Name }}-{{ .Values.namespace }}-n1-net1
spec:
config: '{
"cniVersion": "0.3.0",
......@@ -13,8 +14,9 @@ spec:
"type": "static",
"addresses": [
{
"address": {{- cat .Values.multus.ngapIPadd "/" .Values.multus.ngapNetmask | nospace | quote }}
"address": {{- cat .Values.multus.n1IPadd "/" .Values.multus.n1Netmask | nospace | quote }}
}
]
}
}'
{{- end }}
\ No newline at end of file
......@@ -7,7 +7,7 @@ rules:
- apiGroups:
- security.openshift.io
resourceNames:
- privileged
- anyuid
resources:
- securitycontextconstraints
verbs:
......
# Default values for oai-amf.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
namespace: "PROJECT"
namespace: "oai"
image:
nfimage:
registry: local
repository: image-registry.openshift-image-registry.svc:5000/PROJECT/oai-amf
version: "TAG"
repository: rdefosseoai/oai-amf # image name either locally present or in a public/private repository
version: v1.1.0 # image tag
# pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
imagePullSecrets: []
tcpdumpimage:
registry: local
repository: corfr/tcpdump
version: latest
#pullPolicy: IfNotPresent or Never or Always
pullPolicy: Always
serviceAccount:
# Specifies whether a service account should be created
......@@ -22,20 +27,14 @@ serviceAccount:
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: "oai-amf-svc"
name: "oai-amf-sa"
podSecurityContext:
runAsUser: 0
runAsGroup: 0
securityContext:
privileged: true
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
privileged: false
service:
type: ClusterIP
......@@ -45,12 +44,16 @@ service:
start:
amf: true
tcpdump: true
tcpdump: false #start tcpdump collection to analyse but beware it will take a lot of space in the container/persistent volume
### In case your gNB or emulator is outside of the cluster then you need an extra interface to communicate with gNB
## This interface will be for N1/N2/NGAP
multus:
ngapIPadd: "192.168.18.177"
ngapNetmask: "24"
ngapGateway: "192.168.18.129"
create: true
n1IPadd: "192.168.18.177"
n1Netmask: "24"
n1Gateway: "192.168.18.129"
config:
instance: "0"
......@@ -72,55 +75,54 @@ config:
plmnSupportTac: "0xa000"
sst0: "222"
sd0: "123"
sst1: "1"
sd1: "12"
amfInterfaceNameForNGAP: "net1"
amfInterfaceNameForN11: "eth0"
smfInstanceId0: "1"
smfIpv4Addr0: "0.0.0.0"
smfHttpVersion0: "v1"
smfFqdn0: "oai-amf-svc"
selected0: "true"
smfInstanceId1: "2"
smfIpv4Addr1: "127.0.0.1"
smfHttpVersion1: "v1"
smfFqdn1: "oai-amf-svc"
selected1: "false"
nrfIpv4Addr: "192.168.18.178"
sst1: "111"
sd1: "124"
amfInterfaceNameForNGAP: "net1" # If multus creation is true then net1 else eth0
amfInterfaceNameForN11: "eth0" # Service based interface
smfInstanceId0: "1" # Only configure if not using NRF
smfIpv4Addr0: "0.0.0.0" # Only configure if not using NRF
smfHttpVersion0: "v1" # Only configure if not using NRF
smfFqdn0: "localhost" # Only configure if not using NRF
smfInstanceId1: "2" # Currently disabled in the amf.conf no need to configure
smfIpv4Addr1: "0.0.0.0" # Currently disabled in the amf.conf no need to configure
smfHttpVersion1: "v1" # Currently disabled in the amf.conf no need to configure
smfFqdn1: "localhost" # Currently disabled in the amf.conf no need to configure
nrfIpv4Addr: "0.0.0.0"
nrfPort: 80
nrfApiVersion: "v1"
nrfFqdn: "oai-nrf-svc"
ausfIpv4Addr: "127.0.0.1"
nrfFqdn: "oai-nrf-svc" # amf communicates using FQDN
ausfIpv4Addr: "127.0.0.1" # configure only if there is an external AUSF else it will communicate with mysql directly
ausfPort: 80
ausfApiVersion: "v1"
nfRegistration: "yes"
smfSelection: "yes"
useFqdnDns: "yes"
mySqlServer: "mysql"
mySqlUser: "root"
mySqlPass: "linux"
mySqlDb: "oai_db"
operatorKey: "63bfa50ee6523365ff14c1f45f88737d"
nfRegistration: "yes"
smfSelection: "yes"
useFqdnDns: "yes" # Important to avoid mentioning any static ip-address
mySqlServer: "mysql" # used only if not using AUSF
mySqlUser: "root" # used only if not using AUSF
mySqlPass: "linux" # used only if not using AUSF
mySqlDb: "oai_db" # used only if not using AUSF
operatorKey: "63bfa50ee6523365ff14c1f45f88737d" # should be same as in susbcriber database
persistence:
# make it true for the first time when you want to create persistance volume
# and then false
enabled: false
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
requests:
sharedvolume: false
volumneName: managed-nfs-storage
size: 1Gi
resources:
define: false
limits:
cpu: 100m
memory: 256Mi
memory: 128Mi
requests:
cpu: 100m
memory: 256Mi
nodeSelector: {}
readinessProbe: true
tolerations: []
livenessProbe: true
terminationGracePeriodSeconds: 30
nodeSelector: {}
affinity: {}
nodeName:
apiVersion: v2
apiVersion: v1
name: oai-nrf
description: A Helm chart for NRF network function
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.0
version: 1.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.1.0
appVersion: 1.1.0
keywords:
- 5GCN
......@@ -28,7 +16,6 @@ keywords:
sources:
- https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf
- https://github.com/OPENAIRINTERFACE/openair-k8s
maintainers:
- name: OPENAIRINTERFACE
......
#!/bin/bash
set -eo pipefail
STATUS=0
NRF_IP_SBI_INTERFACE=$(ifconfig $NRF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
NRF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$NRF_IP_SBI_INTERFACE:$NRF_INTERFACE_PORT_FOR_SBI")
#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
NB_UNREPLACED_AT=`cat /openair-nrf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
if [ $NB_UNREPLACED_AT -ne 0 ]; then
STATUS=1
echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
fi
if [[ -z $NRF_SBI_PORT_STATUS ]]; then
STATUS=1
echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $NRF_INTERFACE_PORT_FOR_SBI is not listening."
fi
exit $STATUS
\ No newline at end of file
......@@ -10,6 +10,4 @@
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nrf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}
......@@ -6,3 +6,10 @@ data:
{{- range $key, $val := .Values.config }}
{{ $key }}: {{ $val | quote }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-health-cm
data:
{{ (.Files.Glob "scripts/live-ready.sh").AsConfig | indent 2 }}
\ No newline at end of file
......@@ -15,34 +15,65 @@ spec:
metadata:
labels:
{{- include "oai-nrf.selectorLabels" . | nindent 8 }}
{{- if .Values.multus.create }}
annotations:
k8s.v1.cni.cncf.io/networks: "{{ .Chart.Name }}-{{ .Values.namespace }}-net1"
{{- end }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: tcpdump
image: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}"
{{- if .Values.start.tcpdump}}
command:
- /bin/sh
- -c
- /usr/sbin/tcpdump -i any -w /pcap/oai-nrf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
- /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
{{- else}}
command:
- /bin/sleep
- infinity
{{- end}}
{{- if .Values.persistence.sharedvolume}}
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
{{- end}}
- name: nrf
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}"
{{- if .Values.resources.define}}
resources:
requests:
memory: {{ .Values.resources.requests.memory | quote }}
cpu: {{ .Values.resources.requests.cpu | quote }}
limits:
memory: {{ .Values.resources.limits.memory | quote }}
cpu: {{ .Values.resources.limits.cpu | quote }}
{{- end}}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
volumeMounts:
- mountPath: /scripts
name: scripts
{{- if .Values.readinessProbe}}
readinessProbe:
exec:
command:
- sh
- /scripts/live-ready.sh
initialDelaySeconds: 5
periodSeconds: 5
{{- end}}
{{- if .Values.livenessProbe}}
livenessProbe:
exec:
command:
- sh
- /scripts/live-ready.sh
initialDelaySeconds: 5
periodSeconds: 5