Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Kubernetes Gateway Api Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-kubernetes-gateway-api-knowledge-patch)
---
name: kubernetes-gateway-api-knowledge-patch
description: Kubernetes Gateway API
version: "1.7.0"
license: MIT
metadata:
author: Nevaberry
---
# Kubernetes Gateway API knowledge patch
Load this skill when creating or migrating Gateway API manifests, updating
Go consumers, interpreting controller status, or configuring conformance
runs. Use the references for detailed constraints and change attribution.
| Reference | Topics |
| --- | --- |
| [API lifecycle and upgrades](references/api-lifecycle-and-upgrades.md) | API migration, safe upgrades, Go consumers, schemas, conformance features and clients |
| [Gateways, listeners, and status](references/gateways-listeners-and-status.md) | Addresses, infrastructure, ListenerSets, attachment, hostname precedence, capabilities, tracing |
| [Policies, security, and capabilities](references/policies-security-and-capabilities.md) | Backend and frontend TLS, authentication, trust bundles, retry budgets, session persistence, XBackend |
| [Routes, filters, and validation](references/routes-filters-and-validation.md) | Admission, named rules, TLSRoute limits, retries, CORS, mirroring, redirects |
## Migrate API kinds and versions
- Use `apiVersion: gateway.networking.k8s.io/v1` for `TLSRoute`,
`ReferenceGrant`, `TCPRoute`, and `UDPRoute`.
- Run Kubernetes 1.31 or later for `TLSRoute` CEL validation. The 1.5
Experimental bundle drops its `v1alpha2`; `v1alpha3` is deprecated.
- `TCPRoute` and `UDPRoute` `v1alpha2` versions are deprecated and will be
removed in a future release.
- Migrate `XListenerSet` to Standard `ListenerSet` in
`gateway.networking.k8s.io`. The 1.5 Experimental bundle drops
`XListenerSet`. Moving `XListenerSet` or `XBackendTrafficPolicy` objects
to future Standard kinds requires recreating them with the Standard kind
and API group.
## Account for safe-upgrade admission checks
The `safe-upgrades.gateway.networking.k8s.io` ValidatingAdmissionPolicy
blocks switching installed Standard CRDs to Experimental CRDs and
downgrading to a release before 1.5. Delete it before deliberately
performing either operation:
```sh
kubectl delete validatingadmissionpolicy safe-upgrades.gateway.networking.k8s.io
```
The policy also blocks installation of monthly releases and older releases.
Upgrades of already installed Experimental CRDs are allowed.
## Update experimental backend configuration
- Remove `idleTimeout` from experimental session persistence manifests.
- Move route-inline or `BackendTrafficPolicy` session persistence to an
`XBackend` of type `EndpointSelector`.
- Rename `cookieConfig` to `cookie`; move `sessionName` to `cookie.name`
(optional, Extended) or `header.name` (required for header persistence,
Core). Cookies default to `Path=/`; use `cookie.path` (Extended) to retain
a route-specific path.
- On `XBackend`, rename `spec.port.port` to `spec.port.number`, remove
`spec.port.name`, and omit `backendRef.port` on references to it.
- Use `WSS` for WebSockets over TLS. `HTTP2` requires TLS; `H2C` requires
TLS to be disabled.
The policies reference preserves the earlier `BackendLBPolicy` to
`XBackendTrafficPolicy` migration and `cookieConfig` validation.
## Update generated manifests and Go consumers
- Include `spec` in `GRPCRoute` and `ReferenceGrant` manifests; admission
rejects its omission. `HTTPRoute.spec.rules` must have at least one entry.
- Names within `spec.rules` must be unique on each `HTTPRoute` and
`GRPCRoute`. Use RFC 1035-compliant resource names.
- Gateway and `ListenerSet` listeners with `protocol: TLS` validate their
TLS mode. Attach `TCPRoute` to `protocol: TCP` listeners; TLS listeners
no longer accept it.
- Put Gateway-wide backend TLS configuration in `GatewayTLSConfig` under
the Gateway's `spec.tls`.
- Replace `TrueField` usage in typed CORS clients with a boolean for
`allowCredentials`.
- The main and conformance Go modules declare `go 1.27.0` and use Kubernetes
v0.37 dependencies. `ForwardBodyConfig.MaxSize` is `int32`, previously
`uint16`; check the renamed ancestor-reference field in generated
`BackendAncestorStatus` types when updating callers.
- An explicitly empty `ListenerStatus.supportedKinds` slice serializes as
`[]`; a nil slice is omitted. Release artifacts include OpenAPI v2 schemas.
## Configure Standard HTTP retries
Gateway API 1.7.0 promoted `retry.codes`, `retry.attempts`, and `retry.backoff`
to Standard. Attempts default to `1`. Set `0` to disable retries for the rule.
```yaml
retry:
attempts: 0
```
List each status code only once in `retry.codes`. `backoff` sets the base
interval for an implementation-specific backoff strategy, including jitter.
Retry connection errors only when the request can safely be retried.
Gateway API 1.6.0 required at least `1` when setting `retry.attempts`.
[Gateway API 1.7.0 release notes](https://github.com/kubernetes-sigs/gateway-api/releases/tag/v1.7.0)
## Configure CORS, mirroring, and redirects
- `CORS` is Standard. Use a boolean for `cors.allowCredentials`; if
`cors.allowMethods` contains `"*"`, it must be the only entry.
- Use at most one `CORS` filter per rule. CEL validation rejects unsupported values
in the host portion of allowed origins.
- Percentage mirroring for `HTTPRoute` and `GRPCRoute` is Standard and
Extended. With Experimental CRDs installed, check
`GatewayClass.status.supportedFeatures` for
`HTTPRouteRequestPercentageMirror`.
- Redirect status codes `303`, `307`, and `308` on
`HTTPRequestRedirectFilter.statusCode` are Extended; check controller
support before using them.
## Name and size routes
The Standard channel accepts `name` on `HTTPRoute` rules and individual
matches. Each `GRPCRoute` rule supports up to 64 entries in `matches`.
`TLSRoute` supports up to 4,096 entries each in `spec.hostnames` and
`spec.rules`. Before deploying manifests near those limits in production,
validate representative manifests against your API server, etcd, and
Gateway controller.
## Configure backend and incoming TLS
`BackendTLSPolicy` is generally available in the Standard channel. Its
subject alternative names and TLS options are also Standard, as is
`TLSRouteMixedMode`. Support for `subjectAltNames` is Extended; verify
controller support. Specified subject alternative names take precedence
over hostname validation. Read the policy's `ResolvedRefs` condition for
reference resolution.
Use controller-supported implementation-specific strings in
`wellKnownCACertificates`. The API allows up to 16 certificate authority
references.
The Standard channel supports client certificate validation on incoming
connections whose TLS terminates at the Gateway; inspect listener
conditions for invalid configuration. It also supports selecting the client
certificate the Gateway presents for backend TLS; inspect the Gateway's
`ResolvedRefs` for invalid Gateway-level backend TLS configuration.
## Request addresses and read Gateway status
- Omitting `value` in a `GatewaySpecAddress` requests automatic assignment
for its address type. Without `GatewayEmptyAddress` support, controllers
must report `Programmed=False` with reason `AddressNotAssigned`.
- Experimental `routability` is per address: omit it for the controller
default, use `Cluster`, or use a domain-prefixed implementation-specific
value. Check `GatewayAddressRoutability` and
`GatewayAddressRoutabilityCluster` support.
- For a missing, malformed, or unsupported resource referenced by
`Gateway.spec.infrastructure.parametersRef`, controllers should set
`Accepted=False` with reason `InvalidParameters`.
- `Gateway.status.attachedListenerSets` counts successfully attached
`ListenerSet` objects; a Gateway listener's `attachedRoutes` counts only
accepted routes. A listener in a `ListenerSet` permits routes from the
`ListenerSet`'s own namespace by default.
- `ListenerSet` can report `ListenersNotValid` for `Programmed`. A listener
without a conflict can omit `Conflicted`; accept absence as well as
`Conflicted=False`.
## Check capabilities and hostname handling
Controllers can advertise capabilities through Standard
`GatewayClass.status.supportedFeatures`. The experimental `Mesh` resource
provides mesh-wide configuration and feature discovery through its status.
Check controller behavior before sharing a hostname between `HTTPRoute`
and `GRPCRoute`: controllers may allow or reject the combination. With
`GatewayRouteHostnameIntersectionPrecedence`, controllers rank overlapping
`HTTPRoute`, `GRPCRoute`, and `TLSRoute` objects by original route hostname
specificity.
`OverlappingTLSConfig` can report TLS overlap affecting HTTP/2 connection
reuse. Controllers are advised to return HTTP `421 Misdirected Request`
when hostname and SNI matching rules make a coalesced HTTPS request
misdirected.
## Select conformance features and clients
- Replace removed `HTTPRouteRetry` and `HTTPRouteRetryBackendTimeout` with
`HTTPRouteRetryCodes` and `HTTPRouteRetryConnectionError`.
- Remove `HTTPRouteBackendRequestRedirect` from feature selections.
`HTTPRouteBackendURLRewrite` coverage at `HTTPBackendRef` is provisional.
- Use `GATEWAY-UDP` for UDP conformance. Override polling with
`DefaultPollInterval`; the suite can disable parallel tests for a run.
- Supply `Options.GRPCClient` for `GRPCRouteWeight` sampling; injected
clients remain open for caller reuse and closure. Use
`ConformanceOptions.WebSocketDialer` to inject a WebSocket dialer.
The lifecycle reference details capability inference, client defaults,
status checks, report URL validation, and missing-manifest errors. The
other references cover experimental default Gateways, authentication,
listener filters, shared trust bundles, retry budgets, and tracing.