Skip to content

fix: bootstrap trusted kubelet serving certificates - #85

Open
r3loac wants to merge 3 commits into
InftyAI:mainfrom
r3loac:main
Open

fix: bootstrap trusted kubelet serving certificates#85
r3loac wants to merge 3 commits into
InftyAI:mainfrom
r3loac:main

Conversation

@r3loac

@r3loac r3loac commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What changed

Nebula now requests a trusted kubelet serving certificate through the
kubernetes.io/kubelet-serving CSR signer.

The CSR contains the manager Pod IP in its SAN. After approval and issuance,
Nebula atomically replaces the self-signed fallback certificate without
restarting the kubelet API or interrupting existing streams.

Why

Managed Kubernetes control planes such as EKS may verify kubelet serving
certificates. Nebula previously used only a self-signed certificate, causing
kubectl logs and kubectl exec to fail with:

x509: certificate signed by unknown authority

Additional changes

  • Added certificate renewal
  • Added CSR RBAC permissions
  • Added POD_NAME and POD_UID projections
  • Added CSR approval documentation
  • Added certificate bootstrap and IP SAN tests

Verification

  • go test ./pkg/vnode ./cmd -count=1
  • go vet ./...
  • GolangCI-Lint: 0 new issues
  • Kustomize manifests render successfully
  • Linux/amd64 manager build succeeds

Deployment note

The kubernetes.io/kubelet-serving signer requires an external approval
decision. Approve the generated CSR with:

kubectl certificate approve <csr-name>

r3loac added 3 commits August 25, 2026 15:03
- Add a Status printer column derived from the NodePool Ready condition
- Regenerate the NodePool CRD
- Add regression coverage for the printer column
- Document the design, behavior, and deployment workflow
Add a Status printer column derived from the NodePool Ready condition
Regenerate the NodePool CRD
Add regression coverage for the printer column
Document the design, behavior, and deployment workflow
- Request a kubernetes.io/kubelet-serving certificate for the manager Pod IP
- Replace the self-signed certificate after CSR approval without restarting
- Renew serving certificates before expiration
- Add the required Pod identity environment variables and CSR RBAC
- Document CSR approval and kubelet TLS configuration
- Add coverage for certificate installation and IP SAN validation
@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Aug 28, 2026
@InftyAI-Agent
InftyAI-Agent requested a review from kerthcet August 28, 2026 19:11
@kerthcet

Copy link
Copy Markdown
Member

/assign

@kerthcet kerthcet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments since I can still not shell into the Modal workloads yet, one more thing, let's rebase the main branch since only the third commit is solve the cert issue.

Thanks!

Comment thread cmd/main.go
"serves TLS without client verification, because which CA signs the API server's kubelet "+
"client certificate is not portable across distributions; restrict the port with a "+
"NetworkPolicy, or set this to your API server's kubelet client CA.")
flag.BoolVar(&kubeletServingTLSBootstrap, "kubelet-serving-tls-bootstrap", true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's disable this by default.

Comment thread docs/deploy.md
--sort-by=.metadata.creationTimestamp -o name | tail -n1)

# Confirm the requested IP SAN matches the manager Pod IP before approving it.
kubectl get csr "$CSR" -o jsonpath='{.spec.request}' \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not right, no need to specify the resource type for $CSR.

Comment thread docs/deploy.md
| grep 'installed trusted kubelet serving certificate'
```

An installation with an external CSR approver should restrict it to requests that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried yourself, I tested this by following the instructions here but seems still error:

kg csr
nebula-kubelet-serving-c07b251cec59bb78b897a236   15m   kubernetes.io/kubelet-serving   system:serviceaccount:nebula-system:nebula-controller-manager   30d                 Approved

kubectl -n nebula-system logs deploy/nebula-controller-manager \
  | grep 'installed trusted kubelet serving certificate'
# null 

keti ky-modal-demo-qevhkl6-sandbox-bcc84cbd8-hrllq -- /bin/bash
error: Internal error occurred: error sending request: Post "https://10.20.15.172:10250/exec/org-d3d871f4-9d1d-4df5-85cb-0b1472f51857/ky-modal-demo-qevhkl6-sandbox-bcc84cbd8-hrllq/sandbox?command=%2Fbin%2Fbash&input=1&output=1&tty=1": tls: failed to verify certificate: x509: certificate signed by unknown authority

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

Labels

do-not-merge/needs-kind Indicates a PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants