Integrate central TLS profile via controller-runtime-common - #333
Integrate central TLS profile via controller-runtime-common#333JonahSussman wants to merge 7 commits into
Conversation
Bump controller-runtime to v0.24.1, k8s.io libs to v0.36.2, and add controller-runtime-common for TLS profile integration. Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
controller-runtime v0.24.1 replaces the untyped CustomValidator and CustomDefaulter interfaces with typed generics Validator[T] and Defaulter[T]. Update all three webhooks accordingly: - SNRValidator -> Validator[*SelfNodeRemediation] - SNRConfigValidator -> Validator[*SelfNodeRemediationConfig] - SNRTemplateDefaulter -> Defaulter[*SelfNodeRemediationTemplate] - SNRTemplateValidator -> Validator[*SelfNodeRemediationTemplate] Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
Update test variable types and helper function signatures to match the new typed Validator[T] interface from controller-runtime v0.24.1. Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
Fetch the cluster TLS profile from the APIServer CR at startup and apply it to the metrics and webhook servers. Watch for runtime changes and restart the manager when the profile is updated. On non-OpenShift clusters, fall back to default TLS settings gracefully. The gRPC peer health server/client (internal pod-to-pod, self-signed certs, hardcoded TLS 1.3) and kubelet health check client are not modified by this change as they are not externally exposed services. Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
|
Hi @JonahSussman. Thanks for your PR. I'm waiting for a medik8s member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Important Review skippedToo many files! This PR contains 2338 files, which is 2238 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (79)
📒 Files selected for processing (2338)
You can disable this status message by setting the |
|
/ok-to-test |
|
@pranavgaikwad please review |
pranavgaikwad
left a comment
There was a problem hiding this comment.
Code changes look good to me. +1 on updating webhooks
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eemcmullan, JonahSussman, pranavgaikwad The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Integrate central TLS profile via controller-runtime-common
Adds support for reading the cluster's centrally configured TLS profile from the APIServer CR and applying it to the metrics and webhook servers, enabling compliance with cluster-wide TLS policies. Follows the same pattern established in FAR PR #214.
What this PR does
Fetches the TLS profile at startup using
openshifttls.FetchAPIServerTLSProfilefromcontroller-runtime-common. On non-OpenShift clusters, falls back to default TLS settings gracefully.Applies the TLS profile to the metrics and webhook servers via
openshifttls.NewTLSConfigFromProfile, which configuresMinVersionandCipherSuitesbased on the cluster's TLS security profile (e.g.Old,Intermediate,Modern, orCustom).Watches for runtime TLS profile changes using
openshifttls.SecurityProfileWatcher. If the admin changes the TLS profile on a running cluster, the manager restarts to pick up the new settings. The watcher runs in both manager and agent modes since agent pods also serve metrics with TLS settings applied at startup.Adds RBAC for
get/list/watchonconfig.openshift.io/apiservers.Migrates webhooks to typed generic API --
NewWebhookManagedBynow takes the concrete type as a second argument.Validator[*T]andDefaulter[*T]replace the untypedCustomValidatorandCustomDefaulterinterfaces. All three webhooks (SNR, SNRConfig, SNRTemplate) are updated.Sets
tls-profilesOLM annotation to"true"in the Makefile bundle target to declare TLS profile support.Scope: gRPC and kubelet TLS
This PR intentionally does not modify the TLS configuration for the gRPC peer health server/client (
internal/certificates/credentials.go) or the kubelet health check client (internal/controlplane/manager.go):tls-profilesOLM annotation.If compliance requires these surfaces to also follow the cluster profile, a follow-up PR can thread the profile through -- likely with a floor at TLS 1.3 to prevent weakening internal security.
Dependency bumps
sigs.k8s.io/controller-runtime: v0.22.5 -> v0.24.1k8s.io/api,k8s.io/apimachinery,k8s.io/client-go: v0.34.7 -> v0.36.2github.com/openshift/api: updated to latestgithub.com/openshift/controller-runtime-common: added (new dependency)Testing
operator-sdk bundle validateRelated