|
| 1 | +# Gateway infrastructure labels and annotations |
| 2 | + |
| 3 | +??? success "Standard Channel since v1.2.0" |
| 4 | + |
| 5 | + The `infrastructure` field is GA and has been part of the Standard Channel since |
| 6 | + `v1.2.0`. For more information on release channels, refer to our [versioning |
| 7 | + guide](/concepts/versioning). |
| 8 | + |
| 9 | +Gateway API implementations are responsible for creating the backing |
| 10 | +infrastructure needed to make each Gateway work. For example, implementations |
| 11 | +running in a Kubernetes cluster often create [Services][service] and |
| 12 | +[Deployments][deployment], while cloud-based implementations may create cloud |
| 13 | +load balancer resources. In many cases, it can be helpful to be able to |
| 14 | +propagate labels or annotations to these generated resources. |
| 15 | + |
| 16 | + |
| 17 | +The [`infrastructure` field][infrastructure] on a Gateway allows you to specify |
| 18 | +labels and annotations for the infrastructure created by the Gateway API controller. |
| 19 | +For example, if your Gateway infrastructure is running in-cluster, you can specify |
| 20 | +both Linkerd and Istio injection using the following Gateway configuration, making |
| 21 | +it simpler for the infrastructure to be incorporated into whichever service mesh |
| 22 | +you've installed. |
| 23 | + |
| 24 | +```yaml |
| 25 | +apiVersion: gateway.networking.k8s.io/v1 |
| 26 | +kind: Gateway |
| 27 | +metadata: |
| 28 | + name: meshed-gateway |
| 29 | + namespace: incoming |
| 30 | +spec: |
| 31 | + gatewayClassName: meshed-gateway-class |
| 32 | + listeners: |
| 33 | + - name: http-listener |
| 34 | + protocol: HTTP |
| 35 | + port: 80 |
| 36 | + infrastructure: |
| 37 | + labels: |
| 38 | + istio-injection: enabled |
| 39 | + annotations: |
| 40 | + linkerd.io/inject: enabled |
| 41 | +``` |
| 42 | +
|
| 43 | +[infrastructure]: /reference/spec/#gateway.networking.k8s.io/v1.GatewayInfrastructure |
| 44 | +[service]: https://kubernetes.io/docs/concepts/services-networking/service/ |
| 45 | +[deployment]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ |
0 commit comments