클라우드 네이티브 라우터 컨트롤러 및 클라우드 네이티브 라우터 vRouter 관리
요약 이 항목에는 클라우드 네이티브 라우터 CLI에 액세스하는 방법, cRPD 및 vRouter 컨테이너에서 운영 명령을 실행하는 방법, 클라우드 네이티브 라우터를 제거하는 방법에 대한 지침이 포함되어 있습니다.
클라우드 네이티브 라우터 CLI 액세스
클라우드 네이티브 라우터의 CLI에 액세스하여 라우터의 상태를 모니터링하고 구성을 변경할 수 있습니다. 이 섹션에서는 cRPD 및 vRouter CLI에 액세스하고 show 명령의 몇 가지 예를 제공하는 데 사용하는 명령을 제공합니다.
클라우드 네이티브 라우터 컨트롤러 요소가 K8s(Kubernetes) 클러스터에서 Pod로 실행되므로 K8s 명령을 사용하여 CLI에 액세스해야 합니다. 아래에 예제가 있습니다. 주니퍼는 명령을 복사하여 서버에 붙여넣을 수 있도록 예제에 특정 디렉토리 경로를 제공하지 않습니다.
Access the Cloud-Native Router Controller (cRPD) CLI
In this example we list all of the K8s Pods running on the K8s host server. We use that output to identify the cRPD Pod that hosts the cloud-native router controller container. We then connect to the CLI of the cloud-native router controller and run some show commands.
List the K8s Pods Running in the Cluster
kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE contrail-deploy contrail-k8s-deployer-7b5dd699b9-nd7xf 1/1 Running 0 41m contrail contrail-vrouter-masters-dfxgm 3/3 Running 0 41m default delete-crpd-dirs--1-6jmxz 0/1 Completed 0 43m default delete-vrouter-dirs--1-645dt 0/1 Completed 0 43m kube-system calico-kube-controllers-57b9767bdb-5wbj6 1/1 Running 2 (92d ago) 129d kube-system calico-node-j4m5b 1/1 Running 2 (92d ago) 129d kube-system coredns-8474476ff8-fpw78 1/1 Running 2 (92d ago) 129d kube-system dns-autoscaler-7f76f4dd6-q5vdp 1/1 Running 2 (92d ago) 129d kube-system kube-apiserver-5a5s5-node2 1/1 Running 3 (92d ago) 129d kube-system kube-controller-manager-5a5s5-node2 1/1 Running 4 (92d ago) 129d kube-system kube-crpd-worker-ds-8tnf7 1/1 Running 0 41m kube-system kube-multus-ds-amd64-4zm5k 1/1 Running 2 (92d ago) 129d kube-system kube-proxy-l6xm8 1/1 Running 2 (92d ago) 129d kube-system kube-scheduler-5a5s5-node2 1/1 Running 4 (92d ago) 129d kube-system nodelocaldns-6kwg5 1/1 Running 2 (92d ago) 129d kube-system syslog-ng-54749b7b77-v24hq 1/1 Running 0 41m
The only Pod that has cRPD in its name is the kube-crpd-worker-ds-npbjq. Thus, this is the name of the Pod we will use to access the cRPD CLI.
Connect to the cRPD CLI
The kubectl command that allows access to the controller's CLI has the following form:
kubectl exec -n <namespace> -it <cRPD worker Pod name> -- bash
In practice, you substitute values from your system for the values contained between angle brackets (<>). For example:
kubectl exec -n kube-system -it kube-crpd-worker-ds-8tnf7 -- bash
The result of the above command should appear similar to:
===> Containerized Routing Protocols Daemon (CRPD) Copyright (C) 2020-2021, Juniper Networks, Inc. All rights reserved. <=== root@ix-jcnr-01:/#
At this point, you have connected to the shell of the cloud-native router. Just as with other Junos-based shells, you access the operational mode of the cloud-native router the same way as if you were connected to the console of a physical Junos OS device.
root@jcnr-01:/# cli
root@jcnr-01>
Example Show Commands
In the following examples, we remove the prompt, root@jcnr-01>, so you can copy and paste the commands into your system without editing them.
show interfaces terse
__crpd-brd1: flags=67<UP,BROADCAST,RUNNING> mtu 1500 inet6 fe80::205f:39ff:fe19:87b7 prefixlen 64 scopeid 0x20<link> ether 22:5f:39:19:87:b7 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 7 bytes 746 (746.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 cali502530ac57f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1480 inet6 fe80::ecee:eeff:feee:eeee prefixlen 64 scopeid 0x20<link> ether ee:ee:ee:ee:ee:ee txqueuelen 0 (Ethernet) RX packets 9530538 bytes 816771272 (816.7 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 11502794 bytes 11091296232 (11.0 GB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 caliae604977c78: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1480 inet6 fe80::ecee:eeff:feee:eeee prefixlen 64 scopeid 0x20<link> ether ee:ee:ee:ee:ee:ee txqueuelen 0 (Ethernet) RX packets 10120320 bytes 904273274 (904.2 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9242684 bytes 841165346 (841.1 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:b9:ad:64:ad txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.87.3.138 netmask 255.255.255.128 broadcast 10.87.3.255 inet6 fe80::3eec:efff:fe4e:145c prefixlen 64 scopeid 0x20<link> ether 3c:ec:ef:4e:14:5c txqueuelen 1000 (Ethernet) RX packets 10432410 bytes 10076907508 (10.0 GB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 3444445 bytes 3877176824 (3.8 GB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0xaae20000-aae3ffff eno2: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 3c:ec:ef:4e:14:5d txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0xaae00000-aae1ffff enp59s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 40:a6:b7:2a:86:78 txqueuelen 1000 (Ethernet) RX packets 25596 bytes 5412132 (5.4 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 660 (660.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp59s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 40:a6:b7:2a:86:79 txqueuelen 1000 (Ethernet) RX packets 554 bytes 116931 (116.9 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 7 bytes 770 (770.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp59s0f1v1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 72:e4:ae:81:4a:b3 txqueuelen 1000 (Ethernet) RX packets 7 bytes 2048 (2.0 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 612 bytes 107701 (107.7 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth0: flags=195<UP,BROADCAST,RUNNING,NOARP> mtu 1500 inet 169.254.93.210 netmask 255.255.255.255 broadcast 0.0.0.0 inet6 fe80::58b2:7fff:fea9:3adb prefixlen 64 scopeid 0x20<link> ether 5a:b2:7f:a9:3a:db txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1 bytes 70 (70.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 gre0: flags=193<UP,RUNNING,NOARP> mtu 1476 unspec 00-00-00-00-30-30-30-3A-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ip6tnl0: flags=193<UP,RUNNING,NOARP> mtu 1452 inet6 fe80::d4c4:b5ff:fede:df84 prefixlen 64 scopeid 0x20<link> unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 irb: flags=67<UP,BROADCAST,RUNNING> mtu 1500 inet6 fe80::f4a0:c8ff:fee6:a28c prefixlen 64 scopeid 0x20<link> ether f6:a0:c8:e6:a2:8c txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 4885871889 bytes 578917760800 (578.9 GB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4885871889 bytes 578917760800 (578.9 GB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lsi: flags=67<UP,BROADCAST,RUNNING> mtu 1500 inet6 fe80::4fd:d0ff:fe4e:943b prefixlen 64 scopeid 0x20<link> ether 06:fd:d0:4e:94:3b txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4 bytes 440 (440.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 sit0: flags=193<UP,RUNNING,NOARP> mtu 1480 inet6 ::127.0.0.1 prefixlen 96 scopeid 0x90<compat,host> inet6 ::172.17.0.1 prefixlen 96 scopeid 0x80<compat,global> inet6 ::169.254.93.210 prefixlen 96 scopeid 0x80<compat,global> inet6 ::10.87.3.138 prefixlen 96 scopeid 0x80<compat,global> sit txqueuelen 1000 (IPv6-in-IPv4) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 tunl0: flags=193<UP,RUNNING,NOARP> mtu 1480 inet 10.233.90.0 netmask 255.255.255.255 tunnel txqueuelen 1000 (IPIP Tunnel) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
show configuration routing-instances
vswitch { instance-type virtual-switch; bridge-domains { bd100 { vlan-id 100; } bd200 { vlan-id 200; } bd300 { vlan-id 300; } bd700 { vlan-id 700; interface enp59s0f1v0; } bd701 { vlan-id 701; } bd702 { vlan-id 702; } bd703 { vlan-id 703; } bd704 { vlan-id 704; } bd705 { vlan-id 705; } } interface bond0; }
Access the Cloud-Native Router vRouter CLI
In this example we list all of the K8s Pods running on the K8s host server. We use that output to identify the vRouter Pod that hosts the cloud-native router vrouter-agent container. We then connect to the CLI of the vRouter-agent and run a show command to list the available interfaces.
List the K8s Pods Running in the Cluster
kubectl get pods -n contrail
NAME READY STATUS RESTARTS AGE contrail-vrouter-masters-dfxgm 3/3 Running 0 79m
Connect to the Cloud-Native Router vRouter CLI
The kubectl command that allows access to the controller's CLI has the following form:
kubectl exec -n contrail -it <contrail-vrouter-masters-pod> -- bash
In practice, you substitute values from your system for the values contained between angle brackets (<>). For example:
kubectl exec -n contrail -it contrail-vrouter-masters-xnwwp -- bash
The output of this command should look similar to:
root@jcnr-01:/#
At this point, you have connected to the vRouter's CLI. You can run commands in the CLI to learn about the state of the vRouter. For example, the command shown below allows you to see which interfaces are present on the vRouter.
root@jcnr-01:/# vif --list
Vrouter Operation Mode: PureL2 Vrouter Interface Table Flags: P=Policy, X=Cross Connect, S=Service Chain, Mr=Receive Mirror Mt=Transmit Mirror, Tc=Transmit Checksum Offload, L3=Layer 3, L2=Layer 2 D=DHCP, Vp=Vhost Physical, Pr=Promiscuous, Vnt=Native Vlan Tagged Mnp=No MAC Proxy, Dpdk=DPDK PMD Interface, Rfl=Receive Filtering Offload, Mon=Interface is Monitored Uuf=Unknown Unicast Flood, Vof=VLAN insert/strip offload, Df=Drop New Flows, L=MAC Learning Enabled Proxy=MAC Requests Proxied Always, Er=Etree Root, Mn=Mirror without Vlan Tag, HbsL=HBS Left Intf HbsR=HBS Right Intf, Ig=Igmp Trap Enabled, Ml=MAC-IP Learning Enabled, Me=Multicast Enabled vif0/0 Socket: unix Type:Agent HWaddr:00:00:5e:00:01:00 Vrf:65535 Flags:L2 QOS:-1 Ref:3 RX queue errors to lcore 0 0 0 0 0 0 0 0 0 0 0 0 RX packets:0 bytes:0 errors:0 TX packets:11 bytes:4169 errors:0 Drops:0 vif0/1 PCI: 0000:00:00.0 (Speed 25000, Duplex 1) Type:Physical HWaddr:46:37:1f:de:df:bc Vrf:65535 Flags:L2Vof QOS:-1 Ref:8 RX queue errors to lcore 0 0 0 0 0 0 0 0 0 0 0 0 Fabric Interface: eth_bond_bond0 Status: UP Driver: net_bonding Slave Interface(0): 0000:3b:02.0 Status: UP Driver: net_iavf Slave Interface(1): 0000:3b:02.1 Status: UP Driver: net_iavf Vlan Mode: Trunk Vlan: 100 200 300 700-705 RX packets:0 bytes:0 errors:0 TX packets:378 bytes:81438 errors:0 Drops:0 vif0/2 PCI: 0000:3b:0a.0 (Speed 25000, Duplex 1) Type:Workload HWaddr:ba:69:c0:b7:1f:ba Vrf:0 Flags:L2Vof QOS:-1 Ref:7 RX queue errors to lcore 0 0 0 0 0 0 0 0 0 0 0 0 Fabric Interface: 0000:3b:0a.0 Status: UP Driver: net_iavf Vlan Mode: Access Vlan Id: 700 OVlan Id: 700 RX packets:378 bytes:81438 errors:2 TX packets:0 bytes:0 errors:0 Drops:391
주니퍼 클라우드 네이티브 라우터 제거
helm uninstall jcnr