mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-12-01 18:33:56 +01:00
chore: remove the never-deployed k3s-prod-1 cluster (#284)
It was never bootstrapped (no flux deploy key, VMs commented out since
2024-10) and only carried a stale duplicate of the test cluster's config.
- hosts/k8s/k3s-prod-1-{master,worker}-{1,2,3} + flake outputs + the home module
- the k3s-prod-1-token agenix entry (the .age file lives in the private secrets repo)
- the k3s-prod-1-* IPs, the offlineHosts entries, the Justfile recipes and the docs
This commit is contained in:
1 parent
a4609501c4
commit
01c6b3290a
23 files changed
+20
-557
No files matched your search
+1
-2
@@ -42,8 +42,7 @@ Named after "Twelve Kingdoms":
|
||||
#### `k8s` - Kubernetes Infrastructure
|
||||
|
||||
- **KubeVirt Cluster**: 3 physical mini PCs (shoryu, shushou, youko) running all VMs
|
||||
- **K3s Production**: 3 masters + 3 workers for production workloads
|
||||
- **K3s Testing**: 3 masters for testing and development
|
||||
- **K3s Testing**: 3 masters + 3 workers for testing and development
|
||||
|
||||
### External Systems
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Powered-off hosts (SBCs, k3s-prod-1) plus shoukei (exporter disabled on the
|
||||
# Powered-off hosts (SBCs) plus shoukei (exporter disabled on the
|
||||
# machine); remove entries when they come back online.
|
||||
offlineHosts = [
|
||||
"shoukei"
|
||||
@@ -15,12 +15,6 @@ let
|
||||
"chiaya"
|
||||
"rakushun"
|
||||
"mitsuha"
|
||||
"k3s-prod-1-master-1"
|
||||
"k3s-prod-1-master-2"
|
||||
"k3s-prod-1-master-3"
|
||||
"k3s-prod-1-worker-1"
|
||||
"k3s-prod-1-worker-2"
|
||||
"k3s-prod-1-worker-3"
|
||||
];
|
||||
in
|
||||
{
|
||||
|
||||
+9
-14
@@ -2,7 +2,7 @@
|
||||
|
||||
> WIP, not finished yet.
|
||||
|
||||
I'm running two Kubernetes clusters, one for production and one for testing.
|
||||
I'm running a Kubernetes cluster for testing and development.
|
||||
|
||||
I prefer to use [k3s] as the Kubernetes distribution, because it's lightweight, easy to install, and
|
||||
full featured(see [what-have-k3s-removed-from-upstream-kubernetes] for details).
|
||||
@@ -17,21 +17,16 @@ cluster, including other Kubernetes clusters.
|
||||
|
||||
## K3s Clusters
|
||||
|
||||
Clusters running as virtual machines on the KubeVirt cluster, for testing and production.
|
||||
Clusters running as virtual machines on the KubeVirt cluster, for testing and development.
|
||||
|
||||

|
||||

|
||||
|
||||
1. For production:
|
||||
1. `k3s-prod-1-master-1`
|
||||
1. `k3s-prod-1-master-2`
|
||||
1. `k3s-prod-1-master-3`
|
||||
1. `k3s-prod-1-worker-1`
|
||||
1. `k3s-prod-1-worker-2`
|
||||
1. `k3s-prod-1-worker-3`
|
||||
1. For testing:
|
||||
1. `k3s-test-1-master-1`
|
||||
2. `k3s-test-1-master-2`
|
||||
3. `k3s-test-1-master-3`
|
||||
1. `k3s-test-1-master-1`
|
||||
1. `k3s-test-1-master-2`
|
||||
1. `k3s-test-1-master-3`
|
||||
1. `k3s-test-1-worker-1`
|
||||
1. `k3s-test-1-worker-2`
|
||||
1. `k3s-test-1-worker-3`
|
||||
|
||||
## Kubernetes Resources
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
myvars,
|
||||
mylib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "k3s-prod-1-master-1"; # Define your hostname.
|
||||
|
||||
coreModule = mylib.genKubeVirtGuestModule {
|
||||
inherit pkgs hostName;
|
||||
inherit (myvars) networking;
|
||||
};
|
||||
k3sModule = mylib.genK3sServerModule {
|
||||
inherit pkgs;
|
||||
kubeconfigFile = "/home/${myvars.username}/.kube/config";
|
||||
tokenFile = config.age.secrets."k3s-prod-1-token".path;
|
||||
# the first node in the cluster should be the one to initialize the cluster
|
||||
clusterInit = true;
|
||||
# use my own domain & kube-vip's virtual IP for the API server
|
||||
# so that the API server can always be accessed even if some nodes are down
|
||||
masterHost = "prod-cluster-1.writefor.fun";
|
||||
# k3sExtraArgs = [
|
||||
# # IPv4 Private CIDR(full) - 172.16.0.0/12
|
||||
# # IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
|
||||
# # IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
|
||||
# "--cluster-cidr=172.20.0.0/16,fdfd:cafe:00:0003::/64"
|
||||
# "--service-cidr=172.21.0.0/16,fdfd:cafe:00:8003::/112"
|
||||
# ];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
myvars,
|
||||
mylib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "k3s-prod-1-master-2"; # define your hostname.
|
||||
|
||||
coreModule = mylib.genKubeVirtGuestModule {
|
||||
inherit pkgs hostName;
|
||||
inherit (myvars) networking;
|
||||
};
|
||||
k3sModule = mylib.genK3sServerModule {
|
||||
inherit pkgs;
|
||||
kubeconfigFile = "/home/${myvars.username}/.kube/config";
|
||||
tokenFile = config.age.secrets."k3s-prod-1-token".path;
|
||||
# use my own domain & kube-vip's virtual IP for the API server
|
||||
# so that the API server can always be accessed even if some nodes are down
|
||||
masterHost = "prod-cluster-1.writefor.fun";
|
||||
|
||||
# k3sExtraArgs = [
|
||||
# # IPv4 Private CIDR(full) - 172.16.0.0/12
|
||||
# # IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
|
||||
# # IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
|
||||
# "--cluster-cidr=172.20.0.0/16,fdfd:cafe:00:0003::/64"
|
||||
# "--service-cidr=172.21.0.0/16,fdfd:cafe:00:8003::/112"
|
||||
# ];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
myvars,
|
||||
mylib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "k3s-prod-1-master-3"; # define your hostname.
|
||||
|
||||
coreModule = mylib.genKubeVirtGuestModule {
|
||||
inherit pkgs hostName;
|
||||
inherit (myvars) networking;
|
||||
};
|
||||
k3sModule = mylib.genK3sServerModule {
|
||||
inherit pkgs;
|
||||
kubeconfigFile = "/home/${myvars.username}/.kube/config";
|
||||
tokenFile = config.age.secrets."k3s-prod-1-token".path;
|
||||
# use my own domain & kube-vip's virtual IP for the API server
|
||||
# so that the API server can always be accessed even if some nodes are down
|
||||
masterHost = "prod-cluster-1.writefor.fun";
|
||||
|
||||
# k3sExtraArgs = [
|
||||
# # IPv4 Private CIDR(full) - 172.16.0.0/12
|
||||
# # IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
|
||||
# # IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
|
||||
# "--cluster-cidr=172.20.0.0/16,fdfd:cafe:00:0003::/64"
|
||||
# "--service-cidr=172.21.0.0/16,fdfd:cafe:00:8003::/112"
|
||||
# ];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
myvars,
|
||||
mylib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "k3s-prod-1-worker-1"; # define your hostname.
|
||||
|
||||
coreModule = mylib.genKubeVirtGuestModule {
|
||||
inherit pkgs hostName;
|
||||
inherit (myvars) networking;
|
||||
};
|
||||
k3sModule = mylib.genK3sAgentModule {
|
||||
inherit pkgs;
|
||||
tokenFile = config.age.secrets."k3s-prod-1-token".path;
|
||||
# use my own domain & kube-vip's virtual IP for the API server
|
||||
# so that the API server can always be accessed even if some nodes are down
|
||||
masterHost = "prod-cluster-1.writefor.fun";
|
||||
|
||||
# k3sExtraArgs = [
|
||||
# # IPv4 Private CIDR(full) - 172.16.0.0/12
|
||||
# # IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
|
||||
# # IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
|
||||
# "--cluster-cidr=172.20.0.0/16,fdfd:cafe:00:0003::/64"
|
||||
# "--service-cidr=172.21.0.0/16,fdfd:cafe:00:8003::/112"
|
||||
# ];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
myvars,
|
||||
mylib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "k3s-prod-1-worker-2"; # define your hostname.
|
||||
|
||||
coreModule = mylib.genKubeVirtGuestModule {
|
||||
inherit pkgs hostName;
|
||||
inherit (myvars) networking;
|
||||
};
|
||||
k3sModule = mylib.genK3sAgentModule {
|
||||
inherit pkgs;
|
||||
tokenFile = config.age.secrets."k3s-prod-1-token".path;
|
||||
# use my own domain & kube-vip's virtual IP for the API server
|
||||
# so that the API server can always be accessed even if some nodes are down
|
||||
masterHost = "prod-cluster-1.writefor.fun";
|
||||
|
||||
# k3sExtraArgs = [
|
||||
# # IPv4 Private CIDR(full) - 172.16.0.0/12
|
||||
# # IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
|
||||
# # IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
|
||||
# "--cluster-cidr=172.20.0.0/16,fdfd:cafe:00:0003::/64"
|
||||
# "--service-cidr=172.21.0.0/16,fdfd:cafe:00:8003::/112"
|
||||
# ];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
myvars,
|
||||
mylib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "k3s-prod-1-worker-3"; # define your hostname.
|
||||
|
||||
coreModule = mylib.genKubeVirtGuestModule {
|
||||
inherit pkgs hostName;
|
||||
inherit (myvars) networking;
|
||||
};
|
||||
k3sModule = mylib.genK3sAgentModule {
|
||||
inherit pkgs;
|
||||
tokenFile = config.age.secrets."k3s-prod-1-token".path;
|
||||
# use my own domain & kube-vip's virtual IP for the API server
|
||||
# so that the API server can always be accessed even if some nodes are down
|
||||
masterHost = "prod-cluster-1.writefor.fun";
|
||||
|
||||
# k3sExtraArgs = [
|
||||
# # IPv4 Private CIDR(full) - 172.16.0.0/12
|
||||
# # IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
|
||||
# # IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
|
||||
# "--cluster-cidr=172.20.0.0/16,fdfd:cafe:00:0003::/64"
|
||||
# "--service-cidr=172.21.0.0/16,fdfd:cafe:00:8003::/112"
|
||||
# ];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
coreModule
|
||||
k3sModule
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user