mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 09:14:28 +00:00
nixos/kubernetes: fix cadvisor, kubelet autoregistration
This commit is contained in:
parent
8f9534ccc3
commit
5aefc44da9
@ -224,7 +224,7 @@ in {
|
|||||||
|
|
||||||
machines = mkOption {
|
machines = mkOption {
|
||||||
description = "Kubernetes controller list of machines to schedule to schedule onto";
|
description = "Kubernetes controller list of machines to schedule to schedule onto";
|
||||||
default = [config.networking.hostName];
|
default = [];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -242,6 +242,12 @@ in {
|
|||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
registerNode = mkOption {
|
||||||
|
description = "Whether to auto register kubelet with API server.";
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
|
|
||||||
address = mkOption {
|
address = mkOption {
|
||||||
description = "Kubernetes kubelet info server listening address.";
|
description = "Kubernetes kubelet info server listening address.";
|
||||||
default = "0.0.0.0";
|
default = "0.0.0.0";
|
||||||
@ -274,7 +280,7 @@ in {
|
|||||||
|
|
||||||
cadvisorPort = mkOption {
|
cadvisorPort = mkOption {
|
||||||
description = "Kubernetes kubelet local cadvisor port.";
|
description = "Kubernetes kubelet local cadvisor port.";
|
||||||
default = config.services.cadvisor.port;
|
default = 4194;
|
||||||
type = types.int;
|
type = types.int;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -324,7 +330,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
kube2sky = {
|
kube2sky = {
|
||||||
enable = mkEnableOption "kube2sky dns service";
|
enable = mkEnableOption "Whether to enable kube2sky dns service.";
|
||||||
|
|
||||||
domain = mkOption {
|
domain = mkOption {
|
||||||
description = "Kuberntes kube2sky domain under which all DNS names will be hosted.";
|
description = "Kuberntes kube2sky domain under which all DNS names will be hosted.";
|
||||||
@ -445,6 +451,7 @@ in {
|
|||||||
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PATH"
|
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PATH"
|
||||||
exec ${cfg.package}/bin/kubelet \
|
exec ${cfg.package}/bin/kubelet \
|
||||||
--api-servers=${concatMapStringsSep "," (f: "http://${f}") cfg.kubelet.apiServers} \
|
--api-servers=${concatMapStringsSep "," (f: "http://${f}") cfg.kubelet.apiServers} \
|
||||||
|
--register-node=${if cfg.kubelet.registerNode then "true" else "false"} \
|
||||||
--address=${cfg.kubelet.address} \
|
--address=${cfg.kubelet.address} \
|
||||||
--port=${toString cfg.kubelet.port} \
|
--port=${toString cfg.kubelet.port} \
|
||||||
--hostname-override=${cfg.kubelet.hostname} \
|
--hostname-override=${cfg.kubelet.hostname} \
|
||||||
@ -511,8 +518,6 @@ in {
|
|||||||
|
|
||||||
(mkIf (any (el: el == "node") cfg.roles) {
|
(mkIf (any (el: el == "node") cfg.roles) {
|
||||||
virtualisation.docker.enable = mkDefault true;
|
virtualisation.docker.enable = mkDefault true;
|
||||||
services.cadvisor.enable = mkDefault true;
|
|
||||||
services.cadvisor.port = mkDefault 4194;
|
|
||||||
services.kubernetes.kubelet.enable = mkDefault true;
|
services.kubernetes.kubelet.enable = mkDefault true;
|
||||||
services.kubernetes.proxy.enable = mkDefault true;
|
services.kubernetes.proxy.enable = mkDefault true;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user