How kubeovn/kube-ovn works
Main System Components
• Controller & CRD Management:
– Represent the central Kube-OVN controller (found in cmd/controller and pkg/controller). This component watches changes to K8s Custom Resources (CRDs under pkg/apis/kubeovn) and adjusts network configuration accordingly.
• CNI Plugin/Node Agent:
– Show the CNI components (located under cmd/cni and pkg/daemon), which run on worker nodes, handle pod network setups, manage IPAM, update network namespaces, and interact with OVN/OVS.
• OVN Integration and Datapath Management:
• Webhook and External Interfaces:
– Include the webhook service (cmd/webhook and pkg/webhook) that helps manage admission control and network policies.
• Monitoring and Troubleshooting:
– Note the support for Prometheus and Grafana (as described in the README and found in the “dist/monitoring” directory). This part of the system exports metrics for network quality, connectivity, and performance.
• Deployment & Installation:
– Incorporate the Helm chart components (in the charts/kube-ovn directory), which are used to deploy these various components on a Kubernetes cluster.
Relationships and Data Flows
• Controller to the node-level daemons (the CNI server, gateway/speaker, and OVN monitoring components) to demonstrate that it orchestrates network state changes across the cluster.
• Interactions between the various node-level components (CNI plugin, daemon processes, and OVN agents) indicating that they work collectively to establish connections, manage IPAM allocations, and update OVS flows.
• If desired, include external components (like a BGP router, physical underlay network, or cloud provider resources) to capture integration points that support external connectivity.
Architectural Patterns and Technologies
• Modular Microservices: Each executable (controller, daemon, cni, webhook, pinger, etc.) is deployed independently, allowing scalability and fault isolation.
• Client-Server and Reconciliation Pattern: The controller watches CRDs using informers (client/informers) and triggers reconciliation loops to enforce the desired network state.
• Distributed and Scalable Design: Emphasize that key functions (like ovn scheduler, gateway functions, and monitoring) are distributed across all nodes—this avoids a single point of failure.
• Infrastructure as Code: The existence of Helm charts and extensive configuration files points to an architecture that is deployed and configured in a declarative fashion.
• Cross-Platform Support: Note the distinctions in the source code for Linux and Windows (files with “_windows.go”), which underline the support for mixed OS clusters, as well as ARM and x86 images in the “dist/images” directory.