@@ -197,40 +197,38 @@ e2e-test:
197197
198198.PHONY : e2e-test-bgp
199199e2e-test-bgp :
200- KUBECONFIG=$(KUBECONFIG_PATH ) kubectl -n kube-system patch daemonset ccm-linode --patch ' \
201- spec:\
202- template:\
203- spec:\
204- containers:\
205- - name: ccm-linode\
206- args:\
207- - --leader-elect-resource-lock=leases\
208- - --v=3\
209- - --secure-port=10253\
210- - --webhook-secure-port=0\
211- - --enable-route-controller=true\
212- - --vpc-name=capl-cluster\
213- - --configure-cloud-routes=true\
214- - --cluster-cidr=10.0.0.0/8\
215- - --load-balancer-type=cilium-bgp\
216- - --bgp-node-selector=cilium-bgp-peering=true\
217- - --ip-holder-suffix=e2e-test
200+ # Add bgp peering label to non control plane nodes
201+ KUBECONFIG=$(KUBECONFIG_PATH ) kubectl label nodes $$(kubectl get nodes --no-headers |\
202+ grep -v control-plane | awk ' {print $$1}' ) cilium-bgp-peering=true --overwrite
203+
204+ # First patch: Add the necessary RBAC permissions
218205 KUBECONFIG=$(KUBECONFIG_PATH) kubectl patch clusterrole ccm-linode-clusterrole --type='json' \
219- -p='[{\
220- "op": "add",\
221- "path": "/rules/-",\
222- "value": {\
223- "apiGroups": ["cilium.io"],\
224- "resources": ["ciliumloadbalancerippools", "ciliumbgppeeringpolicies"],\
225- "verbs": ["get", "list", "watch", "create", "update", "patch", "delete"]\
226- }\
227- }]'
206+ -p='[{\
207+ "op": "add",\
208+ "path": "/rules/-",\
209+ "value": {\
210+ "apiGroups": ["cilium.io"],\
211+ "resources": ["ciliumloadbalancerippools", "ciliumbgppeeringpolicies"],\
212+ "verbs": ["get", "list", "watch", "create", "update", "patch", "delete"]\
213+ }\
214+ }]'
215+
216+ # Patch: Append new args to the existing ones
217+ KUBECONFIG=$(KUBECONFIG_PATH) kubectl patch daemonset ccm-linode -n kube-system --type='json' \
218+ -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--bgp-node-selector=cilium-bgp-peering=true"},\
219+ {"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--load-balancer-type=cilium-bgp"},\
220+ {"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--ip-holder-suffix=$(CLUSTER_NAME)"}]'
221+
222+ # Wait for rollout
223+ KUBECONFIG=$(KUBECONFIG_PATH) kubectl -n kube-system rollout status daemonset/ccm-linode --timeout=300s
224+
225+ # Run the tests
228226 CLUSTER_NAME=$(CLUSTER_NAME) \
229- MGMT_KUBECONFIG=$(MGMT_KUBECONFIG_PATH) \
230- KUBECONFIG=$(KUBECONFIG_PATH) \
231- REGION=$(LINODE_REGION) \
232- LINODE_TOKEN=$(LINODE_TOKEN) \
233- chainsaw test e2e/test /lb-cilium-bgp
227+ MGMT_KUBECONFIG=$(MGMT_KUBECONFIG_PATH) \
228+ KUBECONFIG=$(KUBECONFIG_PATH) \
229+ REGION=$(LINODE_REGION) \
230+ LINODE_TOKEN=$(LINODE_TOKEN) \
231+ chainsaw test e2e/lb-cilium-bgp
234232
235233# ####################################################################
236234# OS / ARCH
0 commit comments