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
This example demonstrates how NRC can be used alongside [NPD (Node Problem Detector)](https://github.com/kubernetes/node-problem-detector) to make sure that all static pods are mirrored in the API server to avoid over-committing issues. See [#115325](https://github.com/kubernetes/kubernetes/issues/115325), [#47264](https://github.com/kubernetes/website/issues/47264), and [#126870](https://github.com/kubernetes/kubernetes/pull/126870) for reference.
4
+
5
+
## Deployment Steps
6
+
7
+
1. Deploy a testing cluster if you haven't already. For this example we are using a Kubernetes 1.35 Kind cluster.
8
+
We need to also mount our problem daemon script and its respective config. On Kind this can be done using this config:
9
+
10
+
```yaml
11
+
kind: Cluster
12
+
apiVersion: kind.x-k8s.io/v1alpha4
13
+
nodes:
14
+
# This is a 1 cluster node for testing purposes
15
+
- role: control-plane
16
+
extraMounts:
17
+
- hostPath: /path/to/check-staticpods-synced.sh
18
+
containerPath: /opt/check-staticpods-synced.sh
19
+
- hostPath: /path/to/staticpods-syncer.json
20
+
containerPath: /opt/staticpods-syncer.json
21
+
- hostPath: /path/to/staticPodsManifestsDir
22
+
containerPath: /etc/kubernetes/manifests
23
+
```
24
+
25
+
2. Install NRC and apply the node readiness rule:
26
+
27
+
```bash
28
+
kubectl apply -f nrr.yaml
29
+
```
30
+
31
+
3. Deploy NPD, either as a DaemonSet using the official Helm chart, or in standalone mode. Keep in mind that if you are going to go the Helm way, you need to modify the NPD image to include the binaries that your script depends on (in our case, we need `curl` and `kubectl`), or download them in your script (this is not recommended since you'll have to set a high timeout in the custom plugin monitor config, at least for the initial script run).
32
+
33
+
### Standalone Mode
34
+
35
+
In this example, and since I have a 1-node Kind cluster, I will go the standalone way. Note that this is the default shipping method in GKE and AKS.
36
+
37
+
```bash
38
+
# Exec into your kind node
39
+
docker exec -it container_id bash
40
+
41
+
# Download NPD (change the arch if you are working on arm!)
> **Note:** For a more robust and reliable version of the shell script, you can check this [standalone binary](https://github.com/GGh41th/NPD-staticpods-syncer).
0 commit comments