Context
The current maintenance mode implementation (#601, PR #631) uses nginx-ingress-specific annotations (nginx.ingress.kubernetes.io/server-snippet) to inject traffic control directives. This is tightly coupled to the NGINX Ingress Controller and will silently fail with any other ingress controller (Traefik, HAProxy, AWS ALB, Istio, etc.).
The Kubernetes Gateway API is the official successor to the Ingress API, reached GA (v1.1.0) in October 2023, and is now implemented by every major ingress controller and service mesh. It provides a standardized, portable way to express traffic policies.
Decision
Proposed Implementation
Gateway API HTTPRoute-Based Maintenance Mode
Use Gateway API HTTPRoute resources with request matching to implement maintenance mode. When maintenance mode is enabled, the operator creates/patches HTTPRoute resources to:
- full-block mode: Match all traffic except health check paths → return 503 via a backend ref to a maintenance backend (or use HTTPRoute
RequestRedirect filter)
- read-only mode: Match mutating HTTP methods (POST, PUT, DELETE, PATCH) except on excluded paths → return 503
Key Design Points
- The operator should detect whether Gateway API CRDs are installed in the cluster
- If Gateway API is available, use it; otherwise fall back to legacy nginx annotations
- Gateway API
HTTPRoute filters provide portable RequestHeaderModifier, RequestRedirect, and backend weighting
- For 503 responses, consider a lightweight maintenance-page backend (e.g., a static nginx pod returning 503) or
HTTPRoute ExtensionRef where supported
- Health/readiness exclusions work natively via HTTPRoute path matching priority
Migration Path
- Detect cluster capabilities (Gateway API CRDs present?)
- Prefer Gateway API when available
- Log a deprecation warning when falling back to legacy nginx annotations
- Document migration guide for users on nginx-ingress wanting to adopt Gateway API
Acceptance Criteria
References
Context
The current maintenance mode implementation (#601, PR #631) uses nginx-ingress-specific annotations (
nginx.ingress.kubernetes.io/server-snippet) to inject traffic control directives. This is tightly coupled to the NGINX Ingress Controller and will silently fail with any other ingress controller (Traefik, HAProxy, AWS ALB, Istio, etc.).The Kubernetes Gateway API is the official successor to the Ingress API, reached GA (v1.1.0) in October 2023, and is now implemented by every major ingress controller and service mesh. It provides a standardized, portable way to express traffic policies.
Decision
Proposed Implementation
Gateway API HTTPRoute-Based Maintenance Mode
Use Gateway API
HTTPRouteresources with request matching to implement maintenance mode. When maintenance mode is enabled, the operator creates/patches HTTPRoute resources to:RequestRedirectfilter)Key Design Points
HTTPRoutefilters provide portableRequestHeaderModifier,RequestRedirect, and backend weightingHTTPRouteExtensionRefwhere supportedMigration Path
Acceptance Criteria
HTTPRouteresourcesReferences