From 6081c3e1ad79281acbb5eeef76bef5d9c3c11f80 Mon Sep 17 00:00:00 2001 From: Pierre Oblin Date: Tue, 10 May 2022 16:43:27 -0400 Subject: [PATCH] set labels bosh.io/agent=true not possible to set node-role.kubernetes.io/worker since k8s 1.16 (security reason). Adding this bosh.io label to help targeting agent nodes --- jobs/k3s-agent/templates/bin/ctl.erb | 2 +- jobs/k3s-server/templates/bin/ctl.erb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jobs/k3s-agent/templates/bin/ctl.erb b/jobs/k3s-agent/templates/bin/ctl.erb index c09ce2b9..f2e15f5e 100755 --- a/jobs/k3s-agent/templates/bin/ctl.erb +++ b/jobs/k3s-agent/templates/bin/ctl.erb @@ -92,8 +92,8 @@ export FLAGS="$FLAGS --kubelet-arg=config=/var/vcap/jobs/k3s-agent/config/kubele --node-label bosh.io/index=<%= spec.index %> \ --node-label bosh.io/address=<%= spec.ip %> \ --node-label bosh.io/id=<%= spec.id %> \ + --node-label bosh.io/agent=true \ --node-label topology.kubernetes.io/zone=<%= spec.az %> \ - --node-label node-role.kubernetes.io/worker=true \ $FLAGS \ $servers \ >> $LOG_DIR/k3s-agent.stdout.log \ diff --git a/jobs/k3s-server/templates/bin/ctl.erb b/jobs/k3s-server/templates/bin/ctl.erb index 12f0c2e8..1a888004 100755 --- a/jobs/k3s-server/templates/bin/ctl.erb +++ b/jobs/k3s-server/templates/bin/ctl.erb @@ -154,6 +154,7 @@ export FLAGS="$FLAGS --kubelet-arg=config=/var/vcap/jobs/k3s-server/config/kubel --node-label bosh.io/index=<%= spec.index %> \ --node-label bosh.io/address=<%= spec.ip %> \ --node-label bosh.io/id=<%= spec.id %> \ + --node-label bosh.io/server=true \ --node-label topology.kubernetes.io/zone=<%= spec.az %> \ $FLAGS \ >> $LOG_DIR/k3s-server.stdout.log \