Understanding Kube-OVN Controller: Pod IP Allocation and Event Handling
This article explains how the Kube-OVN controller manages pod IP and MAC allocation, processes pod add and delete events through a list‑watch mechanism, and details the worker workflow and key functions involved in networking for Kubernetes clusters.
Kube-OVN is a Kubernetes network project built on OVS/OVN that brings mature OpenStack networking features to Kubernetes, enhancing security, operability, manageability, and performance.
The series aims to walk readers through components such as kube-ovn-controller, pod IP address management, CNI plugin handling, pod security groups, and a unified Vagrant build and test environment.
Controller Process
When the controller starts, it initializes a listener for pod events and creates an event queue. Pod add, update, or delete events are enqueued and later processed by workers.
Pod Event List‑Watch
The controller watches pod events; on each event it extracts relevant information and places the pod data into the queue for further handling.
Worker Startup
Workers retrieve events from the queue and invoke specific handlers. For a pod add event, the handleAddPod function is called.
handleAddPod Processing
The function obtains the pod’s network attachments, creates an OVN port, assigns IP and MAC addresses, and records routing information. It uses helper functions such as getPodKubeovnNets and getPodAttachmentNet to gather network details from annotations like v1.multus-cni.io/default-network and k8s.v1.cni.cncf.io/networks .
Key Functions
getPodKubeovnNets retrieves all network configurations for a pod, while getPodAttachmentNet parses the two annotations to determine the default and additional networks.
The article concludes with a preview of the next topic, which will cover pod network interface management via the CNI plugin.
Cloud Native Technology Community
The Cloud Native Technology Community, part of the CNBPA Cloud Native Technology Practice Alliance, focuses on evangelizing cutting‑edge cloud‑native technologies and practical implementations. It shares in‑depth content, case studies, and event/meetup information on containers, Kubernetes, DevOps, Service Mesh, and other cloud‑native tech, along with updates from the CNBPA alliance.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.