You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ spec:
51
51
- type: "example.com/CNIReady"
52
52
requiredStatus: "True"
53
53
taint:
54
-
key: "readiness.k8s.io/NetworkReady"
54
+
key: "readiness.k8s.io/network/not-ready"
55
55
effect: "NoSchedule"
56
56
value: "pending"
57
57
enforcementMode: "bootstrap-only"
@@ -62,6 +62,19 @@ spec:
62
62
63
63
Find a more detailed walkthrough of setting up Node Readiness Controller in your Kind cluster [here](https://github.com/kubernetes-sigs/node-readiness-controller/blob/main/docs/TEST_README.md).
64
64
65
+
### Taint Key Conventions
66
+
67
+
- Reserved core prefixes are not allowed for user rules (except the controller-owned `readiness.k8s.io/network/not-ready` and `readiness.k8s.io/storage/not-ready`):
Copy file name to clipboardExpand all lines: api/v1alpha1/nodereadinessrule_types.go
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,12 @@ type NodeReadinessRuleSpec struct {
75
75
//
76
76
// +required
77
77
// +kubebuilder:validation:XValidation:rule="self.key.startsWith('readiness.k8s.io/')",message="taint key must start with 'readiness.k8s.io/'"
78
+
// +kubebuilder:validation:XValidation:rule="!self.key.startsWith('readiness.k8s.io/system/')",message="reserved taint prefix 'readiness.k8s.io/system/*' is not allowed"
79
+
// +kubebuilder:validation:XValidation:rule="!self.key.startsWith('readiness.k8s.io/core/')",message="reserved taint prefix 'readiness.k8s.io/core/*' is not allowed"
80
+
// +kubebuilder:validation:XValidation:rule="!self.key.startsWith('readiness.k8s.io/node/')",message="reserved taint prefix 'readiness.k8s.io/node/*' is not allowed"
81
+
// +kubebuilder:validation:XValidation:rule="!self.key.startsWith('readiness.k8s.io/device/')",message="reserved taint prefix 'readiness.k8s.io/device/*' is not allowed"
82
+
// +kubebuilder:validation:XValidation:rule="!self.key.startsWith('readiness.k8s.io/network/') || self.key == 'readiness.k8s.io/network/not-ready'",message="reserved taint prefix 'readiness.k8s.io/network/*' is not allowed except 'readiness.k8s.io/network/not-ready'"
83
+
// +kubebuilder:validation:XValidation:rule="!self.key.startsWith('readiness.k8s.io/storage/') || self.key == 'readiness.k8s.io/storage/not-ready'",message="reserved taint prefix 'readiness.k8s.io/storage/*' is not allowed except 'readiness.k8s.io/storage/not-ready'"
78
84
// +kubebuilder:validation:XValidation:rule="self.key.size() <= 253",message="taint key length must be at most 253 characters"
79
85
// +kubebuilder:validation:XValidation:rule="!has(self.value) || self.value.size() <= 63",message="taint value length must be at most 63 characters"
80
86
// +kubebuilder:validation:XValidation:rule="self.effect in ['NoSchedule', 'PreferNoSchedule', 'NoExecute']",message="taint effect must be one of 'NoSchedule', 'PreferNoSchedule', 'NoExecute'"
Copy file name to clipboardExpand all lines: docs/TEST_README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ The test demonstrates a realistic, production-aligned scenario where critical ad
9
9
The test uses a 3-node Kind cluster:
10
10
1.**`nrr-test-control-plane`**: The Kubernetes control plane. The NRR controller will run here unless specifically configured.
11
11
2.**`nrr-test-worker` (Platform Node)**: A dedicated node for running cluster-critical addons. It is labeled `reserved-for=platform` and has a corresponding taint to repel normal application workloads. Cert-manager will run here.
12
-
3.**`nrr-test-worker2` (Application Node)**: A standard worker node that starts with a `readiness.k8s.io/NetworkReady=pending:NoSchedule` taint, simulating a node that is not yet ready for application traffic.
12
+
3.**`nrr-test-worker2` (Application Node)**: A standard worker node that starts with a `readiness.k8s.io/network/not-ready=pending:NoSchedule` taint, simulating a node that is not yet ready for application traffic.
Copy file name to clipboardExpand all lines: docs/book/src/examples/cni-readiness.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ In many Kubernetes clusters, the CNI plugin runs as a DaemonSet. When a new node
8
8
This guide demonstrates how to use the Node Readiness Controller to prevent pods from being scheduled on a node until the Container Network Interface (CNI) plugin (e.g., Calico) is fully initialized and ready.
9
9
10
10
The high-level steps are:
11
-
1. Node is bootstrapped with a [startup taint](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)`readiness.k8s.io/NetworkReady=pending:NoSchedule` immediately upon joining.
11
+
1. Node is bootstrapped with a [startup taint](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)`readiness.k8s.io/network/not-ready=pending:NoSchedule` immediately upon joining.
12
12
2. A reporter DaemonSet is deployed to monitor the CNI's health and report it to the API server as node-condition (`projectcalico.org/CalicoReady`).
13
13
3. Node Readiness Controller will untaint the node only when the CNI reports it is ready.
14
14
@@ -85,7 +85,7 @@ subjects:
85
85
86
86
### 3. Create the Node Readiness Rule
87
87
88
-
Now define the rule that enforces the requirement. This tells the controller: *"Keep the `readiness.k8s.io/NetworkReady` taint on the node until `projectcalico.org/CalicoReady` is True."*
88
+
Now define the rule that enforces the requirement. This tells the controller: *"Keep the `readiness.k8s.io/network/not-ready` taint on the node until `projectcalico.org/CalicoReady` is True."*
89
89
90
90
```yaml
91
91
# network-readiness-rule.yaml
@@ -101,7 +101,7 @@ spec:
101
101
102
102
# The taint to manage
103
103
taint:
104
-
key: "readiness.k8s.io/NetworkReady"
104
+
key: "readiness.k8s.io/network/not-ready"
105
105
effect: "NoSchedule"
106
106
value: "pending"
107
107
@@ -135,11 +135,11 @@ To test this, add a new node to the cluster.
135
135
136
136
1. **Check the Node Taints**:
137
137
Immediately upon joining, the node should have the taint:
0 commit comments