Rejecting Invalid Ingress Routes at Apply Time
Zalando moved validation of Skipper routing configuration onto the Kubernetes admission path, so a validating webhook now rejects Ingress and RouteGroup objects with unknown predicates, bad filter parameters or unparseable backends during kubectl apply. The webhook reuses Skipper's own filter registry, predicate specs and backend checks, so it answers "would Skipper accept this route?" rather than "does this string parse?", and it returns actionable error messages. Zalando runs this across 250+ clusters with ~200k routes. It rolled the change out tier by tier, watching a skipper_route_invalid{route_id, reason} metric and webhook health, with an -enable-advanced-validation flag as a fast rollback when false positives appeared. The feature ships in open-source Skipper from v0.24.18.
Related posts
- A Simple Kubernetes Admission Webhook
Slack Engineering mediumAdeptA Kubernetes validating and mutating admission webhook can be a minimal, stateless Go HTTPS server that receives AdmissionReview requests and returns allow/deny decisions or base64-encoded JSON patches. No Kubebuilder or Operator SDK is needed. The walkthrough covers the Deployment, Service, TLS Secret (SAN must match the service hostname) and the Validating/MutatingWebhookConfiguration objects, including using a namespaceSelector so the webhook doesn't gate its own pods. It then shows pluggable validator and mutator interfaces, used for pod-name checks, env injection and annotation-driven tolerations. Practical lessons: webhook invocation order isn't guaranteed and reinvocationPolicy: IfNeeded can call a webhook twice, so mutations must be idempotent, and local testing must be backed by a prod-like environment.
- Scaling Beyond Limits: Harnessing Route Server for a Stable Cluster
Zalando Engineering mediumAdeptZalando put a Route Server between its Skipper ingress proxies and the Kubernetes API after roughly 180 Skipper instances per cluster, each polling Ingresses and RouteGroups, overloaded etcd and throttled the API server. Route Server polls the API every 3 seconds, converts resources into an Eskip routing table and serves it with an ETag, so unchanged tables return HTTP 304. If Route Server is down, Skipper keeps its last known routes and an alert fires. Rollout used disabled, pre-processing (shadow, with route-table diffs) and execution modes, tier by tier, with zero downtime. Skipper's autoscaling ceiling rose to 300 pods, and one Route Server deployment handles about 100 RPS.
- Open Policy Agent in Skipper Ingress
Zalando Engineering mediumAdeptZalando embedded Open Policy Agent as a library inside Skipper, its Kubernetes ingress controller and reverse proxy, to offer authorization as a service. Teams enable it with one `opaAuthorizeRequest` filter annotation on an Ingress and keep their Rego policies in their own repositories. Skipper runs one virtual OPA instance per registered application, uses input structures aligned with the OPA Envoy plugin, pulls policy bundles from S3 (published by Styra DAS) so the data plane survives control-plane failures, and emits OpenTelemetry spans for both decisions and control-plane traffic. Running in-process removes a network hop and avoids per-app sidecars, but it raises memory and CPU use. Zalando limits that cost with bundle size limits, bounded telemetry buffers, and enabling OPA only on demand, at a scale of about 2M rps across 20,000 ingresses and routegroups.
- Avoiding Kubernetes Pod Topology Spread Constraint Pitfalls
Wise Engineering mediumAdeptKubernetes Pod Topology Spread Constraints with a naive LabelSelector (e.g. just the app label) can produce heavy zone skew during rolling updates, because kube-scheduler counts Pods from both old and new ReplicaSets and never rebalances when old Pods are randomly terminated. In the worst case an Availability Zone outage could take out 2/3 of a service's Pods instead of 1/3. Wise fixed this with a mutating admission webhook that adds a per-ReplicaSet UUID label to Pods and to the constraint's LabelSelector, so only new-version Pods are considered. Alternatives include manifest tooling changes, the alpha matchLabelKeys field with pod-template-hash in Kubernetes 1.25, descheduler for scale-down imbalance, or per-zone deployments or clusters.
- Building Overexposed: understanding application exposure
Shopify Engineering mediumAdeptOverexposed is Shopify's scheduled scanner for finding GKE Ingresses and Cloud Run services reachable without authentication. An earlier version read Kubernetes config from the repo, and it produced false alarms, misses and blind spots. The rebuild pulls admitted resources and IAM policies from GCP Cloud Asset Inventory and probes each endpoint anonymously with HEAD-first requests and checked redirects. It maps each result to one of six verdicts (exposed, expected, protected, not found, unreachable, inconclusive) with recorded evidence. Key lessons cover how a status code means different things on different surfaces (a Cloud Run 404 can come from Google's front end), SSRF protection for the scanner itself by connecting to pre-validated IPs, replaying rule changes against saved scans (which cut inconclusive Ingress results by about 80%), and mutation testing and per-verdict canaries to verify AI-written tests.