nix-config/hosts/heather/k3s.nix
mikl 79260cec6f heather: switch to make-disk-image (qcow2 for YC), drop disko
- Rename muscari -> heather (YC VM). rosemary reserved for future EU server.
- Add hosts/heather/image.nix: YC guest profile + qcow2 build target based on
  nixos/lib/make-disk-image.nix (the nixpkgs-standard cloud image builder).
  partitionTableType=legacy (MBR + single ext4 root, label nixos), GRUB in MBR
  on /dev/vda, virtio drivers, console=ttyS0, cloud-init (Ec2 datasource) so
  poppy ssh key auto-lands from YC metadata, growPartition.
- Drop disko flake input + disk-config.nix (was only for nixos-anywhere runtime
  install; replaced by make-disk-image build-time approach, no kexec).
- Add home/server.nix: minimal headless home for NixOS hosts (no ollama/
  texliveFull/kitty/syncthing/pass). flake mkNixos uses it instead of full ./home.
- k3s.nix: drop dead firewall block (firewall off in image.nix -> trustedInterfaces
  was a no-op). Cilium manages pod networking via BPF.
- image.baseName=heather, configurationLimit=1, remove virtio dups (qemu-guest
  profile already provides most).
- Fix sha256 pin on forgejo mikl.keys (was stale, would break fetchurl).
- home/zsh.nix: source yandex-cloud yc completion.
2026-07-11 21:13:38 +03:00

34 lines
No EOL
1.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# k3s daemon для heather (single-node + Cilium CNI)
# Traefik и servicelb остаются включены (встроенные в k3s)
# Cilium ставится отдельно через Helm после старта k3s
{ config, pkgs, lib, ... }:
{
services.k3s = {
enable = true;
extraFlags = [
# CNI: отключаем встроенный flannel, ставим Cilium отдельно
"--flannel-backend=none"
"--disable-network-policy" # Cilium сам делает network policy
# CIDR для подов и сервисов (default для k3s, но фиксируем явно)
"--cluster-cidr=10.42.0.0/16"
"--service-cidr=10.43.0.0/16"
# TLS SANs для kubectl (если подключаемся не только по IP)
"--tls-san=heather.iscg.dev"
];
};
# Firewall выключен в ./image.nix (полагаемся на YC Security Groups).
# Cilium управляет pod-сетью через BPF, локальный iptables-firewall ему
# только мешает — поэтому блок trustedInterfaces/checkReversePath не нужен.
# k3s-specific пакеты (НЕ в common — только для хостов с k3s)
environment.systemPackages = with pkgs; [
kubectl
kubernetes-helm
kustomize
sops # для шифрования k8s secrets (если будем через SOPS)
];
}