From e62c778293a5e829f450ce24562466fa9d1fac28 Mon Sep 17 00:00:00 2001 From: Dasmat Hansda <164524276+Dasmat13@users.noreply.github.com> Date: Sat, 26 Sep 2026 15:30:27 +0530 Subject: [PATCH] fix: correct CiliumBGPNodeConfigOverride CRD wait condition and deprecate legacy BGP Peering Policy (#13366) * fix: correct CiliumBGPNodeConfigOverride CRD wait condition and deprecate legacy BGP Peering Policy - Fix copy-paste bug where cilium_bgp_advertisements was used instead of cilium_bgp_node_config_overrides when waiting for the CiliumBGPNodeConfigOverride CRD. This caused the CRD readiness check to be skipped when only node config overrides were configured. - Add deprecation notices across docs, sample inventory, and defaults to guide users away from the legacy v2alpha1 CiliumBGPPeeringPolicy toward the supported BGP v2 API variables. * fix(cilium): simplify BGP node override condition --- docs/CNI/cilium.md | 4 ++++ inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml | 4 +++- roles/network_plugin/cilium/defaults/main.yml | 2 ++ roles/network_plugin/cilium/tasks/apply.yml | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/CNI/cilium.md b/docs/CNI/cilium.md index 245a2282d..c3591fa4b 100644 --- a/docs/CNI/cilium.md +++ b/docs/CNI/cilium.md @@ -172,6 +172,10 @@ For further information, check [BGP Control Plane Resources documentation](https ### BGP Peering Policies (Legacy < v1.16) +> **Warning:** The `cilium_bgp_peering_policies` variable uses the deprecated `CiliumBGPPeeringPolicy` (`cilium.io/v2alpha1`) CRD. +> Starting with Cilium v1.16, this CRD is deprecated and generates warnings in Cilium logs. +> Migrate to the new BGP v2 API using `cilium_bgp_cluster_configs`, `cilium_bgp_peer_configs`, `cilium_bgp_advertisements`, and `cilium_bgp_node_config_overrides`. + Cilium's BGP Peering Policies can be configured with the `cilium_bgp_peering_policies` variable: ```yml diff --git a/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml b/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml index 700c9f598..b26cb6743 100644 --- a/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml +++ b/inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml @@ -334,7 +334,9 @@ cilium_l2announcements: false # - name: "peer-65000-tor2" # localAddress: fd00:11:0:2::2 -# -- Configure BGP Peers (Legacy v1.16+) +# -- Configure BGP Peers (Legacy < v1.16) +# Deprecated: cilium_bgp_peering_policies uses the v2alpha1 CiliumBGPPeeringPolicy CRD which is deprecated in Cilium v1.16+. +# Use the new bgpv2 API variables instead: cilium_bgp_cluster_configs, cilium_bgp_peer_configs, cilium_bgp_advertisements, and cilium_bgp_node_config_overrides. # cilium_bgp_peering_policies: # - name: "01-bgp-peering-policy" # spec: diff --git a/roles/network_plugin/cilium/defaults/main.yml b/roles/network_plugin/cilium/defaults/main.yml index 8496c8716..640e19882 100644 --- a/roles/network_plugin/cilium/defaults/main.yml +++ b/roles/network_plugin/cilium/defaults/main.yml @@ -305,6 +305,8 @@ cilium_bgp_advertisements: [] cilium_bgp_node_config_overrides: [] # -- Configure BGP Peers (Legacy < v1.16) +# Deprecated: cilium_bgp_peering_policies uses the v2alpha1 CiliumBGPPeeringPolicy CRD which is deprecated in Cilium v1.16+. +# Migrate to cilium_bgp_cluster_configs, cilium_bgp_peer_configs, cilium_bgp_advertisements, and cilium_bgp_node_config_overrides. cilium_bgp_peering_policies: [] # -- Whether to enable CNP status updates. diff --git a/roles/network_plugin/cilium/tasks/apply.yml b/roles/network_plugin/cilium/tasks/apply.yml index 546a0a492..4184100e5 100644 --- a/roles/network_plugin/cilium/tasks/apply.yml +++ b/roles/network_plugin/cilium/tasks/apply.yml @@ -212,7 +212,7 @@ failed_when: false when: - inventory_hostname == groups['kube_control_plane'][0] - - cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0) + - cilium_bgp_node_config_overrides != [] - name: Cilium | Create CiliumBGPNodeConfigOverride manifests template: