Last active
April 6, 2020 19:20
-
-
Save michalhosna/a67287cb269aff0406cdfb0222209ed9 to your computer and use it in GitHub Desktop.
Nix for kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { config, pkgs, ... }: | |
| let | |
| kubeMasterHostname = "master.boson"; | |
| kubeMasterAPIServerPort = 8443; | |
| in | |
| { | |
| imports = | |
| [ # Include the results of the hardware scan. | |
| ./hardware-configuration.nix | |
| ]; | |
| boot.loader.grub = { | |
| enable = true; | |
| version = 2; | |
| device = "/dev/sda"; | |
| }; | |
| networking.interfaces.ens18.useDHCP = true; | |
| networking.hostName = kubeMasterHostname; | |
| time.timeZone = "Europe/Prague"; | |
| environment.systemPackages = with pkgs; [ | |
| curl | |
| vim | |
| kubectl | |
| kubernetes | |
| ]; | |
| services.openssh.enable = true; | |
| users.users.root.openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE16tyPtsIHOPzwbYIZCJ1iRJOYQMyloscgvq4Kq4RoU Michal Hošna<mh@michalhosna>"]; | |
| networking.firewall.enable = false; | |
| services.kubernetes = { | |
| roles = ["master" "node"]; | |
| masterAddress = kubeMasterHostname; | |
| easyCerts = true; | |
| apiserver = { | |
| securePort = kubeMasterAPIServerPort; | |
| #advertiseAddress = kubeMasterIP; | |
| }; | |
| # use coredns | |
| addons.dns.enable = true; | |
| }; | |
| services.qemuGuest.enable = true; | |
| system.stateVersion = "19.09"; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment