nixos/kubernetes: Address review: Rename targets and move proxy to node-online.target

This commit is contained in:
Christian Albrecht 2019-03-06 16:40:27 +01:00
parent 74962bf767
commit ff91d5818c
No known key found for this signature in database
GPG key ID: 866AF4B25DF7EB00
6 changed files with 19 additions and 19 deletions

View file

@ -71,8 +71,8 @@ in
systemd.services.kube-addon-manager = {
description = "Kubernetes addon manager";
wantedBy = [ "kubernetes.target" ];
after = [ "kube-apiserver-online.target" "node-online.target" ];
wantedBy = [ "kube-control-plane-online.target" ];
before = [ "kube-control-plane-online.target" ];
environment.ADDON_PATH = "/etc/kubernetes/addons/";
path = [ pkgs.gawk ];
serviceConfig = {

View file

@ -293,9 +293,9 @@ in
in {
systemd.services.kube-apiserver = {
description = "Kubernetes APIServer Service";
wantedBy = [ "kube-apiserver-online.target" ];
wantedBy = [ "kube-control-plane-online.target" ];
after = [ "certmgr.service" ];
before = [ "kube-apiserver-online.target" ];
before = [ "kube-control-plane-online.target" ];
serviceConfig = {
Slice = "kubernetes.slice";
ExecStart = ''${top.package}/bin/kube-apiserver \
@ -461,16 +461,16 @@ in
}))
{
systemd.targets.kube-apiserver-online = {
systemd.targets.kube-control-plane-online = {
wantedBy = [ "kubernetes.target" ];
before = [ "kubernetes.target" ];
};
systemd.services.kube-apiserver-online = mkIf top.flannel.enable {
description = "apiserver control plane is online";
wantedBy = [ "kube-apiserver-online.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-apiserver-online.target" ];
before = [ "kube-control-plane-online.target" ];
preStart = ''
${top.lib.mkWaitCurl (with top.pki.certs.flannelClient; {
sleep = 3;
@ -479,7 +479,7 @@ in
inherit cert key;
})}
'';
script = "echo apiserver control plane is online";
script = "echo Ok";
serviceConfig = {
TimeoutSec = "500";
};

View file

@ -116,9 +116,9 @@ in
systemd.services.kube-controller-manager = {
description = "Kubernetes Controller Manager Service";
wantedBy = [ "kube-apiserver-online.target" ];
wantedBy = [ "kube-control-plane-online.target" ];
after = [ "kube-apiserver.service" ];
before = [ "kube-apiserver-online.target" ];
before = [ "kube-control-plane-online.target" ];
preStart = ''
${top.lib.mkWaitCurl (with top.pki.certs.controllerManagerClient; {
sleep = 1;

View file

@ -253,7 +253,7 @@ in
systemd.services.kubelet = {
description = "Kubernetes Kubelet Service";
wantedBy = [ "kubelet.target" ];
after = [ "kube-apiserver-online.target" ];
after = [ "kube-control-plane-online.target" ];
before = [ "kubelet.target" ];
path = with pkgs; [ gitMinimal openssh docker utillinux iproute ethtool thin-provisioning-tools iptables socat ] ++ top.path;
preStart = ''
@ -339,7 +339,7 @@ in
serviceConfig.Slice = "kubernetes.slice";
};
systemd.services.node-online = {
systemd.services.kubelet-online = {
wantedBy = [ "node-online.target" ];
after = [ "flannel.target" "kubelet.target" ];
before = [ "node-online.target" ];

View file

@ -48,9 +48,9 @@ in
config = mkIf cfg.enable {
systemd.services.kube-proxy = {
description = "Kubernetes Proxy Service";
wantedBy = [ "kubernetes.target" ];
after = [ "node-online.target" ];
before = [ "kubernetes.target" ];
wantedBy = [ "node-online.target" ];
after = [ "kubelet-online.service" ];
before = [ "node-online.target" ];
path = with pkgs; [ iptables conntrack_tools ];
preStart = ''
${top.lib.mkWaitCurl (with top.pki.certs.kubeProxyClient; {

View file

@ -59,9 +59,9 @@ in
config = mkIf cfg.enable {
systemd.services.kube-scheduler = {
description = "Kubernetes Scheduler Service";
wantedBy = [ "kube-apiserver-online.target" ];
wantedBy = [ "kube-control-plane-online.target" ];
after = [ "kube-apiserver.service" ];
before = [ "kube-apiserver-online.target" ];
before = [ "kube-control-plane-online.target" ];
preStart = ''
${top.lib.mkWaitCurl (with top.pki.certs.schedulerClient; {
sleep = 1;