From 56f09399748b4b73af1ec77eac7036e7a3aa4908 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Wed, 23 Aug 2023 21:00:51 +0800 Subject: [PATCH] fix: #1308 calico rr setup --- roles/calico/tasks/calico-rr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/calico/tasks/calico-rr.yml b/roles/calico/tasks/calico-rr.yml index 270645a..a0d10f0 100644 --- a/roles/calico/tasks/calico-rr.yml +++ b/roles/calico/tasks/calico-rr.yml @@ -19,7 +19,8 @@ - name: node label shell: 'for ip in {{ NODE_IPS }};do \ - {{ base_dir }}/bin/kubectl label node "$ip" route-reflector=true --overwrite; + node_name=$({{ bin_dir }}/calicoctl get node -owide|grep " $ip/"|cut -d" " -f1) && \ + {{ base_dir }}/bin/kubectl label node "$node_name" route-reflector=true --overwrite; done' connection: local