Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subnets #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions roles/simulator/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,26 @@
mode: u+x
when: inventory_hostname in groups['ueransim_nodes']

- set_fact:
subnet: "{{ core.upf.access_subnet | regex_replace('[0-9]+/24', '0/24') }}"
when: inventory_hostname in groups['ueransim_nodes']

- name: configure static route for upf traffic on ueransim node
shell: |
ip route add {{ core.upf.ip_prefix }} via {{ core.amf.ip }}
ip route add {{ subnet }} via {{ core.amf.ip }}
become: true
when: (inventory_hostname in groups['ueransim_nodes']) and (inventory_hostname not in groups['master_nodes'])

### TODO: IPERF

# - name: copy iperf server deployment files to aether host
# template:
# src: "{{ ROOT_DIR }}/deps/ueransim/roles/simulator/template/iperf-server.yaml"
# src: "{{ ROOT_DIR }}/deps/ueransim/roles/simulator/templates/iperf-server.yaml"
# dest: /tmp/iperf-server.yaml
# become: true
# when: inventory_hostname in groups['master_nodes']

# - name: Create iperf-server pod in omec namespace
# - name: Create iperf-server pod in aether-5gc namespace
# kubernetes.core.k8s:
# kubeconfig: "{{ ansible_user_dir }}/.kube/config"
# state: present
Expand Down
2 changes: 1 addition & 1 deletion roles/simulator/tasks/start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
# - name: Get information about the pod
# kubernetes.core.k8s_info:
# kind: Pod
# namespace: omec
# namespace: aether-5gc
# name: iperf-server
# when: inventory_hostname in groups['master_nodes'][0]
# register: iperf_server_pod_info
Expand Down
8 changes: 6 additions & 2 deletions roles/simulator/tasks/uninstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
become: true
when: inventory_hostname in groups['ueransim_nodes']

- name: configure static route for upf traffic on ueransim node
- set_fact:
subnet: "{{ core.upf.access_subnet | regex_replace('[0-9]+/24', '0/24') }}"
when: inventory_hostname in groups['ueransim_nodes']

- name: remove static route for upf traffic on ueransim node
shell: |
ip route del {{ core.upf.ip_prefix }} via {{ core.amf.ip }}
ip route del {{ subnet }} via {{ core.amf.ip }}
when: (inventory_hostname in groups['ueransim_nodes']) and (inventory_hostname not in groups['master_nodes'])
become: true
ignore_errors: yes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Pod
metadata:
name: iperf-server
namespace: omec
namespace: aether-5gc
labels:
app: iperf-server
spec:
Expand All @@ -19,7 +19,7 @@ apiVersion: v1
kind: Service
metadata:
name: iperf-service
namespace: omec # Change this if your pod is in a different namespace
namespace: aether-5gc # Change if iperf is to run in a different namespace
spec:
selector:
app: iperf-server # Ensure this matches the labels of the Pod
Expand Down