kubernetes, bare metaling

This commit is contained in:
BOTAlex 2026-05-07 13:47:57 +02:00
parent fc6edfa41b
commit 1409710022
10 changed files with 253 additions and 156 deletions

View file

@ -45,6 +45,8 @@
microvm = {
# Choose your hypervisor: "qemu", "firecracker", "cloud-hypervisor", etc.
hypervisor = "qemu";
vcpu = 8;
mem = 8192 / 3;
# Create a tap interface or user networking
interfaces = [{
@ -65,11 +67,28 @@
volumes = [{
image = "/var/lib/microvms/kube-vm/kube-vm.img";
mountPoint = "/";
size = 512 * 4; # Size in MB
size = 512 * 8; # Size in MB
}];
};
boot.kernelModules = [ "br_netfilter" ];
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
};
systemd.services."load-kernel-modules" = {
enable = true;
description = "Modprobe kernel modules";
# before = [ "flannel.service" ];
wantedBy = [
"multi-user.target"
# "flannel.service"
];
script = ''
${pkgs.kmod}/bin/modprobe br_netfilter
'';
};
networking = {
hostName = "kube-vm";

View file

@ -1,28 +0,0 @@
{ pkgs, ... }:
{
systemd.services.kubelet = {
description = "kubelet: The Kubernetes Node Agent";
documentation = [ "https://kubernetes.io/docs/home/" ];
# Unit requirements
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
# Use the kubelet binary from the Nix store
ExecStart = "${pkgs.kubernetes}/bin/kubelet";
Restart = "always";
RestartSec = 10;
};
# Systemd 230+ uses StartLimitIntervalSec in the [Unit] section
unitConfig = {
StartLimitIntervalSec = 0;
};
# Equivalent to [Install] WantedBy
wantedBy = [ "multi-user.target" ];
};
}

View file

@ -1,4 +0,0 @@
{ pkgs, ... }: {
imports = [ ./kublet.nix ];
environment.systemPackages = with pkgs; [ kubernetes ];
}