fix: replace deprecated kube-rbac-proxy with controller-runtime authn/authz#443
Conversation
…/authz The gcr.io/kubebuilder/kube-rbac-proxy image is deprecated and GCR is being sunset. Replace the kube-rbac-proxy sidecar with controller-runtime's built-in SecureServing and WithAuthenticationAndAuthorization filter, which provides the same TokenReview/SubjectAccessReview security model natively. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Testing on my
|
Pull Request Test Coverage Report for Build 22933760501Details
💛 - Coveralls |
|
@diranged the CI job is probably failing because my source branch is on a fork which probably can't upload dep graphs (I didn't have write/push permissions on this repo so I had to fork). But I'm guessing those are non-required checks? The building and local testing all seemed to pass. |
diranged
left a comment
There was a problem hiding this comment.
Solid fix.. the premise is right - kube-rbac-proxy is deprecated and GCR is sunsetting, so this needs to happen. Using controller-runtime's built-in SecureServing + WithAuthenticationAndAuthorization is the officially recommended migration path, so this is the right approach.
Two things to be aware of:
-
The
dependency-reviewCI failure is fromgo.opentelemetry.io/otel/sdk@1.36.0(GHSA-9h8m-3fm2-qjrq) - it's a transitive dep pulled in byk8s.io/apiserver, so not really actionable here. Just worth tracking until upstream bumps it. -
The metrics port name is now hardcoded to
httpsinstead of being dynamic from values.. shouldn't matter since the kube-rbac-proxy values are gone, but if anyone had ServiceMonitor configs referencing the old port name by value they'd need to update.
E2E tests pass across six K8s versions, helm-test passes, lint is clean.. ship it.
…rkflow (#444) ## Summary - The `godeps.yaml` workflow triggers on `pull_request` events, but the `actions/go-dependency-submission` action requires `contents: write` permission to submit dependency snapshots - On `pull_request` events, the `GITHUB_TOKEN` is read-only, causing "Resource not accessible by integration" errors (e.g. [PR #443](#443)) - Dependency snapshots only need to be submitted when code lands on `main`, so the `pull_request` trigger is removed ## Test plan - [ ] Verify CI passes on this PR (the `go-action-detection` job should no longer run) - [ ] Verify the workflow still runs on push to `main` after merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
@schahal The other failure is actually a security failure on a dependency that was introducd (otel 1.36)... im upgrading it to 1.40 which should be clear. |
Resolves CVE-2026-24051 (GHSA-9h8m-3fm2-qjrq): OpenTelemetry Go SDK v1.21.0-v1.39.0 is vulnerable to arbitrary code execution via PATH hijacking on macOS/Darwin systems. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Background
The
gcr.io/kubebuilder/kube-rbac-proxyimage is deprecated and Google Container Registry (GCR) is being sunset, making the image unavailable. This project used kube-rbac-proxy as a sidecar container to secure the/metricsendpoint via Kubernetes TokenReview and SubjectAccessReview. See kubernetes-sigs/cluster-api-addon-provider-helm#318 for upstream context.Changes
Instead of finding an alternative image, this replaces the sidecar pattern entirely with controller-runtime's built-in
SecureServingandWithAuthenticationAndAuthorizationfilter. The manager now serves metrics securely over HTTPS on port 8443 with native authn/authz — no sidecar needed. The kube-rbac-proxy container, its image configuration, and related Helm values have been removed from both the kustomize config and the Helm chart. The existing RBAC resources (TokenReview/SubjectAccessReview permissions and metrics-reader ClusterRole) are retained since the manager now performs these checks itself.Testing
Deployed to a local KIND cluster and verified the pod runs with a single container (no sidecar). Confirmed that unauthenticated requests to the metrics endpoint return
Unauthorized. Verified that authenticated requests without themetrics-readerClusterRole returnAuthorization denied. Confirmed that authenticated requests with themetrics-readerrole bound successfully return Prometheus metrics.🤖 Generated with Claude Code