{"repo":"justinas/nixos-ha-kubernetes","free":true,"listed":false,"github":"https://github.com/justinas/nixos-ha-kubernetes","clone":"git clone https://github.com/justinas/nixos-ha-kubernetes.git","description":"Toy highly-available Kubernetes cluster on NixOS","language":"Nix","stars":336,"topics":["nixos","kubernetes","kubernetes-cluster","nix","nixops","colmena","terraform"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"Toy highly-available Kubernetes cluster on NixOS About Motivation Architecture Goals Non-goals Trying it out Prerequisites Running Verifying Modifying Destroying Tips and tricks Contributing Acknowledgements About A recipe for a cluster of virtual machines managed by Terraform, running a highly-available Kubernetes cluster, deployed on NixOS using Colmena. Motivation NixOS provides a Kubernetes module, which is capable of running a master or worker node. The module even provides basic PKI, making running simple clusters easy. However, HA support is limited (see, for example, this comment and an empty section for \"N masters\" in NixOS wiki). This project serves as an example of using the NixOS Kubernetes module in an advanced way, setting up a cluster that is highly-available on all levels. Architecture External etcd topology, as described by Kubernetes docs, is implemented. The cluster consists of: 3 etcd nodes 3 controlplane nodes, running kube-apiserver , kube-controller-manager , and kube-scheduler . 2 worker nodes, running kubelet , kube-proxy , coredns , and a CNI network (currently flannel ). 2 loadbalancer nodes, running keepalived and haproxy , which proxies to the Kubernetes API. Goals All infrastructure declaratively managed by Terraform and Nix (Colmena). Zero kubectl apply -f foo.yaml invocations required to get a functional cluster. All the infrastructure-level services run directly on NixOS / systemd. Running k get pods -A after the cluster is spun up lists zero ","default_branch":null,"files":null,"tree":[],"storefront":"/r/justinas","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/justinas/nixos-ha-kubernetes/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}