feat(source): add unstructured source#6172
feat(source): add unstructured source#6172k8s-ci-robot merged 30 commits intokubernetes-sigs:masterfrom
Conversation
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Pull Request Test Coverage Report for Build 22279424154Details
💛 - Coveralls |
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
0489f54 to
995236f
Compare
c45dd7f to
78f2b7b
Compare
78f2b7b to
77e5091
Compare
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
|
That's a nice new feature. /lgtm |
|
I'll leave it for a week. Sure |
|
Hi @TomyLobo are you still using external-dns? How about to try this feature? This is related to your comment 2+ years ago #3490 (comment) |
|
This will require golang to be installed https://github.com/kubernetes-sigs/external-dns/blob/master/CONTRIBUTING.md#how-to-test-a-pr |
|
Hi @nazarewk how about to try this feature? |
Unfortunately I am not working at the original place anymore and won't have access to any external-dns deployment at least for a few weeks. I had an idea that you could maybe try to use it for the built-in resources, but through the new custom resource interface? |
|
Not a problem. Technically this new source should work with all current and future kubernetes resources. |
|
I've tested it with cluster-api --unstructured-resource=machines.v1beta2.cluster.x-k8s.io
--label-filter=cluster.x-k8s.io/control-plane=
--fqdn-template=< cluster domain >
--fqdn-target-template={{ range $address := .Status.addresses }}{{ if eq $address.type "ExternalIP"}}{{ $address.address }},{{ end }}{{ end }}Similar to this discussion: #5922 |
|
Nice one. Thank you |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ivankatliarchuk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does it do ?
A new unstructured source that creates DNS records from any Kubernetes custom resource using Go templates.
Supporting every possible ingress or product isn’t practical. For example, it’s fairly common to have custom products, and ExternalDNS doesn’t really fit that model today, as it doesn’t provide even basic support for custom sources.
Added flags
Motivation
We shouldn't have to wait for external-dns to add built-in support for some specific CRDs. With this source, they can point external-dns at any resource (KubeVirt VMs, Crossplane resources, MetalLB pools, etc.) and use templates to extract hostnames and targets from .spec or .status fields.
Fixes #3437
Fixes #5104
Fixes #5922
First attempt #3490. That was abandoned
More
I could slice this PR, move tests to another PR and 400+ lines in docs
Follow-up