Skip to content

Commit e8d5c4e

Browse files
docs(istio): document ingress annotation (#5756)
* docs(istio): document ingress annotation Signed-off-by: ivan katliarchuk <[email protected]> * docs(istio): document ingress annotation Co-authored-by: Michel Loiseleur <[email protected]> --------- Signed-off-by: ivan katliarchuk <[email protected]> Co-authored-by: Michel Loiseleur <[email protected]>
1 parent e9983a5 commit e8d5c4e

File tree

3 files changed

+40
-27
lines changed

3 files changed

+40
-27
lines changed

docs/annotations/annotations.md

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ ExternalDNS sources support a number of annotations on the Kubernetes resources
44

55
The following table documents which sources support which annotations:
66

7-
| Source | controller | hostname | internal-hostname | target | ttl | (provider-specific) |
8-
|--------------|------------|----------|-------------------|---------|---------|---------------------|
9-
| Ambassador | | | | Yes | Yes | Yes |
10-
| Connector | | | | | | |
11-
| Contour | Yes | Yes[^1] | | Yes | Yes | Yes |
12-
| CloudFoundry | | | | | | |
13-
| CRD | | | | | | |
14-
| F5 | | | | Yes | Yes | |
15-
| Gateway | Yes | Yes[^1] | | Yes[^4] | Yes | Yes |
16-
| Gloo | | | | Yes | Yes[^5] | Yes[^5] |
17-
| Ingress | Yes | Yes[^1] | | Yes | Yes | Yes |
18-
| Istio | Yes | Yes[^1] | | Yes | Yes | Yes |
19-
| Kong | | Yes[^1] | | Yes | Yes | Yes |
20-
| Node | Yes | | | Yes | Yes | |
21-
| OpenShift | Yes | Yes[^1] | | Yes | Yes | Yes |
22-
| Pod | | Yes | Yes | Yes | | |
23-
| Service | Yes | Yes[^1] | Yes[^1][^2] | Yes[^3] | Yes | Yes |
24-
| Skipper | Yes | Yes[^1] | | Yes | Yes | Yes |
25-
| Traefik | | Yes[^1] | | Yes | Yes | Yes |
7+
| Source | controller | hostname | internal-hostname | target | ttl | (provider-specific) | ingress |
8+
|--------------|------------|----------|-------------------|---------|---------|---------------------|:-------:|
9+
| Ambassador | | | | Yes | Yes | Yes | No |
10+
| Connector | | | | | | | No |
11+
| Contour | Yes | Yes[^1] | | Yes | Yes | Yes | No |
12+
| CloudFoundry | | | | | | | No |
13+
| CRD | | | | | | | No |
14+
| F5 | | | | Yes | Yes | | No |
15+
| Gateway | Yes | Yes[^1] | | Yes[^4] | Yes | Yes | No |
16+
| Gloo | | | | Yes | Yes[^5] | Yes[^5] | No |
17+
| Ingress | Yes | Yes[^1] | | Yes | Yes | Yes | No |
18+
| Istio | Yes | Yes[^1] | | Yes | Yes | Yes | Yes |
19+
| Kong | | Yes[^1] | | Yes | Yes | Yes | No |
20+
| Node | Yes | | | Yes | Yes | | No |
21+
| OpenShift | Yes | Yes[^1] | | Yes | Yes | Yes | No |
22+
| Pod | | Yes | Yes | Yes | | | No |
23+
| Service | Yes | Yes[^1] | Yes[^1][^2] | Yes[^3] | Yes | Yes | No |
24+
| Skipper | Yes | Yes[^1] | | Yes | Yes | Yes | No |
25+
| Traefik | | Yes[^1] | | Yes | Yes | Yes | No |
2626

2727
[^1]: Unless the `--ignore-hostname-annotation` flag is specified.
2828
[^2]: Only behaves differently than `hostname` for `Service`s of type `ClusterIP` or `LoadBalancer`.
@@ -143,6 +143,17 @@ If the value is `annotation-only`, use only the domains from the `Ingress` annot
143143

144144
If the annotation is not present, use the domains from both the spec and annotations.
145145

146+
## external-dns.alpha.kubernetes.io/ingress
147+
148+
This annotation allows ExternalDNS to work with Istio Gateways that don't have a public IP.
149+
150+
It can be used to address a specific architectural pattern, when a Kubernetes Ingress directs all public traffic to the Istio Gateway:
151+
152+
- **The Challenge**: By default, ExternalDNS sources the public IP address for a DNS record from a Service of type LoadBalancer.
153+
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.
154+
155+
- **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.
156+
146157
## external-dns.alpha.kubernetes.io/internal-hostname
147158

148159
Specifies the domain for the resource's DNS records that are for use from internal networks.

source/annotations/annotations.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,21 @@ const (
4040
SetIdentifierKey = AnnotationKeyPrefix + "set-identifier"
4141
AliasKey = AnnotationKeyPrefix + "alias"
4242
TargetKey = AnnotationKeyPrefix + "target"
43-
// The annotation used for figuring out which controller is responsible
43+
// ControllerKey The annotation used for figuring out which controller is responsible
4444
ControllerKey = AnnotationKeyPrefix + "controller"
45-
// The annotation used for defining the desired hostname
45+
// HostnameKey The annotation used for defining the desired hostname
4646
HostnameKey = AnnotationKeyPrefix + "hostname"
47-
// The annotation used for specifying whether the public or private interface address is used
47+
// AccessKey The annotation used for specifying whether the public or private interface address is used
4848
AccessKey = AnnotationKeyPrefix + "access"
49-
// The annotation used for specifying the type of endpoints to use for headless services
49+
// EndpointsTypeKey The annotation used for specifying the type of endpoints to use for headless services
5050
EndpointsTypeKey = AnnotationKeyPrefix + "endpoints-type"
51-
// The annotation used to determine the source of hostnames for ingresses. This is an optional field - all
51+
// Ingress the annotation used to determine if the gateway is implemented by an Ingress object
52+
Ingress = AnnotationKeyPrefix + "ingress"
53+
// IngressHostnameSourceKey The annotation used to determine the source of hostnames for ingresses. This is an optional field - all
5254
// available hostname sources are used if not specified.
5355
IngressHostnameSourceKey = AnnotationKeyPrefix + "ingress-hostname-source"
54-
// The value of the controller annotation so that we feel responsible
56+
// ControllerValue The value of the controller annotation so that we feel responsible
5557
ControllerValue = "dns-controller"
56-
// The annotation used for defining the desired hostname
58+
// InternalHostnameKey The annotation used for defining the desired hostname
5759
InternalHostnameKey = AnnotationKeyPrefix + "internal-hostname"
5860
)

source/istio_gateway.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import (
4444

4545
// IstioGatewayIngressSource is the annotation used to determine if the gateway is implemented by an Ingress object
4646
// instead of a standard LoadBalancer service type
47-
const IstioGatewayIngressSource = "external-dns.alpha.kubernetes.io/ingress"
47+
const IstioGatewayIngressSource = annotations.Ingress
4848

4949
// gatewaySource is an implementation of Source for Istio Gateway objects.
5050
// The gateway implementation uses the spec.servers.hosts values for the hostnames.

0 commit comments

Comments
 (0)