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

Commit

Permalink
Enable flagging a kubelet as a master node for tainting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stu Charlton authored and svrc committed Nov 14, 2019
1 parent 6a66ad9 commit 01a899c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jobs/kubelet/spec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ properties:
description: The Kubelet will load its initial configuration from this.
Omit this to use the built-in default configuration values.
Command-line flags override configuration.
master:
description: The kubelet will label and taint itself as a master node with node-role.kubernetes.io/master=:NoSchedule
default: false
kubectl-drain-timeout:
description: "The length of time to wait before giving up draining a node, zero means infinite"
default: "0s"
Expand Down
4 changes: 4 additions & 0 deletions jobs/kubelet/templates/bin/post-start.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ if timeout "$TIMEOUT" /var/vcap/jobs/kubelet/bin/ensure_kubelet_up_and_running
then
load_cached_containers
node_name=$($kubectl get nodes -o wide -L bosh.id | grep "<%= spec.id %>$" | grep ' Ready' | awk '{print $1}')
<% if p("master") %>
${kubectl} label node ${node_name} node-role.kubernetes.io/master=
${kubectl} taint nodes ${node_name} node-role.kubernetes.io/master=:NoSchedule
<% end %>
${kubectl} uncordon ${node_name}
${kubectl} get nodes ${node_name} | grep -e ' Ready '
echo "kubelet post-start checks succeeded"
Expand Down

0 comments on commit 01a899c

Please sign in to comment.