Skip to content

Commit fd9a650

Browse files
committed
feat: add support for ingress backed GlooEdge Gateway
1 parent 03439c7 commit fd9a650

File tree

8 files changed

+481
-75
lines changed

8 files changed

+481
-75
lines changed

charts/external-dns/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222

2323
- Add option to set `annotationPrefix` ([#5889](https://github.com/kubernetes-sigs/external-dns/pull/5889)) _@lexfrei_
2424

25+
### Changed
26+
27+
- Grant `networking.k8s.io/ingresses` and `gateway.solo.io/gateways` permissions when using `gloo-proxy` source. ([#5909](https://github.com/kubernetes-sigs/external-dns/pull/5909)) _@cucxabong_
28+
2529
## [v1.19.0] - 2025-09-08
2630

2731
### Added

charts/external-dns/templates/clusterrole.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rules:
2626
resources: ["endpointslices"]
2727
verbs: ["get","watch","list"]
2828
{{- end }}
29-
{{- if or (has "ingress" .Values.sources) (has "istio-gateway" .Values.sources) (has "istio-virtualservice" .Values.sources) (has "contour-httpproxy" .Values.sources) (has "openshift-route" .Values.sources) (has "skipper-routegroup" .Values.sources) }}
29+
{{- if or (has "ingress" .Values.sources) (has "istio-gateway" .Values.sources) (has "istio-virtualservice" .Values.sources) (has "contour-httpproxy" .Values.sources) (has "openshift-route" .Values.sources) (has "skipper-routegroup" .Values.sources) (has "gloo-proxy" .Values.sources) }}
3030
- apiGroups: ["extensions","networking.k8s.io"]
3131
resources: ["ingresses"]
3232
verbs: ["get","watch","list"]
@@ -99,7 +99,7 @@ rules:
9999
{{- end }}
100100
{{- if has "gloo-proxy" .Values.sources }}
101101
- apiGroups: ["gloo.solo.io","gateway.solo.io"]
102-
resources: ["proxies","virtualservices"]
102+
resources: ["proxies","virtualservices","gateways"]
103103
verbs: ["get","watch","list"]
104104
{{- end }}
105105
{{- if has "kong-tcpingress" .Values.sources }}

charts/external-dns/tests/rbac_test.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,3 +520,27 @@ tests:
520520
resources: ["virtualservices"]
521521
verbs: ["get","watch","list"]
522522
template: clusterrole.yaml
523+
- it: should create default RBAC rules for 'GlooEdge' when 'gloo-proxy' is set
524+
set:
525+
sources:
526+
- gloo-proxy
527+
asserts:
528+
- template: clusterrole.yaml
529+
equal:
530+
path: rules
531+
value:
532+
- apiGroups: [""]
533+
resources: ["nodes"]
534+
verbs: ["list","watch"]
535+
- apiGroups: [""]
536+
resources: ["pods"]
537+
verbs: ["get","watch","list"]
538+
- apiGroups: [""]
539+
resources: ["services"]
540+
verbs: ["get","watch","list"]
541+
- apiGroups: ["extensions","networking.k8s.io"]
542+
resources: ["ingresses"]
543+
verbs: ["get","watch","list"]
544+
- apiGroups: ["gloo.solo.io","gateway.solo.io"]
545+
resources: ["proxies","virtualservices","gateways"]
546+
verbs: ["get","watch","list"]

docs/annotations/annotations.md

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,108 @@ If the annotation is not present, use the domains from both the spec and annotat
151151

152152
## external-dns.alpha.kubernetes.io/ingress
153153

154-
This annotation allows ExternalDNS to work with Istio Gateways that don't have a public IP.
154+
This annotation allows ExternalDNS to work with Istio & GlooEdge Gateways that don't have a public IP.
155155

156-
It can be used to address a specific architectural pattern, when a Kubernetes Ingress directs all public traffic to the Istio Gateway:
156+
It can be used to address a specific architectural pattern, when a Kubernetes Ingress directs all public traffic to an Istio or GlooEdge Gateway:
157157

158158
- **The Challenge**: By default, ExternalDNS sources the public IP address for a DNS record from a Service of type LoadBalancer.
159-
However, in some service mesh setups, the Istio Gateway's Service is of type ClusterIP, with all public traffic routed to it via a separate Kubernetes Ingress object. This setup leaves the Gateway without a public IP that ExternalDNS can discover.
159+
However, in some setups, the Gateway's Service is of type ClusterIP, with all public traffic routed to it via a separate Kubernetes Ingress object. This setup leaves the Gateway without a public IP that ExternalDNS can discover.
160160

161-
- **The Solution**: The annotation on the Istio Gateway tells ExternalDNS to ignore the Gateway's Service IP. Instead, it directs ExternalDNS to a specified Ingress resource to find the target LoadBalancer IP address.
161+
- **The Solution**: The annotation on the Istio/GlooEdge Gateway tells ExternalDNS to ignore the Gateway's Service IP. Instead, it directs ExternalDNS to a specified Ingress resource to find the target LoadBalancer IP address.
162+
163+
### Use Cases for `external-dns.alpha.kubernetes.io/ingress` annotation
164+
165+
#### Getting target from Ingress backed Gloo Gateway
166+
167+
```yml
168+
apiVersion: gateway.solo.io/v1
169+
kind: Gateway
170+
metadata:
171+
annotations:
172+
external-dns.alpha.kubernetes.io/ingress: gateway-proxy
173+
labels:
174+
app: gloo
175+
name: gateway-proxy
176+
namespace: gloo-system
177+
spec:
178+
bindAddress: '::'
179+
bindPort: 8080
180+
options: {}
181+
proxyNames:
182+
- gateway-proxy
183+
ssl: false
184+
useProxyProto: false
185+
---
186+
apiVersion: networking.k8s.io/v1
187+
kind: Ingress
188+
metadata:
189+
name: gateway-proxy
190+
namespace: gloo-system
191+
spec:
192+
ingressClassName: alb
193+
rules:
194+
- host: cool-service.example.com
195+
http:
196+
paths:
197+
- backend:
198+
service:
199+
name: gateway-proxy
200+
port:
201+
name: http
202+
path: /
203+
pathType: Prefix
204+
status:
205+
loadBalancer:
206+
ingress:
207+
- hostname: k8s-alb-c4aa37c880-740590208.us-east-1.elb.amazonaws.com
208+
---
209+
# This object is generated by GlooEdge Control Plane from Gateway and VirtualService.
210+
# We have no direct control on this resource
211+
apiVersion: gloo.solo.io/v1
212+
kind: Proxy
213+
metadata:
214+
labels:
215+
created_by: gloo-gateway
216+
name: gateway-proxy
217+
namespace: gloo-system
218+
spec:
219+
listeners:
220+
- bindAddress: '::'
221+
bindPort: 8080
222+
httpListener:
223+
virtualHosts:
224+
- domains:
225+
- cool-service.example.com
226+
metadataStatic:
227+
sources:
228+
- observedGeneration: "6652"
229+
resourceKind: '*v1.VirtualService'
230+
resourceRef:
231+
name: cool-service
232+
namespace: gloo-system
233+
name: cool-service
234+
routes:
235+
- matchers:
236+
- prefix: /
237+
metadataStatic:
238+
sources:
239+
- observedGeneration: "6652"
240+
resourceKind: '*v1.VirtualService'
241+
resourceRef:
242+
name: cool-service
243+
namespace: gloo-system
244+
upgrades:
245+
- websocket: {}
246+
metadataStatic:
247+
sources:
248+
- observedGeneration: "6111"
249+
resourceKind: '*v1.Gateway'
250+
resourceRef:
251+
name: gateway-proxy
252+
namespace: gloo-system
253+
name: listener-::-8080
254+
useProxyProto: false
255+
```
162256

163257
## external-dns.alpha.kubernetes.io/internal-hostname
164258

docs/sources/gloo-proxy.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,52 @@ spec:
104104
- --registry=txt
105105
- --txt-owner-id=my-identifier
106106
```
107+
108+
## Gateway Annotation
109+
110+
To support setups where an Ingress resource is used to provision an external LB you can add the following annotation to your Gateway
111+
112+
**Note:** The Ingress namespace can be omitted if its in the same namespace as the gateway
113+
114+
```bash
115+
$ cat <<EOF | kubectl apply -f -
116+
apiVersion: gloo.solo.io/v1
117+
kind: Proxy
118+
metadata:
119+
labels:
120+
created_by: gloo-gateway
121+
name: gateway-proxy
122+
namespace: gloo-system
123+
spec:
124+
listeners:
125+
- bindAddress: '::'
126+
metadataStatic:
127+
sources:
128+
- resourceKind: '*v1.Gateway'
129+
resourceRef:
130+
name: gateway-proxy
131+
namespace: gloo-system
132+
---
133+
apiVersion: gateway.solo.io/v1
134+
kind: Gateway
135+
metadata:
136+
annotations:
137+
external-dns.alpha.kubernetes.io/ingress: "$ingressNamespace/$ingressName"
138+
labels:
139+
app: gloo
140+
name: gateway-proxy
141+
namespace: gloo-system
142+
spec: {}
143+
---
144+
apiVersion: networking.k8s.io/v1
145+
kind: Ingress
146+
metadata:
147+
labels:
148+
gateway-proxy-id: gateway-proxy
149+
gloo: gateway-proxy
150+
name: gateway-proxy
151+
namespace: gloo-system
152+
spec:
153+
ingressClassName: alb
154+
EOF
155+
```

0 commit comments

Comments
 (0)