-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Make kubernetes dns addon more configurable #55834
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
Conversation
Wouldn't this make any subsequent changes in Nix be ignored silently? |
@srhb Probably yes, but that's what you want if you have local changes. It's quite easy to track upstream changes:
|
I just worry that it's unintuitive from the perspective of NixOS. I'll let @johanot chime in though, since he's actually using Kubernetes in production, and I'm not. :) |
@srhb I'm running kubernetes in production, and I spent quite a few hours trying to come up with a sensible and stable workaround (like using dnsmasq on the host(s)) which would not require messing with the defaults. Nothing really worked out. So unfortunately this was the only practical solution left in the end. |
@juselius Isn't your usecase an argument for opting out of the kubernetes.dns module completely, i.e. |
@johanot Well, yes and no. It's much easier to track nixos when a) all you have to do is delete the deployment and configmap to get the new defaults b) ad you have a patch yaml for local changes. But I see the problem now. Everybody without local modifications end up in dire straits. Would a an option e.g. "allowLocalChanges" make the patch more palatable? |
Well yes - especially if the default behavior is preserved. I think it would be slightly prettier with e.g. |
@johanot Good idea! I'll post a new PR. |
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.
The more generic option, I think should have a more generic description as well. Consider something along the lines of:
description = ''
Controls the addon manager reconciliation mode for the DNS addon.
See: <link
xlink:href="https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/addon-manager/README.md"/>
'';
Thanks @johanot! |
@GrahamcOfBorg eval |
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.
LGTM now. Thanks @juselius
@juselius Can you please squash the entire changeset down to one commit? |
fb759f7
to
5e3bd31
Compare
@johanot done! |
Oh.. Sorry I didn't see this before. The commit message should be prefixed with |
reconcileMode = mkOption { | ||
description = '' | ||
Controls the addon manager reconciliation mode for the DNS addon. | ||
See: <link xlink:href="https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/addon-manager/README.md"/> |
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.
Mini-nitpick: Descriptions should end with a .
55c07e4
to
83d6447
Compare
I find usecases in PR description more compelling than current option description. For a new guy like me, it is not clear why this once setting is exported as NixOS option, but others are not. Another problem is that only some of "addons" allow this override. That looks a bit ad-hoc. Maybe note about that in option description as well? Otherwise it would require looking into module code to find out what this is for. |
Allow coredns ConfigMap and Depolyment to be editable by the user. An use case is augmenting the default, generated dns records with local services.
@danbst Good suggestion! I have added a line in the description about a use case. My opinion regarding the "ad-hocness" of the override, is that if you need it in the future, do it in the future. There is little point in adding options for things nobody will ever need, just for symmetry's sake. @johanot Shall we try to get this merged in, before it goes stale again? |
Thanks @danbst ! |
@juselius as for me PR description is still more clear about what this option is for. But maybe you k8s guys use some other language, so 🤷♂️ problem with me I guess. |
Allow coredns ConfigMap and Depolyment to be editable by the user. An use case is augmenting the default, generated dns records with local services.
backported |
Motivation for this change
Sometimes there is need to have greater control over the cluster DNS, for example augmenting it with additional service discovery (i.e. Consul), or adding DNS records for internal subdomains. With mode Reconcile, all local changes to the maps are instantly overwritten. Changing the Deployment and ConfigMap to EnsureExists allows the user the change the maps after installation.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)