Configure a Kubernetes admission webhook with cert-manager for TLS provisioning and implement a ValidatingWebhookConfiguration to enforce custom policies

domain: kubernetes.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Deploy the webhook server as a Kubernetes Deployment and Service, ensuring the server listens on HTTPS and serves a TLS certificate at the expected mount path
  2. Create a cert-manager Certificate object targeting the webhook Service DNS name and referencing an Issuer or ClusterIssuer, and mount the resulting Secret into the webhook server pod
  3. Define the ValidatingWebhookConfiguration manifest with a clientConfig referencing the service name and path, and set the caBundle field to the cert-manager CA injection annotation so the CA bundle is populated automatically
  4. Configure the webhooks rules block to target the desired resource group, version, kind, and operations, and set failurePolicy to either Fail or Ignore based on the criticality of the policy
  5. Test the webhook by submitting a resource that should be rejected and verifying the API server returns the webhook's denial message, then submit a valid resource to confirm it passes

Known gotchas

Related routes

Build and deploy a validating admission webhook for a Kubernetes CRD
kubernetes.io · 6 steps · unrated
Configure securityContext and Pod Security Admission to enforce restricted pod standards
kubernetes.io · 5 steps · unrated
Define a Kubernetes ValidatingAdmissionPolicy using CEL to enforce that all Deployments set replica counts above a minimum without an external webhook
security/compliance · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans