-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
kubernetes: add generic builder and kops stable versions #66496
Conversation
a062bcb
to
2f5070a
Compare
@GrahamcOfBorg build kubernetes kubernetes_1_13_5 |
2f5070a
to
99f6009
Compare
@GrahamcOfBorg eval |
Should I add some documentation re: |
Yes, but I wouldn't recommend writing it until you've got feedback and you're sure it's not going to change. Mostly to save you rewrites if you change anything. |
Specifics I'd like feedback on:
Thanks! |
Thanks, looks awesome, exactly what I need for refactored nixos kibernetes module I'm working on 😀 I will try it, and look into it, most likely during the weekend. |
I did some simplifications:
This is how you can build different versions of kubernetes and override different things, like go version:
|
Looks like kubernetes 1.15 has problems building, will have to take a look what is wrong. |
Ok, fixed kubernetes 1.15 builds, looks like i had to set |
I will make more explicit which binaries gets installed, as now we get a few of build time binaries in |
So old versions did not build, due to go-1_12 being used, but i think it's more than ok to have last 5 versions. @yurrriq @worldofpeace are you ok with changes? for explanation take a look here: #66496 (comment) I will do a rebase then and join some commits. |
@GrahamcOfBorg build kubernetes kubernetes_1_11 kubernetes_1_12 kubernetes_1_13 kubernetes_1_14 kubernetes_1_15 kubectl |
All good on not having patch specific versions in |
I did removed |
Changes look good to me. I think we should add some documentation with an override example. |
Hmm some builds failed on x86_64-linux, which is odd based on fact, that aarch64-linux builds succeed. |
@GrahamcOfBorg build kubernetes kubernetes_1_11 kubernetes_1_12 kubernetes_1_13 kubernetes_1_14 kubernetes_1_15 kubectl |
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.
Good work!.. However, the current RBAC and DNS-tests are broken for Kubernetes 1.15 at least? I think we better get these tests to pass before moving on. I'm vacationing on a very slow reserve laptop on a very slow connection, so I won't be able to help testing before Monday, sorry.
mk-docker-opts.sh
probably needs to be vendored for the default Flannel setup to work (unless we change that), since the script is no longer present in the kubernetes src tree. That's what I can think of right now; there might be more work needed for the tests to pass with v1.15 though.
Also, can you bump revisions again for 1.13.X, 1.14.X and 1.15.X - due to CVE-2019-9512 and CVE-2019-9514. I thiiink we aren't affected in Nix, since we inject the newest go-version, but still.
@@ -31,6 +31,10 @@ let | |||
|
|||
outputs = ["out" "man" "pause"]; | |||
|
|||
preBuild = '' | |||
export HOME=$PWD |
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.
It's go env
that breaks the sandbox. The problem can also be fixed with something like:
substituteInPlace "hack/lib/golang.sh" \
--replace 'echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"' 'echo "${go.GOOS}/${go.GOARCH}"'
Overriding $HOME is fine by me as well, but perhaps the above can help with the other build issues you are seeing?
@@ -55,12 +59,14 @@ let | |||
cp build/pause/pause "$pause/bin/pause" | |||
cp -R docs/man/man1 "$man/share/man" | |||
${optionalString ((builtins.compareVersions version "1.15") < 0) '' |
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.
Hmm. Our tests (and probably users) still depend on kube-addon-manager? The only thing you need to remove for 1.15 is namespace.yaml
.
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.
ok, didn't knew that
Thanks, @offlinehacker and @johanot. I'm on a work trip now too, and head home Saturday fwiw. Should be able to help once I'm back. |
@offlinehacker Sounds good! To be honest, my thoughts on the Kubernetes module of the future are... a bit more radical, perhaps. :-) I'm working on a proposal along the lines of:
Besides reducing the number of kubernetes NixOS options from ~145 to ~20, it will also become much easier to support many different versions of Kubernetes with the same module. In fact, I looked into 1.15 a bit further yesterday, and it looks like there's at least one option that has to be removed on the kubelet, since the Anyway.. This will definitely not happen for 19.09. So let's discuss that later.
Sure thing. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/kubernetes-the-nixos-module-of-the-future/3922/1 |
@offlinehacker I think we should discuss it further over at Discourse and see more fleshed out proposed solutions before doing anything to nixpkgs proper. |
We are using discourse regarding discussions regarding tickets? I mean what is the reason not discussing here? |
No strong reason either way, the discussion was just opened over there and is not tied to this pr specifically. I just don't want to merge this before we reach some sort of agreement. If you don't want to participate I'm happy to bring your opinions for you, if you tell me what they are. 😃 |
The discussion on Discourse, to me, seems only indirectly related to this, so I don't think we need to wait for consensus about the module there. |
30daa03
to
7c6d648
Compare
I rebased and squashed. |
- refactor generic builder - bump versions - fix build for k8s 1.15 - install completions only if kubelet component is enabled - explicit list binaries to install - only build last 5 versions - minor syntax changes
7c6d648
to
92442b4
Compare
@srhb agreed, will join the discussion, but it is more related to nixos module as i can see. I still think this pull request is unrelated to other developments as it is just improvement to package multiple versions of kubernetes. I'm just unaware if latest version from this pull requests works with fixes that @johanot implemented? I will have time during the weekend to test it out. |
I agree that this PR is at least tangential to the module discussion, but I don't want to accidentally imply that the module supports the versions of kubernetes in nixpkgs proper if we decide to keep on only supporting a single version. It might just require a bit more documentation. That said, now that I've been sort of forced to think about it, I am opposed to this PR in its entirety and think we should only keep the latest version in nixpkgs. If users have specific needs for older software, they can go ahead and override as needed. |
@srhb, can you explain the reasoning behind your opposition some more? To me, including the most recent patch versions of a few recent minor version (as we have it now) seems ideal. I think it's quite common that users will need different versions, and rather than have multiple ad hoc implementations of a generic builder, I think it would be better to have an "official" one. I also don't see a problem with include some known version/hash attrsets, especially those supported by kops, EKS, AKS, etc. If the community at large is opposed to this, I suppose I'll just keep it in my nur-packages. |
We would also need a support for multiple versions at @GateHubNet and @xtruder to have |
Also in gke you can select which version of kubernetes you want and the same is with some other tools like kubeadm and kops, so I cannot see why shouldn't we support multiple versions? |
I've also given this an extra thought. I think I agree on the argument that; if supporting older versions involves nothing else than overriding version and hash, I don't see why users cannot overlay as needed? I have no principled arguments against having multiple versions in nixpkgs, as long as we can guarantee that they're all stable and someone actively maintain them. Unfortunately, I don't have the time myself to guarantee the working order of all versions from 1.9 -> 1.15, nor can I say whether the NixOS module will be properly backward compatible. If possible, I'd prefer the NixOS module to be compatible with all nixpkgs-available package versions, and thus I think the module discussion is relevant. |
And I might have answer for that, I was working hard to make improvements to kubernetes nixos module, the current progress can be seen here: https://github.com/xtruder/nixpkgs/tree/nixos/kubernetes/refactoring that should also take into account multiple versions. Unfortunately I did not have time to make proper pull request 😕 I can see what I can do in following weekends, but I want to have tests for all versions of kubernetes that we have in nixpkgs, this would be ideal. |
Re: maintenance of versions. We can use (or enhance) this script to stay current with e.g. kops supported versions. https://github.com/NixOS/nixpkgs/blob/d89a311678b1f1cc7abd728c06d062f1465c97b9/pkgs/applications/networking/cluster/kubernetes/mkversions.sh |
I'm mostly worried about adding complexity that we can't easily bail out on currently. I would prefer that we crystallize a plan that takes into account the module as well as the packages. Right now, it seems several people are working on various proposals and PRs for kubernetes, and I would like to try and ensure that everything fits together very well, not just for a few releases, but hopefully for longer. I'm also not very fond of promoting kops to some sort of special truth for the nixpkgs ecosystem. It's not a big deal, but mostly just trying to gate everything with disclaimers that things might be changing soon. That said, I'm not strongly opposed to having multiple versions in nixpkgs -- at least not as strongly opposed as trying to make the module support several versions. I will not attempt to block your efforts here, but I do care that we take special care to ensure the module in whatever shape or form we decide upon in the coming months, is very well supported by the kubernetes package(s) in nixpkgs proper. :-) |
I chose kops arbitrarily, and agree it should not be given any special status. We should probably just include the latest patch versions of the last three minor versions, which are supported as per the k8s documentation: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-versions It would seem to me those three versions ought to be supported by the module as well. I still very much want an easy way to build specific versions locally, whether via generic builder or overrides. Perhaps this is already addressed by #67563 Thoughts? |
I'm undecided, i mean multiple version support might be helpful for us, but we will just use overlay if this will not get merged and there is decision to only support latest version. My thought is that nixpkgs monorepo has too much stuff anyway, and should be split and in that case having single version is reasonable decision. |
So, I think now the decision is either to include the three supported versions, and the generic builder, or close this PR. I'm pretty sure #67563 addressed my needs. |
Closing this as it seems like, collectively, we don't want to go this direction. Thanks to everyone for their feedback. |
Motivation for this change
Add generic builder for Kubernetes, and expressions for versions considered stable by kops.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)