-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] annotations for hostnames and without-namespace for services #22
base: master
Are you sure you want to change the base?
Conversation
9961014
to
d98940d
Compare
Additional note, looking at PTR handling there are obvsiouly conflicts in the PTR records generated. Only one can be relevant so advertising multiples in MDNS may have unpredictable behaviour. |
d98940d
to
93417fa
Compare
correction pushed to the refactor commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just fixed some typos
blake/external-mdns#22 Signed-off-by: Tom Plant <[email protected]>
@pl4nty thanks so much! I really, really appreciate your review! |
93417fa
to
427ee8e
Compare
427ee8e
to
8eb4874
Compare
@blake to ensure compatibility with the new changes merged for the security update I've cherry picked @Stelminator and my updates merged to master to this branch so any builds off it should work fine with the new suggested configs. For this reason, at merge time you might not want to squash as the original commit IDs of these cherry-picked changes will be relevant. If this is a problem, post test I can rewind the head of this branch and force push again for you to squash as normal. |
Actually, I'll reorder these commits tonight so the cherry-picked ones appear first and they should disappear from the MR. |
Switch to your branch and run |
2b32508
to
189d070
Compare
Of course!, I'm always wary of just doing that our Gitlab instance at work is finicky about merge commits entering branches and rejects anything on the branch at push time if it doesn't have a Jira ticket but I suppose if they are already merged to master then it won't get pushed. |
Take your time and review, I'm happy with the version with these changes on my home lab so probably won't check back so much but if you want any changes etc. please just reach out and I'll be happy to take a look. |
@iamasmith is your image public? I'd like to use it until this merges |
@pl4nty it's not at the moment, it's only in my home lab repo. I'll see if I can push it up to ghcr soon if you like, it's currently built only for amd64 but I can add an arm64 build and combine them. EDIT looks like this one I only built for the amd64 nodes at the moment. |
thanks, I'd appreciate that. most of my nodes are arm64, but I have an amd64 node if needed |
I'll have to spend some time working out what PAT permissions to use. I'm not using Github actions, my build runners run off Gitlab. |
@pl4nty I've built the arm64 image as well as amd64 now, pushed them both up and joined them into a multi-arch image at ghcr.io/iamasmith/external-mdns - both archs seem to run fine on my lab clusters - HTH
|
Apologies for the delay, the Mrs wanted to go out for a walk first. |
just checking in @pl4nty to see how you are getting on..? |
@iamasmith thanks for publishing the image, it's been stable for a few months now. I even implemented DNS-SD on the weekend - might PR if it's a good fit for the project |
@iamasmith thanks for working on this! I'm using Traefik 3 with Gateway API enabled. I expose a number of services in the cluster, and Traefik sits in front of them with HTTPRoutes defined for each service. Traefik is responsible for handling TLS termination with cert-manager and pointing at the correct service based on the DNS hostname in the request. Only one LoadBalancer type Service actually exists though, so installing the standard version of external-mdns results in only |
@strophy yes, that's exactly what I added the feature for although my ingress is an istio gateway (which is actually just a service and deployment with it's own Gateway/Ingress type API) however. Annotations go on the service of course. |
Based on the PR by @pl4nty this goes further.
Hostnames annotation feature for services
Instead of a single hostname we add an annotation external-mdns.blakecovarrubias.com/hostnames which can take a comma separated string if present listing short hostnames.
e.g.
Advertising a single name
Advertises the usual foo.foospace.local and foo-foospace.local names instead of myservice.foospace.local
Advertising two names
Advertises the usual foo.foospace.local, foo-foospace.local, bar.foospace.local and bar-foospace.local names instead of myservice.foospace.local
Selective without-namespace annotaton for services
Additionally an annotation external-mdns.blakecovarrubias.com/without-default can be used to conditionally advertise the name as .local mimicing the global option but controlled for the specific service. This annotation is independent of the first annotation giving more flexibility in being able to use without-default less globally. I chose this name to be synonymous with the global value.
e.g.
Use on it's own
Causes myservice.local to be additionally advertised alongside myservice.foospace.local and myservice-foospace.local.
Combined use with single hostname
Advertises the usual foo.local, foo.foospace.local, foo-foospace.local names instead of myservice.foospace.local etc.
Comments
Noting, my instinct would have been not to publish the namespaced based records when using without-namespace but to retain backward compatibility I chose not to change this behaviour and not to further increase the MR by adding a second control for this.
This should cater as a solid workaround for advertising TCP based ingress rules and services behind an Istio Gateway as mentioned in #21
The PR is separated into 4 commits to ease review.
Feedback please, quite happy to alter as requested :)