66 Commits

Author SHA1 Message Date
Michel Loiseleur
7ae03cdfc7
docs: refactor title and organisation 2024-09-05 09:09:48 +02:00
Kubernetes Prow Robot
ccab9a95c5
Merge pull request #4469 from thameezb/feat-support-dual-stack-gateway-api
feat: support dual stack for gateway api
2024-09-01 18:40:45 +01:00
Kyle
38178940a3
feat: add annotation and label filters to Ambassador Host Source (#2633)
* Add annotation filter to Ambassador Host Source

This change makes the Ambassador Host source respect the External-DNS annotationFilter allowing for an Ambassador Host resource to specify what External-DNS deployment to use when there are multiple External-DNS deployments within the same cluster. Before this change if you had two External-DNS deployments within the cluster and used the Ambassador Host source the first External-DNS to process the resource will create the record and not the one that was specified in the filter annotation.

I added the `filterByAnnotations` function so that it matched the same way the other sources have implemented annotation filtering. I didn't add the controller check only because I wanted to keep this change to implementing the annotationFilter.

Example: Create two External-DNS deployments 1 public and 1 private and set the Ambassador Host to use the public External-DNS using the annotation filter.

```
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns-private
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: external-dns-private
  template:
    metadata:
      labels:
        app: external-dns-private
      annotations:
        iam.amazonaws.com/role: {ARN} # AWS ARN role
    spec:
      serviceAccountName: external-dns
      containers:
      - name: external-dns
        image: k8s.gcr.io/external-dns/external-dns:latest
        args:
        - --source=ambassador-host
        - --domain-filter=example.net # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
        - --provider=aws
        - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
        - --aws-zone-type=private # only look at public hosted zones (valid values are public, private or no value for both)
        - --registry=txt
        - --txt-owner-id= {Hosted Zone ID} # Insert Route53 Hosted Zone ID here
        - --annotation-filter=kubernetes.io/ingress.class in (private)
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns-public
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: external-dns-public
  template:
    metadata:
      labels:
        app: external-dns-public
      annotations:
        iam.amazonaws.com/role: {ARN} # AWS ARN role
    spec:
      serviceAccountName: external-dns
      containers:
      - name: external-dns
        image: k8s.gcr.io/external-dns/external-dns:latest
        args:
        - --source=ambassador-host
        - --domain-filter=example.net # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
        - --provider=aws
        - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
        - --aws-zone-type= # only look at public hosted zones (valid values are public, private or no value for both)
        - --registry=txt
        - --txt-owner-id= {Hosted Zone ID} # Insert Route53 Hosted Zone ID here
        - --annotation-filter=kubernetes.io/ingress.class in (public)
---
apiVersion: getambassador.io/v3alpha1
  kind: Host
  metadata:
    name: your-hostname
    annotations:
      external-dns.ambassador-service: emissary-ingress/emissary
      kubernetes.io/ingress.class: public
  spec:
		acmeProvider:
      authority: none
		hostname: your-hostname.example.com
```

Fixes kubernetes-sigs/external-dns#2632

* Add Label filltering for Ambassador Host source

Currently the `--label-filter` flag can only be used to filter CRDs, Ingress, Service and Openshift Route objects which match the label selector passed through that flag. This change extends the functionality to the Ambassador Host type object.

When the flag is not specified the default value is `labels.Everything()` which is an empty string, the same as before. An annotation based filter is inefficient because the filtering has to be done in the controller instead of the API server like with label filtering. The Annotation based filtering has been left in for legacy reasons so the Ambassador Host source can be used inconjunction with the other sources that don't yet support label filltering.

It is possible to use label based filltering with annotation based filltering so you can initially filter by label then filter the returned hosts by annotation. This is not recomended

* Update Ambassador Host source docs

Add that the Ambassador Host source now supports both annotation and label filltering.
2024-08-28 18:02:57 +01:00
ThameezBo
e9968d839c
fix: update docs as per review 2024-07-14 14:17:55 +02:00
ThameezBo
fdb2475892
fix: docs 2024-05-13 22:42:16 +02:00
ThameezBo
bd33e5e277
feat: support dualstack Gateway route resources 2024-05-13 22:41:42 +02:00
Nandor Galambosi
d7b0dfd781 service source uses externalIPs in ExternalName type if available 2023-10-29 10:58:46 +01:00
Kubernetes Prow Robot
f0b6260012
Merge pull request #3940 from johngmyers/node-filter
Support --label-filter for node source
2023-09-26 16:55:44 -07:00
Kubernetes Prow Robot
9ad15cf76f
Merge pull request #3938 from johngmyers/internal-service
Use ServiceIP for ClusterIP Services with internal-hostname annotation
2023-09-26 16:55:37 -07:00
John Gardiner Myers
75639b759c Support --label-filter for node source 2023-09-20 08:56:26 -07:00
John Gardiner Myers
7044fdf040 Use ServiceIP for ClusterIP Services with internal-hostname annotation 2023-09-16 17:33:30 -07:00
John Gardiner Myers
6b230c6c44 Document the Gateway sources 2023-09-16 14:18:16 -07:00
John Gardiner Myers
77fe3a23c8 Switch from bulleted to numbered lists 2023-09-06 17:47:26 -07:00
John Gardiner Myers
47828f196e
Apply suggestions from code review
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2023-09-06 17:16:23 -07:00
John Gardiner Myers
da3fe0463c Document the Service source 2023-09-04 11:44:08 -07:00
John Gardiner Myers
0eb91e358d Document the Ingress source 2023-08-04 04:06:02 -07:00