mirror of
https://github.com/MagicBOTAlex/nixos-server.git
synced 2026-02-04 05:39:18 +01:00
36 lines
1.1 KiB
Nix
36 lines
1.1 KiB
Nix
{ config, pkgs, ... }:
|
|
let
|
|
# When using easyCerts=true the IP Address must resolve to the master on creation.
|
|
# So use simply 127.0.0.1 in that case. Otherwise you will have errors like this https://github.com/NixOS/nixpkgs/issues/59364
|
|
kubeMasterIP = "176.23.63.215";
|
|
kubeMasterHostname = "clussy.deprived.dev";
|
|
kubeMasterAPIServerPort = 6443;
|
|
in
|
|
{
|
|
# resolve master hostname
|
|
networking.extraHosts = "${kubeMasterIP} ${kubeMasterHostname}";
|
|
networking.firewall.enable = false;
|
|
|
|
# packages for administration tasks
|
|
environment.systemPackages = with pkgs; [ kompose kubectl kubernetes ];
|
|
|
|
services.kubernetes = {
|
|
roles = [ "master" "node" ];
|
|
masterAddress = kubeMasterHostname;
|
|
apiserverAddress =
|
|
"https://${kubeMasterHostname}:${toString kubeMasterAPIServerPort}";
|
|
easyCerts = true;
|
|
apiserver = {
|
|
securePort = kubeMasterAPIServerPort;
|
|
advertiseAddress = kubeMasterIP;
|
|
};
|
|
|
|
flannel.enable = true;
|
|
|
|
# use coredns
|
|
addons.dns.enable = true;
|
|
|
|
# needed if you use swap
|
|
kubelet.extraOpts = "--fail-swap-on=false";
|
|
};
|
|
}
|