ON THIS PAGE
User Pod Example - Virtio Trunk
SUMMARY
In this topic, we show you how to add a user Pod with a VLAN sub-interface to an instance of cloud-native router.
Overview
At a high level, the process of adding a user Pod to the cloud-native router requires that you ensure that a network attachment definition (NAD) exists and that you 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 CLI of the host server.
High-Level Steps
In this example we assume that this is the first user Pod that you are adding to your newly installed cloud-native router. Therefore, we will create a new NAD on the cluster 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
The first and last steps of this example procedure are performed on the CLI of the vRouter-agent. 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.
To make it easy to copy and paste commands from here to your system, we do not include paths or shell prompts from the host server in the command listings.
To start, we access the CLI of the contrail-vrouter-agent container in the contrail-vrouter-masters Pod.
In one terminal enter the command:
kubectl get pods -n contrail
The output should be a single line that looks like:
NAME READY STATUS RESTARTS AGE contrail-vrouter-masters-97v8z 3/3 Running 0 6h10m
This command gave 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 command:
kubectl exec -n contrail -it <contrail-vrouter-masters-hash> -c <container name>-- bash
The output should be two lines that looks like:
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 should also have changed from whatever it was when you
entered the command. On the system 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 CLI
of the vRouter-agent.
You can now move to the detailed steps section to complete the example.