Isaiah spin up
Bring Isaiah back into commission, this time as the core of my k3s cluster. Standing up the basic serverInit, and also creating the core server components that are needed.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
top,
|
||||
...
|
||||
}:
|
||||
@@ -38,16 +37,8 @@
|
||||
supportedFilesystems = [ "ntfs" ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
gawk
|
||||
git
|
||||
unzip
|
||||
wget
|
||||
zstd
|
||||
];
|
||||
|
||||
greg = {
|
||||
kubernetes.enable = true;
|
||||
tailscale.enable = true;
|
||||
remote-builder.enable = true;
|
||||
};
|
||||
@@ -93,13 +84,6 @@
|
||||
useDHCP = false;
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [ "nodejs-16.20.2" ];
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
gitlab-runner = {
|
||||
enable = true;
|
||||
@@ -133,50 +117,21 @@
|
||||
"/cache"
|
||||
];
|
||||
};
|
||||
# qemu = {
|
||||
# executor = "shell";
|
||||
# limit = 5;
|
||||
# authenticationTokenConfigFile = config.age.secrets.runner-qemu.path;
|
||||
# environmentVariables = {
|
||||
# EFI_DIR = "${pkgs.OVMF.fd}/FV/";
|
||||
# STORAGE_URL = "s3.thehellings.lan:9000";
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
k3s.clusterInit = true; # This is the first node in the cluster
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings.PermitRootLogin = "yes";
|
||||
};
|
||||
proxmox-ve = {
|
||||
enable = true;
|
||||
ipAddress = (builtins.elemAt config.networking.interfaces.br0.ipv4.addresses 0).address;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = lib.mkForce "24.05";
|
||||
|
||||
systemd.services.gitlab-runner = {
|
||||
after = [ "network-online.target" ];
|
||||
requires = [ "network-online.target" ];
|
||||
};
|
||||
|
||||
users = {
|
||||
users = {
|
||||
greg = {
|
||||
extraGroups = [
|
||||
"kvm"
|
||||
"libvirtd"
|
||||
"sudo"
|
||||
"wheel"
|
||||
];
|
||||
isNormalUser = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
podman.enable = true;
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
allowedBridges = [
|
||||
@@ -186,6 +141,5 @@
|
||||
onBoot = "ignore"; # only restart VMs labeled 'autostart'
|
||||
qemu.ovmf.enable = true;
|
||||
};
|
||||
oci-containers.backend = "podman";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -103,8 +103,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [ "ventoy-1.1.05" ];
|
||||
|
||||
programs = {
|
||||
adb.enable = true;
|
||||
steam.enable = true;
|
||||
|
||||
@@ -55,6 +55,6 @@
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
allowUnfreePredicate = _: true;
|
||||
permittedInsecurePackages = [ "jitsi-meet-1.0.8043" ];
|
||||
permittedInsecurePackages = [ "ventoy-1.1.05" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
./home.nix
|
||||
./kde.nix
|
||||
./kiwix-serve.nix
|
||||
./kubernetes.nix
|
||||
./linode.nix
|
||||
./podman.nix
|
||||
./print.nix
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.greg.kubernetes;
|
||||
in
|
||||
{
|
||||
options.greg = {
|
||||
kubernetes = {
|
||||
enable = lib.mkEnableOption "kubernetes";
|
||||
agentOnly = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to run the Kubernetes agent only";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
age.secrets.kubernetesToken.file = ../../secrets/kubernetes/kubernetesToken.age;
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 6443 ];
|
||||
allowedUDPPorts = [ 8472 ];
|
||||
};
|
||||
|
||||
services.k3s = {
|
||||
enable = true;
|
||||
role = if cfg.agentOnly then "agent" else "server";
|
||||
tokenFile = config.age.secrets.kubernetesToken.path;
|
||||
serverAddr = lib.mkIf (config.networking.hostName != "isaiah") "https://isaiah.home:6443";
|
||||
};
|
||||
};
|
||||
}
|
||||
Binary file not shown.
@@ -105,4 +105,10 @@ in
|
||||
|
||||
"minio_secret_access_key.age".publicKeys = everyone;
|
||||
"minio_access_key_id.age".publicKeys = everyone;
|
||||
|
||||
"kubernetes/kubernetesToken.age".publicKeys = [
|
||||
isaiah
|
||||
user_isaiah
|
||||
user_jude
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user