|
| 1 | +--- |
| 2 | +layout: blog |
| 3 | +title: "Gateway API v0.8.0: Introducing Service Mesh Support" |
| 4 | +date: 2023-08-29T10:00:00-08:00 |
| 5 | +slug: gateway-api-v0-8 |
| 6 | +--- |
| 7 | + |
| 8 | +***Authors:*** Flynn (Buoyant), John Howard (Google), Keith Mattix (Microsoft), Michael Beaumont (Kong), Mike Morris (independent), Rob Scott (Google) |
| 9 | + |
| 10 | +We are thrilled to announce the v0.8.0 release of Gateway API! With this |
| 11 | +release, Gateway API support for service mesh has reached [Experimental |
| 12 | +status][status]. We look forward to your feedback! |
| 13 | + |
| 14 | +We're especially delighted to announce that Kuma 2.3+, Linkerd 2.14+, and Istio |
| 15 | +1.16+ are all fully-conformant implementations of Gateway API service mesh |
| 16 | +support. |
| 17 | + |
| 18 | +## Service mesh support in Gateway API |
| 19 | + |
| 20 | +While the initial focus of Gateway API was always ingress (north-south) |
| 21 | +traffic, it was clear almost from the beginning that the same basic routing |
| 22 | +concepts should also be applicable to service mesh (east-west) traffic. In |
| 23 | +2022, the Gateway API subproject started the [GAMMA initiative][gamma], a |
| 24 | +dedicated vendor-neutral workstream, specifically to examine how best to fit |
| 25 | +service mesh support into the framework of the Gateway API resources, without |
| 26 | +requiring users of Gateway API to relearn everything they understand about the |
| 27 | +API. |
| 28 | + |
| 29 | +Over the last year, GAMMA has dug deeply into the challenges and possible |
| 30 | +solutions around using Gateway API for service mesh. The end result is a small |
| 31 | +number of [enhancement proposals][geps] that subsume many hours of thought and |
| 32 | +debate, and provide a minimum viable path to allow Gateway API to be used for |
| 33 | +service mesh. |
| 34 | + |
| 35 | +### How will mesh routing work when using Gateway API? |
| 36 | + |
| 37 | +You can find all the details in the [Gateway API Mesh routing |
| 38 | +documentation][mesh-routing] and [GEP-1426], but the short version for Gateway |
| 39 | +API v0.8.0 is that an HTTPRoute can now have a `parentRef` that is a Service, |
| 40 | +rather than just a Gateway. We anticipate future GEPs in this area as we gain |
| 41 | +more experience with service mesh use cases -- binding to a Service makes it |
| 42 | +possible to use the Gateway API with a service mesh, but there are several |
| 43 | +interesting use cases that remain difficult to cover. |
| 44 | + |
| 45 | +As an example, you might use an HTTPRoute to do an A-B test in the mesh as |
| 46 | +follows: |
| 47 | + |
| 48 | +```yaml |
| 49 | +apiVersion: gateway.networking.k8s.io/v1beta1 |
| 50 | +kind: HTTPRoute |
| 51 | +metadata: |
| 52 | + name: bar-route |
| 53 | +spec: |
| 54 | + parentRefs: |
| 55 | + - group: "" |
| 56 | + kind: Service |
| 57 | + name: demo-app |
| 58 | + port: 5000 |
| 59 | + rules: |
| 60 | + - matches: |
| 61 | + - headers: |
| 62 | + - type: Exact |
| 63 | + name: env |
| 64 | + value: v1 |
| 65 | + backendRefs: |
| 66 | + - name: demo-app-v1 |
| 67 | + port: 5000 |
| 68 | + - backendRefs: |
| 69 | + - name: demo-app-v2 |
| 70 | + port: 5000 |
| 71 | +``` |
| 72 | +
|
| 73 | +Any request to port 5000 of the `demo-app` Service that has the header `env: |
| 74 | +v1` will be routed to `demo-app-v1`, while any request without that header |
| 75 | +will be routed to `demo-app-v2` -- and since this is being handled by the |
| 76 | +service mesh, not the ingress controller, the A/B test can happen anywhere in |
| 77 | +the application's call graph. |
| 78 | + |
| 79 | +### How do I know this will be truly portable? |
| 80 | + |
| 81 | +Gateway API has been investing heavily in conformance tests across all |
| 82 | +features it supports, and mesh is no exception. One of the challenges that the |
| 83 | +GAMMA initiative ran into is that many of these tests were strongly tied to |
| 84 | +the idea that a given implementation provides an ingress controller. Many |
| 85 | +service meshes don't, and requiring a GAMMA-conformant mesh to also implement |
| 86 | +an ingress controller seemed impractical at best. This resulted in work |
| 87 | +restarting on Gateway API _conformance profiles_, as discussed in [GEP-1709]. |
| 88 | + |
| 89 | +The basic idea of conformance profiles is that we can define subsets of the |
| 90 | +Gateway API, and allow implementations to choose (and document) which subsets |
| 91 | +they conform to. GAMMA is adding a new profile, named `Mesh` and described in |
| 92 | +[GEP-1686], which checks only the mesh functionality as defined by GAMMA. At |
| 93 | +this point, Kuma 2.3+, Linkerd 2.14+, and Istio 1.16+ are all conformant with |
| 94 | +the `Mesh` profile. |
| 95 | + |
| 96 | +## What else is in Gateway API v0.8.0? |
| 97 | + |
| 98 | +This release is all about preparing Gateway API for the upcoming v1.0 release |
| 99 | +where HTTPRoute, Gateway, and GatewayClass will graduate to GA. There are two |
| 100 | +main changes related to this: CEL validation and API version changes. |
| 101 | + |
| 102 | +### CEL Validation |
| 103 | + |
| 104 | +The first major change is that Gateway API v0.8.0 is the start of a transition |
| 105 | +from webhook validation to [CEL validation][cel] using information built into |
| 106 | +the CRDs. That will mean different things depending on the version of |
| 107 | +Kubernetes you're using: |
| 108 | + |
| 109 | +#### Kubernetes 1.25+ |
| 110 | + |
| 111 | +CEL validation is fully supported, and almost all validation is implemented in |
| 112 | +CEL. (The sole exception is that header names in header modifier filters can |
| 113 | +only do case-insensitive validation. There is more information in [issue |
| 114 | +2277].) |
| 115 | + |
| 116 | +We recommend _not_ using the validating webhook on these Kubernetes versions. |
| 117 | + |
| 118 | +#### Kubernetes 1.23 and 1.24 |
| 119 | + |
| 120 | +CEL validation is not supported, but Gateway API v0.8.0 CRDs can still be |
| 121 | +installed. When you upgrade to Kubernetes 1.25+, the validation included in |
| 122 | +these CRDs will automatically take effect. |
| 123 | + |
| 124 | +We recommend continuing to use the validating webhook on these Kubernetes |
| 125 | +versions. |
| 126 | + |
| 127 | +#### Kubernetes 1.22 and older |
| 128 | + |
| 129 | +Gateway API only commits to support for [5 most recent versions of |
| 130 | +Kubernetes][supported-versions]. As such, these versions are no longer |
| 131 | +supported by Gateway API, and unfortunately Gateway API v0.8.0 cannot be |
| 132 | +installed on them, since CRDs containing CEL validation will be rejected. |
| 133 | + |
| 134 | +### API Version Changes |
| 135 | + |
| 136 | +As we prepare for a v1.0 release that will graduate Gateway, GatewayClass, and |
| 137 | +HTTPRoute to the `v1` API Version from `v1beta1`, we are continuing the process |
| 138 | +of moving away from `v1alpha2` for resources that have graduated to `v1beta1`. |
| 139 | +For more information on this change and everything else included in this |
| 140 | +release, refer to the [v0.8.0 release notes][v0.8.0 release notes]. |
| 141 | + |
| 142 | +## How can I get started with Gateway API? |
| 143 | + |
| 144 | +Gateway API represents the future of load balancing, routing, and service mesh |
| 145 | +APIs in Kubernetes. There are already more than 20 [implementations][impl] |
| 146 | +available (including both ingress controllers and service meshes) and the list |
| 147 | +keeps growing. |
| 148 | + |
| 149 | +If you're interested in getting started with Gateway API, take a look at the |
| 150 | +[API concepts documentation][concepts] and check out some of the |
| 151 | +[Guides][guides] to try it out. Because this is a CRD-based API, you can |
| 152 | +install the latest version on any Kubernetes 1.23+ cluster. |
| 153 | + |
| 154 | +If you're specifically interested in helping to contribute to Gateway API, we |
| 155 | +would love to have you! Please feel free to [open a new issue][issue] on the |
| 156 | +repository, or join in the [discussions][disc]. Also check out the [community |
| 157 | +page][community] which includes links to the Slack channel and community |
| 158 | +meetings. We look forward to seeing you!! |
| 159 | + |
| 160 | +## Further Reading: |
| 161 | + |
| 162 | +- [GEP-1324] provides an overview of the GAMMA goals and some important |
| 163 | + definitions. This GEP is well worth a read for its discussion of the problem |
| 164 | + space. |
| 165 | +- [GEP-1426] defines how to use Gateway API route resources, such as |
| 166 | + HTTPRoute, to manage traffic within a service mesh. |
| 167 | +- [GEP-1686] builds on the work of [GEP-1709] to define a _conformance |
| 168 | + profile_ for service meshes to be declared conformant with Gateway API. |
| 169 | + |
| 170 | +Although these are [Experimental][status] patterns, note that they are available |
| 171 | +in the [`standard` release channel][ch], since the GAMMA initiative has not |
| 172 | +needed to introduce new resources or fields to date. |
| 173 | + |
| 174 | +[gamma]:https://gateway-api.sigs.k8s.io/concepts/gamma/ |
| 175 | +[status]:https://gateway-api.sigs.k8s.io/geps/overview/#status |
| 176 | +[ch]:https://gateway-api.sigs.k8s.io/concepts/versioning/#release-channels-eg-experimental-standard |
| 177 | +[cel]:/docs/reference/using-api/cel/ |
| 178 | +[crd]:/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/ |
| 179 | +[concepts]:https://gateway-api.sigs.k8s.io/concepts/api-overview/ |
| 180 | +[geps]:https://gateway-api.sigs.k8s.io/contributing/enhancement-requests/ |
| 181 | +[guides]:https://gateway-api.sigs.k8s.io/guides/getting-started/ |
| 182 | +[impl]:https://gateway-api.sigs.k8s.io/implementations/ |
| 183 | +[install-crds]:https://gateway-api.sigs.k8s.io/guides/getting-started/#install-the-crds |
| 184 | +[issue]:https://github.com/kubernetes-sigs/gateway-api/issues/new/choose |
| 185 | +[disc]:https://github.com/kubernetes-sigs/gateway-api/discussions |
| 186 | +[community]:https://gateway-api.sigs.k8s.io/contributing/community/ |
| 187 | +[mesh-routing]:https://gateway-api.sigs.k8s.io/concepts/gamma/#how-the-gateway-api-works-for-service-mesh |
| 188 | +[GEP-1426]:https://gateway-api.sigs.k8s.io/geps/gep-1426/ |
| 189 | +[GEP-1324]:https://gateway-api.sigs.k8s.io/geps/gep-1324/ |
| 190 | +[GEP-1686]:https://gateway-api.sigs.k8s.io/geps/gep-1686/ |
| 191 | +[GEP-1709]:https://gateway-api.sigs.k8s.io/geps/gep-1709/ |
| 192 | +[issue 2277]:https://github.com/kubernetes-sigs/gateway-api/issues/2277 |
| 193 | +[supported-versions]:https://gateway-api.sigs.k8s.io/concepts/versioning/#supported-versions |
| 194 | +[v0.8.0 release notes]:https://github.com/kubernetes-sigs/gateway-api/releases/tag/v0.8.0 |
| 195 | +[versioning docs]:https://gateway-api.sigs.k8s.io/concepts/versioning/ |
0 commit comments