Access cRPD CLI
You can access the command-line interface (CLI) of the cloud-native router controller by accessing the shell of the running cRPD container.
The commands below are provided as an example. The cRPD pod name must be replaced from your environment. The command outputs may differ based on your environment.
View the running pods 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 jcnr kube-crpd-worker-ds-8tnf7 1/1 Running 0 41m jcnr syslog-ng-54749b7b77-v24hq 1/1 Running 0 41m 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-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
Copy the name of the cRPD pod—kube-crpd-worker-ds-8tnf7
in this example
output . You will use the pod name to connect to the running container's shell.
Connect to the cRPD CLI
Issue the kubectl exec
command to access the running container's shell:
kubectl exec -n <namespace> -it <pod name> --container <container name> -- bash
where <namespace> identifies the namespace in which the pod is running, <pod name> specificies the name of the pod and the <container name> specifies the name of the container (to be specified if the pod has more than one container).
The cRPD pod has only one running container. Here is an example command:
Defaulted container "kube-crpd-worker" out of: kube-crpd-worker, jcnr-crpd-config (init), install-cni (init) ===> Containerized Routing Protocols Daemon (CRPD) Copyright (C) 2020-2022, Juniper Networks, Inc. All rights reserved. <=== root@jcnr-01:/#
At this point, you have connected to the shell of the cRPD. 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-cni>