Essential OC Commands for OpenShift OVN-Kubernetes Troubleshooting

If you’re interviewing for an OpenShift Architect/SRE role, knowing the oc commands for OVN-Kubernetes is extremely valuable. Below are the commands I would expect a senior OpenShift engineer to know.


1. Verify the Network Operator

oc get clusteroperator network

Healthy output:

NAME VERSION AVAILABLE PROGRESSING DEGRADED
network 4.18.10 True False False

Detailed status:

oc describe clusteroperator network

2. Verify Network Operator Pods

oc get pods -n openshift-network-operator

Example:

network-operator-xxxxx Running

3. Check OVN Pods

oc get pods -n openshift-ovn-kubernetes

Typical output:

ovnkube-master
ovnkube-node
ovnkube-control-plane
ovnkube-db

4. Show OVN Pods on Each Node

oc get pods -n openshift-ovn-kubernetes -o wide

This confirms every worker has an ovnkube-node pod.


5. Check OVN DaemonSet

oc get daemonset -n openshift-ovn-kubernetes

Example:

ovnkube-node

6. Check OVN Deployment

oc get deployment -n openshift-ovn-kubernetes

7. View OVN Logs

Node agent:

oc logs -n openshift-ovn-kubernetes <ovnkube-node-pod>

Master:

oc logs -n openshift-ovn-kubernetes <ovnkube-master-pod>

Previous container logs:

oc logs --previous

8. Describe an OVN Pod

oc describe pod <ovnkube-node-pod> \
-n openshift-ovn-kubernetes

Useful for:

  • Restarts
  • Readiness
  • Events
  • Image versions

9. Check Node Network Status

oc get node

Detailed:

oc describe node worker-1

Look for:

NetworkUnavailable=False
Ready=True

10. Verify Pod IP Addresses

oc get pods -A -o wide

Example:

NAMESPACE
POD
IP
NODE

Confirms OVN allocated IPs correctly.


11. Check Cluster Network

oc get network.config cluster -o yaml

Example:

clusterNetwork:
- cidr: 10.128.0.0/14

12. View Network Operator Configuration

oc get networks.operator.openshift.io cluster -o yaml

Shows:

  • MTU
  • Geneve
  • Service CIDR
  • Cluster CIDR

13. Check Node MTU

Debug into a node:

oc debug node/<node-name>

Then:

chroot /host

Check:

ip link

or

ip addr

14. Check Geneve Interface

ip link | grep genev

Usually:

genev_sys_6081

15. Check Routing Table

ip route

16. Check OVS Bridges

ovs-vsctl show

Shows:

br-int
br-ex

17. Show OVS Interfaces

ovs-vsctl list interface

18. Show Open vSwitch Ports

ovs-vsctl show

or

ovs-ofctl show br-int

19. Verify Geneve Tunnel

ovs-vsctl show

Look for:

type=geneve

20. Verify Encapsulation

ovn-sbctl list encap

Should display:

geneve

21. Check OVN Northbound DB

ovn-nbctl show

Displays:

  • Logical switches
  • Routers
  • ACLs

22. Check Southbound Database

ovn-sbctl show

Displays:

  • Chassis
  • Encapsulation
  • Tunnel information

23. Verify Chassis Registration

ovn-sbctl list chassis

Every worker node should appear.


24. Check Pod Connectivity

oc exec -it <pod> -- ping <other-pod-ip>

25. DNS Test

oc exec -it <pod> -- nslookup kubernetes.default

26. Test Service

oc exec <pod> -- curl http://service-name

27. Check Network Policies

oc get networkpolicy -A

Describe one:

oc describe networkpolicy <policy>

28. Check Egress IP

oc get egressip -A

29. Check Egress Firewall

oc get egressfirewall -A

30. Observe Events

oc get events -A --sort-by=.metadata.creationTimestamp

31. Debug a Node

oc debug node/<node>

Then:

chroot /host

Useful commands:

journalctl -u ovnkube-node
journalctl -u ovs-vswitchd
journalctl -u ovsdb-server
ip route
ip addr
ovs-vsctl show

32. Collect Network Must-Gather

oc adm must-gather

Network-focused:

oc adm must-gather \
--image=registry.redhat.io/openshift4/network-tools-rhel8

Common Interview Scenario

Question: Pods on different worker nodes cannot communicate. How do you troubleshoot?

A structured approach is:

  1. Verify node health:oc get nodes
  2. Check OVN components:oc get pods -n openshift-ovn-kubernetes
  3. Review logs:oc logs -n openshift-ovn-kubernetes <ovnkube-node-pod>
  4. Test pod-to-pod connectivity:oc exec <pod> -- ping <remote-pod-ip>
  5. Inspect Geneve tunnels:ovs-vsctl show
  6. Confirm all chassis are registered:ovn-sbctl list chassis
  7. Verify there are no blocking NetworkPolicy, EgressIP, or EgressFirewall resources.
  8. If the issue persists, gather diagnostics with:oc adm must-gather

These commands cover the majority of day-to-day OVN-Kubernetes troubleshooting tasks in OpenShift and are commonly discussed in senior platform engineering and architect interviews.

Leave a Reply