ON THIS PAGE
L2 - Add User Pod with virtio
Trunk Ports to a Cloud-Native Router
Instance
SUMMARY Read this topic to learn how to add a user pod with a VLAN sub-interface to an instance of the cloud-native router.
Overview
To add a user pod to the cloud-native router, your high-level tasks are:
-
Apply a network attachment definition (NAD) to your cluster.
-
Apply a pod YAML file to your cloud-native router cluster.
Throughout this example, we use the kubectl
command with various
options. You must run this command on the host-server CLI.
High-Level Steps
In this example, we assume that you are adding the first user pod to your newly installed cloud-native router. Therefore, we provide the steps to create a new NAD and then add the new user pod.
Below is a list of the individual steps we take in this example. Each step in the list is a link to the detailed description of the step.
Before You Begin
Access the vRouter-Agent CLI
You perform the first and last steps of this example procedure on the
vRouter-agent CLI. We recommend that you open two SSH (terminal) sessions to the
host server. You can use one session to run the CLI commands on the vRouter
agent and the other session to run the kubectl
commands that
deploy the NAD and the pod on the cluster.
We have not included paths or shell prompts from the host server in the command listings. Therefore you can easily copy commands from here to your system.
Access the CLI of the contrail-vrouter-agent container in the contrail-vrouter-masters pod.
In one terminal enter the following command:
kubectl get pods -n contrail
You will see a single line of output that looks like:
NAME READY STATUS RESTARTS AGE contrail-vrouter-masters-97v8z 3/3 Running 0 6h10m
This command gives us the name and specific instance hash of the vRouter Pod,
contrail-vrouter-masters-97v8z
. We use this name in the
next command to access the vRouter CLI. The name of your vRouter pod will have a
different hash at the end. Use the pod name from your system in place of
contrail-vrouter-masters-hash
in the
command below.
Enter the following command:
kubectl exec -n contrail -it <contrail-vrouter-masters-hash> -c <container name>-- bash
You will see the following two-line output:
Defaulted container "contrail-vrouter-agent" out of: contrail-vrouter-agent, contrail-vrouter-agent-dpdk, contrail-vrouter-telemetry-exporter, contrail-init (init), contrail-vrouter-kernel-init-dpdk (init) root@jcnr1:/#
Note that the shell prompt has changed from what it was when you entered the
command. On the system we used to create this example, the prompt changed from
[root@jcnr1 ~]#
to root@jcnr1:/#
. This
change in prompt indicates that you have successfully connected to the
vRouter-agent CLI.
You can now see the following detailed steps to complete the example.