Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.

Commit b8b4ce3

Browse files
committed
Enable flagging a kubelet as a master node for tainting.
1 parent 3d1cefe commit b8b4ce3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

jobs/kubelet/spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ properties:
3636
description: The Kubelet will load its initial configuration from this.
3737
Omit this to use the built-in default configuration values.
3838
Command-line flags override configuration.
39+
master:
40+
description: The kubelet will label and taint itself as a master node with node-role.kubernetes.io/master=:NoSchedule
41+
default: false
3942
kubectl-drain-timeout:
4043
description: "The length of time to wait before giving up draining a node, zero means infinite"
4144
default: "0s"

jobs/kubelet/templates/bin/post-start.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ if timeout "$TIMEOUT" /var/vcap/jobs/kubelet/bin/ensure_kubelet_up_and_running
3232
then
3333
load_cached_containers
3434
node_name=$($kubectl get nodes -o wide -L bosh.id | grep "<%= spec.id %>$" | grep ' Ready' | awk '{print $1}')
35+
<% if p("master") %>
36+
${kubectl} label node ${node_name} node-role.kubernetes.io/master=
37+
${kubectl} taint nodes ${node_name} node-role.kubernetes.io/master=:NoSchedule
38+
<% end %>
3539
${kubectl} uncordon ${node_name}
3640
${kubectl} get nodes ${node_name} | grep -e ' Ready '
3741
echo "kubelet post-start checks succeeded"

0 commit comments

Comments
 (0)