sigs.k8s.io/external-dns@v0.14.1/docs/tutorials/gateway-api.md (about) 1 # Configuring ExternalDNS to use Gateway API Route Sources 2 3 This describes how to configure ExternalDNS to use Gateway API Route sources. 4 It is meant to supplement the other provider-specific setup tutorials. 5 6 ## Supported API Versions 7 8 As the Gateway API is still in an experimental phase, ExternalDNS makes no backwards 9 compatibilty guarantees regarding its support. However, it currently supports a mixture of 10 v1alpha2, v1beta1, v1 APIs. Gateways and HTTPRoutes are supported using the v1 and v1beta1 API (which is converted to v1 when using the latest CRDs). 11 GRPCRoutes, TLSRoutes, TCPRoutes, and UDPRoutes are supported using the v1alpha2 API. 12 13 ## Hostnames 14 15 HTTPRoute and TLSRoute specs, along with their associated Gateway Listeners, contain hostnames that 16 will be used by ExternalDNS. However, no such hostnames may be specified in TCPRoute or UDPRoute 17 specs. For TCPRoutes and UDPRoutes, the `external-dns.alpha.kubernetes.io/hostname` annotation 18 is the recommended way to provide their hostnames to ExternalDNS. This annotation is also supported 19 for HTTPRoutes and TLSRoutes by ExternalDNS, but it's _strongly_ recommended that they use their 20 specs to provide all intended hostnames, since the Gateway that ultimately routes their 21 requests/connections won't recognize additional hostnames from the annotation. 22 23 ## Manifest with RBAC 24 ```yaml 25 apiVersion: v1 26 kind: ServiceAccount 27 metadata: 28 name: external-dns 29 namespace: default 30 --- 31 apiVersion: rbac.authorization.k8s.io/v1 32 kind: ClusterRole 33 metadata: 34 name: external-dns 35 rules: 36 - apiGroups: [""] 37 resources: ["namespaces"] 38 verbs: ["get","watch","list"] 39 - apiGroups: ["gateway.networking.k8s.io"] 40 resources: ["gateways","httproutes","grpcroutes","tlsroutes","tcproutes","udproutes"] 41 verbs: ["get","watch","list"] 42 --- 43 apiVersion: rbac.authorization.k8s.io/v1 44 kind: ClusterRoleBinding 45 metadata: 46 name: external-dns 47 roleRef: 48 apiGroup: rbac.authorization.k8s.io 49 kind: ClusterRole 50 name: external-dns 51 subjects: 52 - kind: ServiceAccount 53 name: external-dns 54 namespace: default 55 --- 56 apiVersion: apps/v1 57 kind: Deployment 58 metadata: 59 name: external-dns 60 namespace: default 61 spec: 62 strategy: 63 type: Recreate 64 selector: 65 matchLabels: 66 app: external-dns 67 template: 68 metadata: 69 labels: 70 app: external-dns 71 spec: 72 serviceAccountName: external-dns 73 containers: 74 - name: external-dns 75 image: registry.k8s.io/external-dns/external-dns:v0.14.0 76 args: 77 # Add desired Gateway API Route sources. 78 - --source=gateway-httproute 79 - --source=gateway-grpcroute 80 - --source=gateway-tlsroute 81 - --source=gateway-tcproute 82 - --source=gateway-udproute 83 # Optionally, limit Routes to those in the given namespace. 84 - --namespace=my-route-namespace 85 # Optionally, limit Routes to those matching the given label selector. 86 - --label-filter=my-route-label==my-route-value 87 # Optionally, limit Route endpoints to those Gateways in the given namespace. 88 - --gateway-namespace=my-gateway-namespace 89 # Optionally, limit Route endpoints to those Gateways matching the given label selector. 90 - --gateway-label-filter=my-gateway-label==my-gateway-value 91 # Add provider-specific flags... 92 - --domain-filter=external-dns-test.my-org.com 93 - --provider=google 94 - --registry=txt 95 - --txt-owner-id=my-identifier 96 ```