add zed, ollama, kubernetes
This commit is contained in:
78
modules/kubernetes.nix
Normal file
78
modules/kubernetes.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options = {
|
||||
services.kubernetes = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable Kubernetes services";
|
||||
};
|
||||
|
||||
version = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "1.28.0";
|
||||
description = "Kubernetes version to use";
|
||||
};
|
||||
|
||||
clusterName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "palatine-hill-cluster";
|
||||
description = "Name of the Kubernetes cluster";
|
||||
};
|
||||
|
||||
controlPlaneEndpoint = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "localhost:6443";
|
||||
description = "Control plane endpoint";
|
||||
};
|
||||
|
||||
networking = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = { };
|
||||
description = "Kubernetes networking configuration";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.kubernetes.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
kubectl
|
||||
kubernetes
|
||||
];
|
||||
|
||||
# Enable containerd for Kubernetes
|
||||
virtualisation.containerd.enable = true;
|
||||
|
||||
# Enable kubelet
|
||||
services.kubelet = {
|
||||
enable = true;
|
||||
extraFlags = {
|
||||
"pod-infra-container-image" = "registry.k8s.io/pause:3.9";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable kubeadm for cluster initialization
|
||||
environment.etc."kubeadm.yaml".text = ''
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
kind: InitConfiguration
|
||||
localAPIEndpoint:
|
||||
advertiseAddress: 127.0.0.1
|
||||
bindPort: 6443
|
||||
---
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
kind: ClusterConfiguration
|
||||
clusterName: ${config.services.kubernetes.clusterName}
|
||||
controlPlaneEndpoint: ${config.services.kubernetes.controlPlaneEndpoint}
|
||||
networking:
|
||||
serviceSubnet: 10.96.0.0/12
|
||||
podSubnet: 10.244.0.0/16
|
||||
dnsDomain: cluster.local
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user