-
-
Notifications
You must be signed in to change notification settings - Fork 3
fix: add kubelet certificate rotation support for Talos with metrics-server #1616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add kubelet certificate rotation support for Talos with metrics-server #1616
Conversation
β¦server Signed-off-by: Nikolai Emil Damm <nikolaiemildamm@icloud.com>
β MegaLinter analysis: Successβ Linters with no issuesactionlint, bash-exec, checkov, git_diff, grype, hadolint, jscpd, jsonlint, lychee, markdown-table-formatter, markdownlint, prettier, prettier, shellcheck, shfmt, syft, trivy, trivy-sbom, trufflehog, v8r, v8r, yamllint See detailed reports in MegaLinter artifacts |
Codecov Reportβ Patch coverage is π’ Thoughts on this report? Let us know! |
β¦s-with-metrics-server
β¦figs Signed-off-by: Nikolai Emil Damm <nikolaiemildamm@icloud.com>
Signed-off-by: Nikolai Emil Damm <nikolaiemildamm@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds kubelet certificate rotation support for Talos clusters when metrics-server is enabled, fixing issue #1612. The change ensures that metrics-server can scrape kubelet metrics over HTTPS without TLS errors by automatically enabling the rotate-server-certificates flag.
Key changes:
- Introduces automatic kubelet certificate rotation configuration for Talos when metrics-server is enabled
- Refactors notification methods in the scaffolder for better code organization and maintainability
- Adds comprehensive test coverage for the Talos generator with new certificate rotation scenarios
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/io/scaffolder/scaffolder.go | Adds enableKubeletCertRotation logic and refactors notification methods into smaller, reusable functions |
| pkg/io/generator/talos/generator.go | Implements kubelet certificate rotation patch generation with new config field and patch file creation |
| pkg/io/generator/talos/generator_test.go | Adds comprehensive test coverage for kubelet cert rotation scenarios including standalone and combined configurations |
| pkg/io/config-manager/talos/configs.go | Implements ApplyKubeletCertRotation method and introduces helper function applyPatchToBothConfigs to reduce code duplication |
| pkg/io/config-manager/talos/configs_test.go | Adds tests for kubelet cert rotation application and idempotency |
| cmd/cluster/create.go | Adds setupTalosKubeletCertRotation function to apply cert rotation at cluster creation time |
| docs/configuration/index.md | Fixes markdown table alignment formatting |
| docs/configuration/declarative-configuration.md | Fixes markdown table alignment formatting across multiple tables |
β¦for config application Signed-off-by: Nikolai Emil Damm <nikolaiemildamm@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
β¦s-with-metrics-server
Signed-off-by: Nikolai Emil Damm <nikolaiemildamm@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
dde395e to
fff3f05
Compare
β¦s-with-metrics-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
|
We need to revisit this implementation as rotating server certificates is something we do to support metrics server WITH https. So we need to do something like the below when metrics server on Talos clusters:
Talos docs describe it here: https://docs.siderolabs.com/kubernetes-guides/monitoring-and-observability/deploy-metrics-server If this works for Talos, it might also work for other distributions minus the Talos cluster-wide patch. We should consider migrating all installations of metrics-server to this approach, as it is superior because it does not rely on http as the current approach does. |
β¦s-with-metrics-server
Pull request was converted to draft

Add support for kubelet certificate rotation in Talos to enhance security and ensure proper functioning with metrics-server.
Fixes #1612
Type of change