Skip to content

Add kubelet serving certificate readiness example - #365

Open
arnab-logs wants to merge 2 commits into
kubernetes-sigs:mainfrom
arnab-logs:docs/add-kubelet-serving-cert-readiness-example
Open

Add kubelet serving certificate readiness example#365
arnab-logs wants to merge 2 commits into
kubernetes-sigs:mainfrom
arnab-logs:docs/add-kubelet-serving-cert-readiness-example

Conversation

@arnab-logs

Copy link
Copy Markdown
Member

This PR adds a new example demonstrating how to use NRC to prevent workloads from scheduling on a node until kubelet has obtained its TLS serving certificate.

Includes:

  • examples/kubelet-cert-readiness/: kind cluster config and manifests (RBAC, NPD ConfigMaps, NPD DaemonSet, NodeReadinessRule)
  • docs/book/src/examples/kubelet-cert-readiness.md: mdBook documentation page
  • docs/book/src/SUMMARY.md: adds the new page to the site navigation

Use Case

This is in reference to a slack discussion raised in the NRC community. When a node is marked Ready, kubectl exec and kubectl logs may still fail because kubelet has not yet received its TLS serving certificate, the certificate is issued separately via a CSR and its approval can be delayed on some providers.

This causes visible failures in CI/CD environments: GitLab Runner marks jobs as failed when it cannot exec into pods on a new node, and Fluentbit fails to collect logs from kubelet before the certificate is in place.

How to test

Create kind cluster

kind create cluster --config examples/kubelet-cert-readiness/kind-config.yaml

Install the CRDs and Controller

See the Installation Guide for details

Deploy the Example

kubectl apply -f examples/kubelet-cert-readiness/manifests/

Check the startup taint is applied

kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints
Pasted Graphic

Check the node condition

   kubectl get node <node-name> \
    -o jsonpath='{.status.conditions[?(@.type=="KubeletServingCertNotReady")]}' | jq .
Pasted Graphic 1

Approve the worker's pending CSR to simulate the certificate being issued

    kubectl get csr
    # find the entry with SIGNERNAME kubernetes.io/kubelet-serving and REQUESTOR system:node:<worker-name>
    kubectl certificate approve <worker-csr-name>
Pasted Graphic 3

Check the condition again

    kubectl get node <node-name> \
    -o jsonpath='{.status.conditions[?(@.type=="KubeletServingCertNotReady")]}' | jq .
Pasted Graphic 4

Check taint removal

   kubectl get node <node-name> -o jsonpath='{.spec.taints}'
Pasted Graphic 5

Confirm kubectl exec works

   kubectl run test-pod --image=busybox --restart=Never -- sleep 3600
   
   kubectl exec test-pod -- echo "exec works"
image

@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for node-readiness-controller ready!

Name Link
🔨 Latest commit f87afe2
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6a75a936005c9f00083fd5d4
😎 Deploy Preview https://deploy-preview-365--node-readiness-controller.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow
kubernetes-prow Bot requested a review from ajaysundark August 7, 2026 09:45
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: arnab-logs
Once this PR has been reviewed and has the lgtm label, please assign mrunalp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested a review from mrunalp August 7, 2026 09:45
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 7, 2026
@kubernetes-prow

Copy link
Copy Markdown

@arnab-logs: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-node-readiness-controller-verify-all f87afe2 link true /test pull-node-readiness-controller-verify-all

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@arnab-logs

Copy link
Copy Markdown
Member Author

Looks like the prow job failed on the docs link check. I verified the files are present in this PR and the failure seems to be because the links point to main where these new files don't exist yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant