-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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: extract module from nixpkgs into out-of-tree flake #115179
Comments
I am a big fan of this model (full disclosure, @johanot and I have discussed this out of band as we're coworkers) I think the more ambitious options especially need to live outside of nixpkgs allowing the nixpkgs module itself to become a tightly coupled but thin wrapper to k8s itself. I would love to see interest in this issue, so we know we're not just "going rogue" with this idea. |
We already discussed this some time ago in https://discourse.nixos.org/t/kubernetes-the-nixos-module-of-the-future/3922. I'm still in favor of this approach, so +1 from my side. 😊 |
Thanks @saschagrunert! I already forgot all about that discourse thread :) |
Do you think it's possible to have the repository living within the NixOS org? cc @vdemeester (to get possible other contributors onboard) |
I too had forgotten that... 😱 Anyway, to get the ball rolling, I'd like to suggest a starting approach. Let's create a repo (we can always transfer it to nixos community afterwards) containing the simplified, barebones "nixpkgs module" of the future. That way we can start work together by simply disabling the in-tree module and using the "vendored" one. Eventually we'll have that and the "high level" module or modules, and we can merge the barebones one back into nixpkgs. |
As a user of (significantly forked and hacked) k8s nixos machinery, my (unrequested) kneejerk reaction/opinion is: I'm not a fan of fragmenting nixpkgs, but that's a general issue I have with flakes. But this is not a discussion fit for this issue, if flakes are now mainstream then there's no sense in me pushing back. However, if this means we finally get to implement a clean split between 'barebones, low-level, thin wrapper modules' and 'high-level nixos machinery for opinionated clusters', then let's do this. If time permits, I would love to contribute to this new barebones set of modules, as this would let me unfork some of hscloud's kubernetes code. |
/cc @adrian-gierakowski for his recent involvement in kubenix. (fyi) I'm very much un favor of this proposal! I'd also like to see room over there for a k3s based implentation (and why not k3os based on nix modules, but we can enter those discussion later on the target repo). also /cc @colemickens (fyi) Name: "kubernetix"? Goes well along with "kubenix"... (Well, just pick one, let's not discuss this here 😉 ) |
@johanot did you make progress on this? I'm still very much interested in a |
Is anybody using the NixOS Kubernetes module? It doesn't seem to be fit for purpose in its current state. Regardless of the flakes argument, there is value in using a 3rd-party repository to explore different designs. Having to keep back-compat inside of nixpkgs can become too constraining to find the right design. |
i'd love to use nix-shell to install kubernetes dependencies, but alas, they (kubectl, kubeadm, docker, k3s) require sudo, which doesn't work in nix shell.
Anybody know a workaround to run kubernetes (or any sudo stuff) in nix-shell? (legit clusters, not local practice toys) is NixOS required to use sudo with nix? |
You can do |
Commenting here to say I use kubernetes on NixOS in my homelab nd would be happy to test the flake. My setup is pretty standard, but more testing can't hurt! |
I started trying to revive Without a split-second of doubt, I'd consider Please @johanot and colleagues, feel wholeheartedly welcome. I need no fame, so moving into a neutral place at the earliest convenience is already an imperative I'm aware of. If I might add, I'm currently stuck at debugging flaky tests due to blaggacao/kubenix#5 (help please!) 😉 |
I am not exactly favourable to this approach. Nixpkgs is a mono-repo; pulling a module out of it defeats the mono-repo. On the other hand, IIANW it is possible to create flakes inside flakes, the same way NixOS lives inside Nixpkgs. There is no necessity to create a git repo for it. |
LDTMRT: Let's defeat the mono-repo then. 😉 Jokes aside: in my opinion, the abstract benefits of a mono-repo are not compensating the concrete pains (described by various individuals above) with the in-tree kubernetes implementation. |
Maintaining the resulting flake in the same git repo is unfeasible? |
To be clear, I absolutely am fan of the nixpkgs monorepo and want to preserve it. What has been painful is trying to settle on the right design while remaining reasonably backwards-compatible. In my mind that would be easier done on top of a (very slim) NixOS (in nixpkgs) module that deals basically only with rendering configuration to the various components. This "outer layer" needn't really live out of tree, but it does need different names, and it would be nice to not opt-in to a proper deprecation cycle immediately. No one has had the time to do this anyway, but the various perspectives are helpful. :) |
Out of curiosity, are there already ideas around how such would look like? |
I am also a big fan of monorepo and if possible I would like to continue within nixpkgs, anyway having a host based on NixOS running would be perfect, IMHO it would be the best OS within a selfhosted / onpremise environment. I am still learning from Nix, but regardless of the outcome of this discussion I would like to participate as much as possible making the k8s infrastructure possible on the nix. |
We are pursuing this with https://github.com/divnix/devos and I already put the kubernetes packages in-tree on So if people can agree on that they would not oppose to make the first step towards this issue on What do you guys think? Do we have a gentlemen agreement? |
I marked this as stale due to inactivity. → More info |
Up! |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/kubernetes-on-nix-community-organization/20457/11 |
Issue description
Perhaps this issue overflows with ambition, but I'd like to propose that we once and for all aim to get the current fully-managed Kubernetes module to live its life separately from nixpkgs.
My motivation behind this:
This also serves as a personal excuse for myself a least to get fully onboard with the flake-paradigm.
I hope this proposal can gain traction with NixOS 21.11 as target, making 21.05 the last release with the in-tree Kubernetes module.
Please let me hear your thoughts and concerns.
cc @srhb @saschagrunert @zowoq @blaggacao
The text was updated successfully, but these errors were encountered: