mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
nixos/kubernetes: Fix kube-control-plane-online must not be present
outside kubernetes module.
This commit is contained in:
parent
ff382c18c8
commit
154356d820
2 changed files with 23 additions and 23 deletions
|
@ -423,30 +423,7 @@ in
|
|||
};
|
||||
|
||||
})
|
||||
{
|
||||
systemd.targets.kube-control-plane-online = {
|
||||
wantedBy = [ "kubernetes.target" ];
|
||||
before = [ "kubernetes.target" ];
|
||||
};
|
||||
|
||||
systemd.services.kube-control-plane-online = rec {
|
||||
description = "Kubernetes control plane is online";
|
||||
wantedBy = [ "kube-control-plane-online.target" ];
|
||||
after = [ "kube-scheduler.service" "kube-controller-manager.service" ];
|
||||
before = [ "kube-control-plane-online.target" ];
|
||||
preStart = ''
|
||||
${top.lib.mkWaitCurl ( with config.systemd.services.kube-control-plane-online; {
|
||||
sleep = 3;
|
||||
path = "/healthz";
|
||||
cacert = top.caFile;
|
||||
} // optionalAttrs (environment ? cert) { inherit (environment) cert key; })}
|
||||
'';
|
||||
script = "echo Ok";
|
||||
serviceConfig = {
|
||||
TimeoutSec = "500";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
@ -299,6 +299,29 @@ in {
|
|||
services.kubernetes.apiserverAddress = mkDefault ("https://${if cfg.apiserver.advertiseAddress != null
|
||||
then cfg.apiserver.advertiseAddress
|
||||
else "${cfg.masterAddress}:${toString cfg.apiserver.securePort}"}");
|
||||
|
||||
systemd.targets.kube-control-plane-online = {
|
||||
wantedBy = [ "kubernetes.target" ];
|
||||
before = [ "kubernetes.target" ];
|
||||
};
|
||||
|
||||
systemd.services.kube-control-plane-online = rec {
|
||||
description = "Kubernetes control plane is online";
|
||||
wantedBy = [ "kube-control-plane-online.target" ];
|
||||
after = [ "kube-scheduler.service" "kube-controller-manager.service" ];
|
||||
before = [ "kube-control-plane-online.target" ];
|
||||
preStart = ''
|
||||
${cfg.lib.mkWaitCurl ( with config.systemd.services.kube-control-plane-online; {
|
||||
sleep = 3;
|
||||
path = "/healthz";
|
||||
cacert = cfg.caFile;
|
||||
} // optionalAttrs (environment ? cert) { inherit (environment) cert key; })}
|
||||
'';
|
||||
script = "echo Ok";
|
||||
serviceConfig = {
|
||||
TimeoutSec = "500";
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue