-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3edb6e3
Showing
67 changed files
with
2,149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# free5gc-k8s | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../free5gc | ||
|
||
patchesStrategicMerge: | ||
- slices/slice1/upf-deployment-patch.yaml | ||
- slices/slice1/smf-deployment-patch.yaml | ||
- slices/slice2/upf-deployment-patch.yaml | ||
- slices/slice2/smf-deployment-patch.yaml | ||
|
||
# configMapGenerator: | ||
# - name: smf-fluent-bit-config | ||
# files: | ||
# - slices/slice1/fluent-bit.conf | ||
# - slices/slice1/parsers.conf | ||
# - slices/slice1/filter.lua | ||
|
||
images: | ||
- name: ghcr.io/niloysh/free5gc-upf | ||
newTag: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- slice1 | ||
- slice2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function add_new_keys(tag, timestamp, record) | ||
if record["slice-session-info"] ~= nil then | ||
-- Add S-NSSAI key | ||
local sst = tostring(record["slice-session-info"]["Snssai"]["SST"]) | ||
local sd = tostring(record["slice-session-info"]["Snssai"]["SD"]) | ||
record["S-NSSAI"] = sst .. "@" .. sd | ||
|
||
-- Add F-SEID key | ||
local remote_seid = tostring(record["slice-session-info"]["PFCPSession"]["Fseid"]["RemoteSEID"]) | ||
local ip_address = record["slice-session-info"]["PFCPSession"]["Fseid"]["IPAddress"] | ||
record["F-SEID"] = remote_seid .. "@" .. ip_address | ||
end | ||
return 1, timestamp, record | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[SERVICE] | ||
Flush 1 | ||
Log_Level debug | ||
Parsers_File parsers.conf | ||
|
||
[INPUT] | ||
Name tail | ||
Parser simple-parser | ||
Path /var/log/smf-slice-info.log | ||
DB /var/log/tail.db | ||
|
||
[FILTER] | ||
Name modify | ||
Match * | ||
Add user n6saha | ||
|
||
[FILTER] | ||
Name lua | ||
Match * | ||
script filter.lua | ||
call add_new_keys | ||
|
||
|
||
[OUTPUT] | ||
Name stdout | ||
Match * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[PARSER] | ||
Name simple-parser | ||
Format json | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%SZ | ||
Time_Keep On |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: free5gc-smf | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: smf | ||
volumeMounts: | ||
- name: varlog | ||
mountPath: /var/log/ | ||
|
||
- image: busybox | ||
name: smf-logs | ||
args: [/bin/sh, -c, 'while ! tail -f /var/log/smf-slice-info.log 2>/dev/null; do sleep 1 ; done'] | ||
volumeMounts: | ||
- mountPath: /var/log/ | ||
name: varlog | ||
|
||
# - image: fluent/fluent-bit:1.9 | ||
# name: smf-stats | ||
# imagePullPolicy: Always | ||
# env: | ||
# - name: FLUENT_UID | ||
# value: "0" | ||
# volumeMounts: | ||
# - name: config-volume | ||
# mountPath: /fluent-bit/etc/ | ||
# - name: varlog | ||
# mountPath: /var/log/ | ||
|
||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "200m" | ||
limits: | ||
memory: "512Mi" | ||
cpu: "500m" | ||
volumes: | ||
# - name: config-volume | ||
# configMap: | ||
# name: smf-fluent-bit-config | ||
# items: | ||
# - key: fluent-bit.conf | ||
# path: fluent-bit.conf | ||
# - key: parsers.conf | ||
# path: parsers.conf | ||
# - key: filter.lua | ||
# path: filter.lua | ||
- name: varlog | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: free5gc-upf | ||
spec: | ||
template: | ||
spec: | ||
shareProcessNamespace: true | ||
containers: | ||
- name: upf-stats | ||
image: ghcr.io/niloysh/upf-exporter:v3.0.1 | ||
imagePullPolicy: Always | ||
command: [ "/bin/bash", "-c", "--" ] | ||
args: | ||
- | | ||
if [ "$DEBUG_MODE" = "true" ]; then | ||
while true; do sleep 30; done; | ||
else | ||
/app/upf-exporter.py | ||
fi | ||
env: | ||
- name: SLEEP_INTERVAL | ||
value: "5" | ||
- name: SERVER_PORT | ||
value: "9000" | ||
- name: GTP_IFNAME | ||
value: "upf1gtp" | ||
- name: DEBUG_MODE | ||
value: "false" | ||
securityContext: | ||
capabilities: | ||
add: ["NET_ADMIN"] | ||
ports: | ||
- name: metrics | ||
containerPort: 9000 | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "200m" | ||
limits: | ||
memory: "512Mi" | ||
cpu: "500m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: free5gc-smf2 | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: smf | ||
volumeMounts: | ||
- name: varlog | ||
mountPath: /var/log/ | ||
|
||
- image: busybox | ||
name: smf-logs | ||
args: [/bin/sh, -c, 'while ! tail -f /var/log/smf-slice-info.log 2>/dev/null; do sleep 1 ; done'] | ||
volumeMounts: | ||
- mountPath: /var/log/ | ||
name: varlog | ||
|
||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "200m" | ||
limits: | ||
memory: "512Mi" | ||
cpu: "500m" | ||
volumes: | ||
- name: varlog | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: free5gc-upf2 | ||
spec: | ||
template: | ||
spec: | ||
shareProcessNamespace: true | ||
containers: | ||
- name: upf-stats | ||
image: ghcr.io/niloysh/upf-exporter:v3.0.1 | ||
imagePullPolicy: Always | ||
command: [ "/bin/bash", "-c", "--" ] | ||
args: | ||
- | | ||
if [ "$DEBUG_MODE" = "true" ]; then | ||
while true; do sleep 30; done; | ||
else | ||
/app/upf-exporter.py | ||
fi | ||
env: | ||
- name: SLEEP_INTERVAL | ||
value: "5" | ||
- name: SERVER_PORT | ||
value: "9000" | ||
- name: GTP_IFNAME | ||
value: "upf2gtp" | ||
- name: DEBUG_MODE | ||
value: "false" | ||
securityContext: | ||
capabilities: | ||
add: ["NET_ADMIN"] | ||
ports: | ||
- name: metrics | ||
containerPort: 9000 | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "200m" | ||
limits: | ||
memory: "512Mi" | ||
cpu: "500m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resources: | ||
- webui-configmap.yaml | ||
- webui-deployment.yaml | ||
- webui-service.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: webui-configmap | ||
labels: | ||
app: free5gc | ||
data: | ||
webuicfg.yaml: | | ||
info: | ||
version: 1.0.0 | ||
description: Docker-WebUI initial local configuration | ||
configuration: | ||
mongodb: | ||
name: free5gc | ||
url: mongodb://mongodb:27017 | ||
# the kind of log output | ||
# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic | ||
# ReportCaller: enable the caller report or not, value: true or false | ||
logger: | ||
WEBUI: | ||
debugLevel: info | ||
ReportCaller: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: free5gc-webui | ||
labels: | ||
app: free5gc | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: free5gc | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: free5gc | ||
spec: | ||
initContainers: | ||
- name: wait-mongo | ||
image: busybox:1.32.0 | ||
env: | ||
- name: DEPENDENCIES | ||
value: mongodb:27017 | ||
command: ["sh", "-c", "until nc -z $DEPENDENCIES; do echo waiting for the MongoDB; sleep 2; done;"] | ||
containers: | ||
- image: ghcr.io/niloysh/free5gc-aio:v3.2.0 | ||
name: webui | ||
ports: | ||
- containerPort: 5000 | ||
command: ["./webui"] | ||
args: ["--config", "config/webuicfg.yaml"] | ||
env: | ||
- name: GIN_MODE | ||
value: release | ||
volumeMounts: | ||
- mountPath: /free5gc/config/ | ||
name: webui-volume | ||
readinessProbe: | ||
initialDelaySeconds: 0 | ||
periodSeconds: 1 | ||
timeoutSeconds: 1 | ||
failureThreshold: 40 | ||
successThreshold: 1 | ||
httpGet: | ||
port: 5000 | ||
livenessProbe: | ||
initialDelaySeconds: 120 | ||
periodSeconds: 10 | ||
timeoutSeconds: 10 | ||
failureThreshold: 3 | ||
successThreshold: 1 | ||
httpGet: | ||
port: 5000 | ||
resources: | ||
requests: | ||
memory: "512Mi" | ||
cpu: "500m" | ||
limits: | ||
memory: "1024Mi" | ||
cpu: "1000m" | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
volumes: | ||
- name: webui-volume | ||
projected: | ||
sources: | ||
- configMap: | ||
name: webui-configmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: webui-service | ||
labels: | ||
app: free5gc | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 5000 | ||
nodePort: 30505 | ||
selector: | ||
app: free5gc |
Oops, something went wrong.