Setting up Kubernetes on NixOS

4/22/2018

On NixOS is is easy to set up Kubernetes by a single line of config:

services.kubernetes.roles = ["master" "node"];

This installs both the master and node components on the local system and therefore creates a nice little working local kubernetes "cluster".

If I want to set up a "real" cluster I need to install it over multiple hosts, but I'm not sure about the intended way to connect them.

If I install only the master components on one host and only the node components on another node, how do I tell the node where to find its master?

There are quite a few configuration options, but I'm not sure how to use them correctly. Is anyone aware of some example setup?

-- michas
kubernetes
nixos

2 Answers

4/22/2018

Have a look at the latter part of Jaka Hudoklin/offlinehacker's NixCon '15 presentation about Kubernetes on NixOS at GateHub. It has an example configuration that configures docker to use a bridge interface. You can then use openvswitch to link the networks together.

-- Robert Hensing
Source: StackOverflow

5/20/2018

I'm currently working to automate Kubernetes deployment with NixOS / NixOps. It works quiet well with multiple local VirtualBox nodes. Regarding AWS integration I still have to fix few things. Then I will try to integrate with other cloud providers.

You can have a look to this repository: NixOps Kubernetes. Do not hesitate to fork and help me improve it.

-- Thomas Pham
Source: StackOverflow