{`-`} has joined #nixos-kubernetes
<ixxie> cheers!
<ixxie> srhb: I am trying to get around https://github.com/NixOS/nixpkgs/issues/43395
<ixxie> I guess I need to specify a certificate / authority but me being quite the noob I am not quite sure how
<srhb> ixxie: Why not use johanots module? It takes care of all that for you
<srhb> Oh, actually, prereqs are missing merge still. Meh.
<ixxie> srhb: which module?
<ixxie> you mean the one available in nixpkgs?
<ixxie> I guess I am asking which options I need to set
<srhb> ixxie: I mean johanots revamped module with automatic TLS/RBAC bootstrapping.
<srhb> The module as-is in unstable is a bit cumbersome to set up, especially securely..
johanot has joined #nixos-kubernetes
<ixxie> so you mean the PR that is in progress?
<srhb> Yes.
<ixxie> alright, I can give it a shot :)
<srhb> But I realized it's a bit more cumbersome since the certmgr/cfssl PRs also aren't in yet.
<ixxie> maybe I will just wait for the merge
<ixxie> its not like I am in a rush or anything
<srhb> johanot: Is there a happy path for testing the new module now that everything is split into several PRs?
<srhb> This might also help speed the review along
<srhb> And ixxie wants a functioning cluster :P
<srhb> (Meaning, can you do a quick nixos-unstable-based branch? :-P)
<johanot> heeellooo srhb and ixxie :) I can do a branch, of course.. With the certmgr patch rebased in as well?
<johanot> (I tried pinging another cloudflare person today, hope it works)
<ixxie> cool
<ixxie> then I guess I could be a guinea pig in exchange for you guys teaching me Zen & the Art of Kubernixos
<johanot> hehe.. deal!
<ixxie> but now is bed time for me, and I am beat
<ixxie> now that there is a log in place I will be able to backtrack all discussions here
<ixxie> johanot: since you missed it - https://logs.nix.samueldr.com/nixos-kubernetes
<srhb> (Thanks samueldr :))
<ixxie> indeed!
<johanot> great! :) thanks samueldr, indeed
<ixxie> so I before I go... I was wondering....
<ixxie> do you use helm with your NixOS Kube clusters?
<johanot> my colleagues do, I don't.. afaik helm/tiller works fine in "kubernixos"
<ixxie> so you just package whatever you need in Nix?
<johanot> oh wait I don't anything about any nix'y way of managing helm charts. I think my colleagues keep helm packages and nix separated. I can ask in the office tomorrow
<johanot> know anything*
<ixxie> cheers johanot!
<ixxie> I will give it a shot in the coming days
<johanot> great.. I'll try to be better to look for news in here, for my part :)
<ixxie> johanot: I didn't mean Nixified helm charts, I meant if I need to extend the system it seems most people use helm normally
<ixxie> so I was wondering how you do it (beyond containers of course)
<ixxie> I noticed this 'operator' pattern as well
<ixxie> its kinda tricky when you are learning some complex like Kubernetes and you ALSO need to learn how to do in on NixOS
<ixxie> so you google around and you see typically the general solutions but maybe its impossible/bad-practice on NixOS
<johanot> ixxie: I don't know that much about helm, but I could find someone who do maybe and invite them here tomorrow. Other than helm, we have sort of an extended/forked version of the kube-addon-manager (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/addon-manager)
<johanot> .. to which we supply manifests
<ixxie> johanot: well, no stress about that; I was just curious. I could start with my own simple deployment patterns, and try out your addon-manager
<ixxie> first thing first is learning basics of the cluster mgmt
<johanot> The official kube-addon-manager is part of the NixOS module now, but it is kinda limited, because it only allows for addons in the kube-system namespace
<johanot> btw. if you look at it, it is nothing more than a simple bash loop that runs "kubectl apply -f <manifest>; sleep XX;"
<ixxie> so you can just drop manifests somewhere and they get deployed
<ixxie> why not put them all in a big directory and do "kubectl apply -R -f dir/"?
<ixxie> along with your own manifests that is?
<johanot> we have our own internal option-set (not part of the upstream module) like this: "k8s.manifests = { my-deploy = { apiVersion = "v1"; kind = "Deployment; ... }; }; .. and then our "addon-manager" runs pkgs.writeText builtins.toJSON .. so the generated json manifests ends up in the store. Then we generate one systemd unit per manifest, actually. To have flexibility in "stopping/starting"
<johanot> individual addons.
<johanot> big disclaimer: this is far from optimal, which is why we haven't upstreamed it (at least yet) :P
<ixxie> so the service does something like "kubectl apply -f manifest.json" and "kubectl delete -f manifest.json"?
<johanot> ixxie: yes
<ixxie> nice
<johanot> AND you get systemd depedency chains for free, i.e. manifest A requires manifest B etc.
<ixxie> and I guess the main upshot is being able to wrap kubernetes objects in nixos services?
<ixxie> because the manifests could already be quite declarative
<ixxie> but of course normally without a language as expressive as Nix
<ixxie> johanot: for your branch, I can just do `services.kubernetes.roles = [ "master" "node" ];` and I should be good to go?
<johanot> right.. but i'm still not 100% satisfied :P it does not prevent someone imperatively modifying your cluster object, even though you created them in a declarative manner (for example).
<ixxie> yeah
<johanot> ixxie: Yes.. You'll need "services.kubernetes.masterAddress" as well
<johanot> 1 sec
<ixxie> I can see your motivation, and your approach seems cool
<johanot> and "easyCerts = true"
<johanot> ?
<johanot> "nixos-1" is the master, 2 and 3 are nodes
<johanot> should work with a single master+node cluster as well though
<ixxie> awesome johanot! I have been looking for a minimal example for ages
<ixxie> I will try to modify it for my machine in the coming days
<johanot> ixxie: cool. I did setup nixos-1 -> nixos-3 for the purpose of this PR only, so they should be useful :)
<ixxie> sweet
<ixxie> I am planning to write up a nixos.wiki article after I get my bearings, maybe I could use that as an example?
<johanot> ixxie: sure! I think I checked the repo for secrets before pushing :P
<ixxie> I have a 1001 more questions but that is for another Nixian night
<ixxie> so thanks again johanot & srhb and see you here again soon
<srhb> o/
ixxie has quit [Quit: Lost terminal]
johanot has quit [Quit: leaving]