Loading deploy/nats.sh +1 −2 Original line number Diff line number Diff line Loading @@ -69,8 +69,7 @@ function nats_deploy_single() { echo ">>> NATS is present; skipping step." else echo ">>> Deploy NATS" helm3 install ${NATS_NAMESPACE} nats/nats --namespace ${NATS_NAMESPACE} --set nats.image=nats:2.9-alpine --set config.cluster.enabled=true --set config.cluster.tls.enabled=true helm3 install ${NATS_NAMESPACE} nats/nats --namespace ${NATS_NAMESPACE} --set nats.image=nats:2.9-alpine echo ">>> Waiting NATS statefulset to be created..." while ! kubectl get --namespace ${NATS_NAMESPACE} statefulset/${NATS_NAMESPACE} &> /dev/null; do Loading deploy/tfs.sh +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ kubectl create secret generic crdb-data --namespace ${TFS_K8S_NAMESPACE} --type= --from-literal=CRDB_SSLMODE=require printf "\n" echo ">>> Create Secret with Apache Kakfa..." echo ">>> Create Secret with Apache Kafka..." KFK_SERVER_PORT=$(kubectl --namespace ${KFK_NAMESPACE} get service kafka-service -o 'jsonpath={.spec.ports[0].port}') kubectl create secret generic kfk-kpi-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ --from-literal=KFK_NAMESPACE=${KFK_NAMESPACE} \ Loading hackfest5/.gitignore 0 → 100644 +4 −0 Original line number Diff line number Diff line clab-*/ *.clab.yml.bak *.tar *.tar.gz hackfest5/README.md 0 → 100644 +187 −0 Original line number Diff line number Diff line # Hackfest 5 - Control an Emulated DataPlane through TeraFlowSDN ## Prepare your VM ```bash cd ~/tfs-ctrl git checkout feat/hackfest5 git pull ``` ## ContainerLab Commands ### Download and install ContainerLab ```bash sudo bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.59.0 ``` ### Check available images in Docker ```bash docker images | grep -E "ceos|multitool" ``` ### Download hackfest5 cEOS image and create Docker image [already done] - Note: Image to be downloaded for free from [Arista](https://www.arista.com/en/login) website. ```bash docker import ~/tfs-ctrl/hackfest5/images/arista/cEOS64-lab-4.31.5M.tar ceos:4.31.5M docker import ~/tfs-ctrl/hackfest5/images/arista/cEOS64-lab-4.32.2F.tar ceos:4.32.2F ``` ### Deploy scenario ```bash ~/tfs-ctrl/hackfest5/clab-deploy.sh ``` ### Inspect scenario ```bash ~/tfs-ctrl/hackfest5/clab-inspect.sh ``` ### Show scenario's topology ```bash ~/tfs-ctrl/hackfest5/clab-graph.sh ``` ### Destroy scenario ```bash ~/tfs-ctrl/hackfest5/clab-destroy.sh ``` ### Access cEOS CLI ```bash ~/tfs-ctrl/hackfest5/clab-cli-r1.sh ``` ### Access DC CLI ```bash ~/tfs-ctrl/hackfest5/clab-cli-dc1.sh ``` ### Start pinging remote DC ```bash ~/tfs-ctrl/hackfest5/clab-cli-dc1.sh ping 192.168.2.10 ``` ## TeraFlowSDN Commands ### Check status of MicroK8s ```bash microk8s.status --wait-ready ``` ### Start MicroK8s ```bash microk8s.start ``` ### Periodically report status of MicroK8s every second ```bash watch -n 1 microk8s.status --wait-ready ``` ### Periodically report status of workload in MicroK8s every second ```bash watch -n 1 kubectl get all --all-namespaces ``` ### Re-Deploy TeraFlowSDN ```bash ~/tfs-ctrl/hackfest5/redeploy-tfs.sh ``` ### Show TeraFlowSDN Deployment status ```bash source ~/tfs-ctrl/hackfest5/deploy_specs.sh ./deploy/show.sh ``` ### Show log of a TeraFlowSDN component ```bash source ~/tfs-ctrl/hackfest5/deploy_specs.sh ~/tfs-ctrl/scripts/show_logs_device.sh ``` ## L3VPN Commands ### Create a new IETF L3VPN through TeraFlowSDN NBI ```bash cd ~/tfs-ctrl/hackfest5/data curl -X POST \ --header "Content-Type: application/json" \ --data @ietf-l3vpn-service.json \ --user "admin:admin" \ http://127.0.0.1/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services ``` ### Get UUID of a IETF L3VPN through TeraFlowSDN NBI ```bash curl --user "admin:admin" \ http://127.0.0.1/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service=ietf-l3vpn-svc/ ``` ### Delete a IETF L3VPN through TeraFlowSDN NBI ```bash curl -X DELETE --user "admin:admin" \ http://127.0.0.1/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service=ietf-l3vpn-svc/ ``` ### Start pinging remote DC ```bash ~/tfs-ctrl/hackfest5/clab-cli-dc1.sh ping 192.168.2.10 ``` ## gNMIc Commands ### Install gNMIc ```bash sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)" ``` ### gNMI Capabilities request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure capabilities ``` ### gNMI Get request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path / > r1.json gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path /interfaces/interface > r1-ifaces.json ``` ### gNMI Set request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --update-path /system/config/hostname --update-value "my-r1" gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path /system/config/hostname ``` ### Subscribe request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf subscribe --path /interfaces/interface[name=Management0]/state/ # In another terminal, you can generate traffic opening SSH connection ssh admin@clab-hackfest5-r1 ``` ### Check configurations done: ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path '/network-instances' > r1-nis.json gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path '/interfaces' > r1-ifs.json ``` ### Delete elements: ```bash --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/network-instances/network-instance[name=b19229e8]' --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=0]' --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/interfaces/interface[name=ethernet-1/2]/subinterfaces/subinterface[index=0]' ``` hackfest5/clab-cli-dc1.sh 0 → 100755 +16 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. docker exec -it clab-hackfest5-dc1 bash Loading
deploy/nats.sh +1 −2 Original line number Diff line number Diff line Loading @@ -69,8 +69,7 @@ function nats_deploy_single() { echo ">>> NATS is present; skipping step." else echo ">>> Deploy NATS" helm3 install ${NATS_NAMESPACE} nats/nats --namespace ${NATS_NAMESPACE} --set nats.image=nats:2.9-alpine --set config.cluster.enabled=true --set config.cluster.tls.enabled=true helm3 install ${NATS_NAMESPACE} nats/nats --namespace ${NATS_NAMESPACE} --set nats.image=nats:2.9-alpine echo ">>> Waiting NATS statefulset to be created..." while ! kubectl get --namespace ${NATS_NAMESPACE} statefulset/${NATS_NAMESPACE} &> /dev/null; do Loading
deploy/tfs.sh +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ kubectl create secret generic crdb-data --namespace ${TFS_K8S_NAMESPACE} --type= --from-literal=CRDB_SSLMODE=require printf "\n" echo ">>> Create Secret with Apache Kakfa..." echo ">>> Create Secret with Apache Kafka..." KFK_SERVER_PORT=$(kubectl --namespace ${KFK_NAMESPACE} get service kafka-service -o 'jsonpath={.spec.ports[0].port}') kubectl create secret generic kfk-kpi-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ --from-literal=KFK_NAMESPACE=${KFK_NAMESPACE} \ Loading
hackfest5/.gitignore 0 → 100644 +4 −0 Original line number Diff line number Diff line clab-*/ *.clab.yml.bak *.tar *.tar.gz
hackfest5/README.md 0 → 100644 +187 −0 Original line number Diff line number Diff line # Hackfest 5 - Control an Emulated DataPlane through TeraFlowSDN ## Prepare your VM ```bash cd ~/tfs-ctrl git checkout feat/hackfest5 git pull ``` ## ContainerLab Commands ### Download and install ContainerLab ```bash sudo bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.59.0 ``` ### Check available images in Docker ```bash docker images | grep -E "ceos|multitool" ``` ### Download hackfest5 cEOS image and create Docker image [already done] - Note: Image to be downloaded for free from [Arista](https://www.arista.com/en/login) website. ```bash docker import ~/tfs-ctrl/hackfest5/images/arista/cEOS64-lab-4.31.5M.tar ceos:4.31.5M docker import ~/tfs-ctrl/hackfest5/images/arista/cEOS64-lab-4.32.2F.tar ceos:4.32.2F ``` ### Deploy scenario ```bash ~/tfs-ctrl/hackfest5/clab-deploy.sh ``` ### Inspect scenario ```bash ~/tfs-ctrl/hackfest5/clab-inspect.sh ``` ### Show scenario's topology ```bash ~/tfs-ctrl/hackfest5/clab-graph.sh ``` ### Destroy scenario ```bash ~/tfs-ctrl/hackfest5/clab-destroy.sh ``` ### Access cEOS CLI ```bash ~/tfs-ctrl/hackfest5/clab-cli-r1.sh ``` ### Access DC CLI ```bash ~/tfs-ctrl/hackfest5/clab-cli-dc1.sh ``` ### Start pinging remote DC ```bash ~/tfs-ctrl/hackfest5/clab-cli-dc1.sh ping 192.168.2.10 ``` ## TeraFlowSDN Commands ### Check status of MicroK8s ```bash microk8s.status --wait-ready ``` ### Start MicroK8s ```bash microk8s.start ``` ### Periodically report status of MicroK8s every second ```bash watch -n 1 microk8s.status --wait-ready ``` ### Periodically report status of workload in MicroK8s every second ```bash watch -n 1 kubectl get all --all-namespaces ``` ### Re-Deploy TeraFlowSDN ```bash ~/tfs-ctrl/hackfest5/redeploy-tfs.sh ``` ### Show TeraFlowSDN Deployment status ```bash source ~/tfs-ctrl/hackfest5/deploy_specs.sh ./deploy/show.sh ``` ### Show log of a TeraFlowSDN component ```bash source ~/tfs-ctrl/hackfest5/deploy_specs.sh ~/tfs-ctrl/scripts/show_logs_device.sh ``` ## L3VPN Commands ### Create a new IETF L3VPN through TeraFlowSDN NBI ```bash cd ~/tfs-ctrl/hackfest5/data curl -X POST \ --header "Content-Type: application/json" \ --data @ietf-l3vpn-service.json \ --user "admin:admin" \ http://127.0.0.1/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services ``` ### Get UUID of a IETF L3VPN through TeraFlowSDN NBI ```bash curl --user "admin:admin" \ http://127.0.0.1/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service=ietf-l3vpn-svc/ ``` ### Delete a IETF L3VPN through TeraFlowSDN NBI ```bash curl -X DELETE --user "admin:admin" \ http://127.0.0.1/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service=ietf-l3vpn-svc/ ``` ### Start pinging remote DC ```bash ~/tfs-ctrl/hackfest5/clab-cli-dc1.sh ping 192.168.2.10 ``` ## gNMIc Commands ### Install gNMIc ```bash sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)" ``` ### gNMI Capabilities request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure capabilities ``` ### gNMI Get request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path / > r1.json gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path /interfaces/interface > r1-ifaces.json ``` ### gNMI Set request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --update-path /system/config/hostname --update-value "my-r1" gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path /system/config/hostname ``` ### Subscribe request ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf subscribe --path /interfaces/interface[name=Management0]/state/ # In another terminal, you can generate traffic opening SSH connection ssh admin@clab-hackfest5-r1 ``` ### Check configurations done: ```bash gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path '/network-instances' > r1-nis.json gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path '/interfaces' > r1-ifs.json ``` ### Delete elements: ```bash --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/network-instances/network-instance[name=b19229e8]' --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=0]' --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/interfaces/interface[name=ethernet-1/2]/subinterfaces/subinterface[index=0]' ```
hackfest5/clab-cli-dc1.sh 0 → 100755 +16 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. docker exec -it clab-hackfest5-dc1 bash