stage #58
@@ -60,6 +60,12 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
nix.settings.trusted-users = [ "root" "micqdf" ];
|
nix.settings.trusted-users = [ "root" "micqdf" ];
|
||||||
|
nix.gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "daily";
|
||||||
|
options = "--delete-older-than 3d";
|
||||||
|
};
|
||||||
|
nix.settings.auto-optimise-store = true;
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
KUBECONFIG = "/etc/kubernetes/admin.conf";
|
KUBECONFIG = "/etc/kubernetes/admin.conf";
|
||||||
|
|||||||
@@ -141,6 +141,14 @@ prepare_remote_nix_trust() {
|
|||||||
remote "$node_ip" "sudo systemctl restart nix-daemon 2>/dev/null || true"
|
remote "$node_ip" "sudo systemctl restart nix-daemon 2>/dev/null || true"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepare_remote_space() {
|
||||||
|
local node_ip="$1"
|
||||||
|
echo "==> Reclaiming disk space on $node_ip"
|
||||||
|
remote "$node_ip" "sudo nix-collect-garbage -d || true"
|
||||||
|
remote "$node_ip" "sudo nix store gc || true"
|
||||||
|
remote "$node_ip" "sudo rm -rf /tmp/nix* /tmp/nixos-rebuild* || true"
|
||||||
|
}
|
||||||
|
|
||||||
populate_nodes
|
populate_nodes
|
||||||
prepare_known_hosts
|
prepare_known_hosts
|
||||||
export NIX_SSHOPTS="$SSH_OPTS"
|
export NIX_SSHOPTS="$SSH_OPTS"
|
||||||
@@ -155,11 +163,13 @@ detect_ssh_user "$PRIMARY_CP_IP"
|
|||||||
|
|
||||||
for node in "${CP_NAMES[@]}"; do
|
for node in "${CP_NAMES[@]}"; do
|
||||||
prepare_remote_nix_trust "${NODE_IPS[$node]}"
|
prepare_remote_nix_trust "${NODE_IPS[$node]}"
|
||||||
|
prepare_remote_space "${NODE_IPS[$node]}"
|
||||||
rebuild_node "$node" "${NODE_IPS[$node]}"
|
rebuild_node "$node" "${NODE_IPS[$node]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
for node in "${WK_NAMES[@]}"; do
|
for node in "${WK_NAMES[@]}"; do
|
||||||
prepare_remote_nix_trust "${NODE_IPS[$node]}"
|
prepare_remote_nix_trust "${NODE_IPS[$node]}"
|
||||||
|
prepare_remote_space "${NODE_IPS[$node]}"
|
||||||
rebuild_node "$node" "${NODE_IPS[$node]}"
|
rebuild_node "$node" "${NODE_IPS[$node]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ worker_vmid_start = 711
|
|||||||
|
|
||||||
control_plane_cores = 1
|
control_plane_cores = 1
|
||||||
control_plane_memory_mb = 4096
|
control_plane_memory_mb = 4096
|
||||||
control_plane_disk_size = "40G"
|
control_plane_disk_size = "80G"
|
||||||
|
|
||||||
worker_cores = [4, 4, 4]
|
worker_cores = [4, 4, 4]
|
||||||
worker_memory_mb = [12288, 12288, 12288]
|
worker_memory_mb = [12288, 12288, 12288]
|
||||||
worker_disk_size = "60G"
|
worker_disk_size = "120G"
|
||||||
|
|||||||
@@ -77,13 +77,13 @@ variable "worker_memory_mb" {
|
|||||||
|
|
||||||
variable "control_plane_disk_size" {
|
variable "control_plane_disk_size" {
|
||||||
type = string
|
type = string
|
||||||
default = "40G"
|
default = "80G"
|
||||||
description = "Disk size for control plane VMs"
|
description = "Disk size for control plane VMs"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_disk_size" {
|
variable "worker_disk_size" {
|
||||||
type = string
|
type = string
|
||||||
default = "60G"
|
default = "120G"
|
||||||
description = "Disk size for worker VMs"
|
description = "Disk size for worker VMs"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user