Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
komer3 committed Jan 10, 2025
1 parent fa28e56 commit 6190572
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,41 @@ e2e-test-bgp:
awk '{print $$1}' | xargs -I {} env KUBECONFIG=$(KUBECONFIG_PATH) kubectl label nodes {} cilium-bgp-peering=true --overwrite

# First patch: Add the necessary RBAC permissions
KUBECONFIG=$(KUBECONFIG_PATH) kubectl patch clusterrole ccm-linode-clusterrole --type='json'\
-p='[{"op": "add", "path": "/rules/-", "value": {"apiGroups": ["cilium.io"], "resources": ["ciliumloadbalancerippools", "ciliumbgppeeringpolicies"], "verbs": ["get", "list", "watch", "create", "update", "patch", "delete"]}}]'

KUBECONFIG=$(KUBECONFIG_PATH) kubectl patch clusterrole ccm-linode-clusterrole \
--type='json' \
-p='[\
{\
"op": "add",\
"path": "/rules/-",\
"value": {\
"apiGroups": ["cilium.io"],\
"resources": ["ciliumloadbalancerippools", "ciliumbgppeeringpolicies"],\
"verbs": ["get", "list", "watch", "create", "update", "patch", "delete"]\
}\
}\
]'

# Patch: Append new args to the existing ones
KUBECONFIG=$(KUBECONFIG_PATH) kubectl patch daemonset ccm-linode -n kube-system --type='json' \
-p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--bgp-node-selector=cilium-bgp-peering=true"},\
{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--load-balancer-type=cilium-bgp"},\
{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--ip-holder-suffix=$(CLUSTER_NAME)"}]'

KUBECONFIG=$(KUBECONFIG_PATH) kubectl patch daemonset ccm-linode -n kube-system \
--type='json' \
-p='[\
{\
"op": "add",\
"path": "/spec/template/spec/containers/0/args/-",\
"value": "--bgp-node-selector=cilium-bgp-peering=true"\
},\
{\
"op": "add",\
"path": "/spec/template/spec/containers/0/args/-",\
"value": "--load-balancer-type=cilium-bgp"\
},\
{\
"op": "add",\
"path": "/spec/template/spec/containers/0/args/-",\
"value": "--ip-holder-suffix=ccm-8039dcf"\
}\
]'

# Wait for rollout
KUBECONFIG=$(KUBECONFIG_PATH) kubectl -n kube-system rollout status daemonset/ccm-linode --timeout=300s

Expand Down

0 comments on commit 6190572

Please sign in to comment.