Skip to content

Commit 9ccb969

Browse files
authored
Add script for removing control-plane taint (#337)
1 parent d547811 commit 9ccb969

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ rebuild-cluster: delete-cluster
5555
./scripts/deploy-calico.sh
5656
./scripts/preload-images.sh
5757
./scripts/delete-standard-storageclass.sh
58+
./scripts/remove-control-plane-taint.sh
5859

5960
delete-cluster:
6061
./scripts/delete-k8s-cluster.sh
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Script to remove the control plane taint from the control-plane nodes
4+
5+
# Get the list of control-plane nodes
6+
CONTROL_PLANE_NODES=$(kubectl get nodes --selector=node-role.kubernetes.io/control-plane -o name)
7+
MASTER_NODES=$(kubectl get nodes --selector=node-role.kubernetes.io/master -o name)
8+
9+
# Remove the control-plane taint from the control-plane nodes
10+
for node in $CONTROL_PLANE_NODES; do
11+
kubectl taint nodes "$node" node-role.kubernetes.io/control-plane:NoSchedule-
12+
done
13+
14+
# Remove the master taint from the master nodes (deprecated)
15+
for node in $MASTER_NODES; do
16+
kubectl taint nodes "$node" node-role.kubernetes.io/master:NoSchedule-
17+
done

0 commit comments

Comments
 (0)