Skip to content

Commit

Permalink
Add node-role.kubernetes.io/control-plane tolerations and taints
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed Feb 16, 2022
1 parent 7b8db72 commit 79cb2d6
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions hack/log/log-dump-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ spec:
key: node-role.kubernetes.io/master
operator: Equal
value: "true"
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Equal
value: "true"
- effect: NoExecute
operator: Exists
- effect: NoSchedule
Expand Down
3 changes: 3 additions & 0 deletions templates/addons/metrics-server/metrics-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ spec:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
volumes:
- emptyDir: {}
name: tmp-dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ spec:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
Original file line number Diff line number Diff line change
Expand Up @@ -4916,6 +4916,9 @@ data:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
volumes:
- emptyDir: {}
name: tmp-dir
Expand Down
3 changes: 3 additions & 0 deletions templates/test/ci/cluster-template-prow-ci-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4916,6 +4916,9 @@ data:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
volumes:
- emptyDir: {}
name: tmp-dir
Expand Down
15 changes: 13 additions & 2 deletions test/e2e/conformance_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down Expand Up @@ -183,13 +184,23 @@ var _ = Describe("Conformance Tests", func() {
LabelSelector: "kubernetes.io/os=linux",
}

noScheduleTaint := &corev1.Taint{
// This is kept to support versions of k8s < 1.20.
deprecatedNoScheduleTaint := &corev1.Taint{
Key: "node-role.kubernetes.io/master",
Value: "",
Effect: "NoSchedule",
}

err := node.TaintNode(workloadProxy.GetClientSet(), options, noScheduleTaint)
noScheduleTaint := &corev1.Taint{
Key: "node-role.kubernetes.io/control-plane",
Value: "",
Effect: "NoSchedule",
}

err := node.TaintNode(workloadProxy.GetClientSet(), options, deprecatedNoScheduleTaint)
Expect(err).NotTo(HaveOccurred())

err = node.TaintNode(workloadProxy.GetClientSet(), options, noScheduleTaint)
Expect(err).NotTo(HaveOccurred())

// Windows requires a repo-list because some images are not in k8s gcr
Expand Down

0 comments on commit 79cb2d6

Please sign in to comment.