Sub topic 15
API versions and standard versus experimental channels
This chapter assumes you can apply YAML with kubectl, know what a CRD is, and have read the earlier chapters on GatewayClass, Gateway, and HTTPRoute.
Gateway API is installed, not built in
Gateway API resources are not part of core Kubernetes. They are Custom Resource Definitions (CRDs) that you install in the cluster. A managed cluster may already include them. Otherwise you apply a release bundle from the Gateway API project. The controller you choose then implements the behavior.
This matters for versions. Three things change independently:
- The Kubernetes version of your cluster.
- The version of the Gateway API CRDs you installed.
- The version of the controller, which supports a certain range of CRD versions.
Release channels
The project publishes each release in two channels. Each channel is a separate set of CRDs.
| Channel | Contents | Stability |
|---|---|---|
| Standard | Resources and fields that have reached GA or Beta | Safe for production. Changes are backward compatible. |
| Experimental | Everything in Standard, plus Alpha resources and fields | No compatibility promise. Can change or be removed. |
GatewayClass, Gateway, and HTTPRoute are in the Standard channel at v1. ReferenceGrant is served at v1beta1, as in the earlier example. Resources such as TCPRoute and TLSRoute started in the Experimental channel, so check the current release notes before you rely on them.
API versions
Each manifest names its version in apiVersion. For example, gateway.networking.k8s.io/v1 is the stable version of Gateway and HTTPRoute. Versions follow the usual Kubernetes meaning:
v1alpha2: experimental, may change without notice.v1beta1: well tested, but the schema may still see small changes.v1: stable, with a compatibility promise.
If you apply a manifest with a version your CRDs do not serve, kubectl rejects it. Older guides often use v1beta1 for Gateway and HTTPRoute. Newer CRDs still serve those versions for a time, but write new manifests with v1.
Check what your cluster has
Run these commands to see which CRDs and versions are installed.
kubectl get crd | grep gateway.networking.k8s.io
kubectl get crd gateways.gateway.networking.k8s.io \
-o jsonpath='{.metadata.annotations.gateway\.networking\.k8s\.io/bundle-version}{"\n"}'
kubectl get crd gateways.gateway.networking.k8s.io \
-o jsonpath='{.metadata.annotations.gateway\.networking\.k8s\.io/channel}{"\n"}'The CRDs carry annotations for the bundle version and the channel. If the commands print nothing, the annotation is missing, which can happen with older bundles or CRDs installed by another tool. In that case inspect the CRD YAML.
Choosing a channel
Use these rules:
- Default to Standard in production.
- Use Experimental in test clusters when you need to try a feature early.
- Before upgrading CRDs, read the release notes and check that your controller supports the new version.
- Check the status conditions on your resources after an upgrade, as described in the earlier chapter on debugging.
Common errors
no matches for kind "HTTPRoute": the CRDs are not installed, or the version inapiVersionis not served.- A field is rejected as unknown: the field is Experimental and you installed the Standard channel.
- A route is accepted by the API server but ignored: the controller does not support that feature. Look at the route's status conditions.
Exercise
Your manifest uses a field that exists only in the Experimental channel, and kubectl apply reports an unknown field. What is the likely cause, and what are two ways to resolve it?
Show answer
The cluster has the Standard channel CRDs, which do not include that field. You can remove the field from the manifest, or install the Experimental channel CRDs, if you accept that the feature may change. Also confirm that your controller supports the field.
Exercise
Which command shows the Gateway API bundle version installed in your cluster?
Show answer
Read the annotation on a CRD, for example: kubectl get crd gateways.gateway.networking.k8s.io -o jsonpath='{.metadata.annotations.gateway\.networking\.k8s\.io/bundle-version}'