-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
nixos/kubernetes: minor module fixes #56589
nixos/kubernetes: minor module fixes #56589
Conversation
re-ping @fpletz @calbrecht :-) |
He, the changes apply and it does not even rebuild the tests :) but i think they are sane nevertheless. |
@@ -10,7 +10,7 @@ let | |||
kind = "Config"; | |||
clusters = [{ | |||
name = "local"; | |||
cluster.certificate-authority = cfg.caFile; | |||
cluster.certificate-authority = if (hasAttr "caFile" conf) then conf.caFile else cfg.caFile; |
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.
Same as just conf.caFile or cfg.caFile
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.
@infinisil Right, thanks. Fixed now.
- mkDefault etcd instance name - make sure ca-cert in mkKubeConfig can be overriden - fix controller-manager "tls-private-key-file" flag name
01623c3
to
80c4fd4
Compare
Thanks @infinisil . Do you mind cherry-picking this to 19.03 please? Or should I create a new PR? |
Cherry-picked to release-19.03 in 5831fe1 :) |
Motivation for this change
While testing the revamped kubernetes module on our existing staging cluster with
easyCerts
disabled, I discovered some minor flaws in the module:The name of the etcd instance must be
mkDefault
'ed, because otherwise we risk overriding existing etcd cluster names, and that could potentially lead to cluster re-initiation on existing setups.It's currently not possible to use the
kubernetes.lib.mkKubeConfig
function to generate a kubeconfig with a custom ca. It will always use the toplevel ca cert. This is fine for current easyCerts setup, where we don't have multiple CA's, but in existing setups this might cause problems. WeTurns out adding TLS-server certs to the controller manager was never done as part of the revamp and therefore we never discovered that the
--tls-key-file
flag on kube-controller-manager was named incorrectly. Similar flag names differ across various k8s components, but in this case it must be--tls-private-key-file
. We should add TLS-serving certs to the controller-manager in another PR.cc @fpletz for review
please backport to 19.03 :)
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)