Repository navigation
feat: Add AuthBridge Mutating Webhook for Kubernetes Workloads - #75
Merged
Merged
Conversation
Signed-off-by: cwiklik <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a mutating admission webhook that automatically injects AuthBridge sidecars into standard Kubernetes workloads (Deployments, StatefulSets, DaemonSets, Jobs, and CronJobs). Previously, AuthBridge injection was only available for custom resources (Agent and MCPServer CRs).
Changes:
- Added new AuthBridge mutating webhook handler for workload resources
- Implemented label-based opt-in/opt-out injection logic with namespace fallback
- Added RBAC permissions for workload resource access
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| kagenti-webhook/internal/webhook/v1alpha1/authbridge_webhook.go | New webhook handler that processes admission requests for Deployments, StatefulSets, DaemonSets, Jobs, and CronJobs |
| kagenti-webhook/internal/webhook/injector/pod_mutator.go | Added InjectAuthBridge() and NeedsMutation() methods for new label-based injection logic |
| kagenti-webhook/internal/webhook/injector/namespace_checker.go | Added IsNamespaceInjectionEnabled() function for namespace-level injection checks |
| kagenti-webhook/internal/webhook/injector/container_builder.go | Fixed shell command quoting in BuildClientRegistrationContainer |
| kagenti-webhook/config/webhook/manifests.yaml | Added authbridge webhook configuration to Kubernetes manifests |
| charts/kagenti-webhook/templates/authbridge-mutatingwebhook.yaml | New Helm template for authbridge webhook with namespace selectors |
| charts/kagenti-webhook/templates/clusterrole.yaml | Added RBAC permissions for workload resources |
| kagenti-webhook/scripts/full-deploy.sh | Deployment script that creates authbridge webhook configuration |
| kagenti-webhook/cmd/main.go | Registered AuthBridge webhook with manager |
| kagenti-webhook/Makefile | Updated default cluster name and added deployment targets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: cwiklik <[email protected]>
This was referenced Jan 26, 2026
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new mutating admission webhook that automatically injects AuthBridge sidecars (SPIFFE helper and client registration) into standard Kubernetes workloads (Deployments, StatefulSets, DaemonSets, Jobs, and CronJobs).
Motivation
Previously, sidecar injection was only available for custom resources (Agent and MCPServer CRs). This webhook extends AuthBridge injection support to native Kubernetes workloads, enabling zero-touch authentication setup for any application.
Changes
New Files
kagenti-webhook/internal/webhook/v1alpha1/authbridge_webhook.go - Main webhook handler for workload mutation
Modified Files
Idempotency
The webhook checks for existing spiffe-helper and kagenti-client-registration containers before injection to prevent duplicate sidecars on UPDATE operations.
Injected Components:
Required volumes (spiffe-helper-config, spire-agent-socket, svid-output, shared-data)
Usage Examples
Enable injection via workload label:
Disable injection for specific workload:
How It Works
Injection Behavior Matrix
kagenti-enabled: truekagenti.io/inject: enabledkagenti-enabled: truekagenti.io/inject: disabledkagenti-enabled: truekagenti.io/inject: enabledkagenti-enabled: falsekagenti.io/inject: enabledFixes:
rossoctl/rossoctl#526
#74