Commit 43ab6388 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Hackfest 5:

- Updated redeploy-tfs script
- Updated CLab descriptor
- Updated README
parent 7fae0639
Loading
Loading
Loading
Loading
+90 −32
Original line number Diff line number Diff line
# Hackfest 5 - Control an Emulated DataPlane through TeraFlowSDN

## TeraFlowSDN Deployment

## Prepare your VM
```bash
cd ~/tfs-ctrl
source hackfest5/deploy_specs.sh
./deploy/all.sh
git checkout feat/hackfest5
git pull
```

# ContainerLab - hackfest5 cEOS - Commands

## Download and install ContainerLab

## ContainerLab Commands

### Download and install ContainerLab
```bash
sudo bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.59.0
```

## Download hackfest5 cEOS image and create Docker image
### 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
cd ~/tfs-ctrl/hackfest5/images/arista
docker import cEOS64-lab-4.32.2F.tar ceos:4.32.2F
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
### Deploy scenario
```bash
~/tfs-ctrl/hackfest5/clab-deploy.sh
```

## Inspect scenario
### Inspect scenario
```bash
~/tfs-ctrl/hackfest5/clab-inspect.sh
```

## Show scenario's topology
### Show scenario's topology
```bash
~/tfs-ctrl/hackfest5/clab-graph.sh
```

## Destroy scenario
### Destroy scenario
```bash
~/tfs-ctrl/hackfest5/clab-destroy.sh
```

## Access cEOS Bash
### Access cEOS CLI
```bash
docker exec -it clab-hackfest5-r1 bash
~/tfs-ctrl/hackfest5/clab-cli-r1.sh
```

## Access cEOS CLI
### Access DC CLI
```bash
docker exec -it clab-hackfest5-r1 Cli
docker exec -it clab-hackfest5-r2 Cli
~/tfs-ctrl/hackfest5/clab-cli-dc1.sh
```

## Configure ContainerLab clients
### Start pinging remote DC
```bash
docker exec -it clab-hackfest5-client1 bash
    ip address add 192.168.1.10/24 dev eth1
    ip route add 192.168.2.0/24 via 192.168.1.1
~/tfs-ctrl/hackfest5/clab-cli-dc1.sh
    ping 192.168.2.10
```



## TeraFlowSDN Commands

docker exec -it clab-hackfest5-client2 bash
    ip address add 192.168.2.10/24 dev eth1
    ip route add 192.168.1.0/24 via 192.168.2.1
    ping 192.168.1.10
### Re-Deploy TeraFlowSDN
```bash
~/tfs-ctrl/hackfest5/redeploy-tfs.sh
```

## Install gNMIc
### 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
### gNMI Capabilities request
```bash
gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin --insecure capabilities
```

## gNMI Get request
### 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
### 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
### 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/

@@ -95,13 +153,13 @@ gnmic --address clab-hackfest5-r1 --port 6030 --username admin --password admin
ssh admin@clab-hackfest5-r1
```

# Check configurations done:
### 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:
### 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]'
+2 −2
Original line number Diff line number Diff line
@@ -26,9 +26,9 @@ topology:
      kind: arista_ceos
      #image: ceos:4.30.4M
      #image: ceos:4.31.2F
      #image: ceos:4.31.5M
      image: ceos:4.31.5M
      #image: ceos:4.32.0F
      image: ceos:4.32.2F
      #image: ceos:4.32.2F
      #image: ceos:4.32.2.1F
    linux:
      kind: linux
+12 −0
Original line number Diff line number Diff line
@@ -15,8 +15,20 @@

source ~/tfs-ctrl/hackfest5/deploy_specs.sh

echo "Cleaning-up old NATS and Kafka deployments..."
helm3 uninstall --namespace ${NATS_NAMESPACE} ${NATS_NAMESPACE}
kubectl delete namespace ${NATS_NAMESPACE} --ignore-not-found
kubectl delete namespace ${KFK_NAMESPACE} --ignore-not-found
printf "\n"

echo "Deployting TeraFlowSDN..."
./deploy/all.sh
printf "\n"

echo "Waiting for Context to be subscribed to NATS..."
while ! kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server 2>&1 | grep -q 'Subscriber is Ready? True'; do
    printf "%c" "."
    sleep 1
done
kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server
printf "\n"