3
0
Fork 0
forked from mirrors/nixpkgs

nixos/kubernetes: fix flannel and kubelet startup

This commit is contained in:
Jaka Hudoklin 2019-02-21 00:26:11 +01:00 committed by Franz Pletz
parent 3a02205496
commit 97a27fd2d2
No known key found for this signature in database
GPG key ID: 846FDED7792617B4
2 changed files with 9 additions and 18 deletions

View file

@ -68,7 +68,7 @@ in
systemd.services.docker = {
environment.DOCKER_OPTS = "-b none";
serviceConfig.EnvironmentFile = "/run/flannel/docker";
serviceConfig.EnvironmentFile = "-/run/flannel/docker";
};
# read environment variables generated by mk-docker-opts

View file

@ -244,12 +244,12 @@ in
(mkIf cfg.enable {
services.kubernetes.kubelet.seedDockerImages = [infraContainer];
systemd.services.kubelet-bootstrap = {
description = "Boostrap Kubelet";
wantedBy = ["kubernetes.target"];
after = ["docker.service" "network.target"];
path = with pkgs; [ docker ];
script = ''
systemd.services.kubelet = {
description = "Kubernetes Kubelet Service";
wantedBy = [ "kubernetes.target" ];
after = [ "network.target" "docker.service" "kube-apiserver.service" ];
path = with pkgs; [ gitMinimal openssh docker utillinux iproute ethtool thin-provisioning-tools iptables socat ] ++ top.path;
preStart = ''
${concatMapStrings (img: ''
echo "Seeding docker image: ${img}"
docker load <${img}
@ -261,21 +261,12 @@ in
ln -fs ${package}/bin/* /opt/cni/bin
'') cfg.cni.packages}
'';
serviceConfig = {
Slice = "kubernetes.slice";
Type = "oneshot";
};
};
systemd.services.kubelet = {
description = "Kubernetes Kubelet Service";
wantedBy = [ "kubernetes.target" ];
after = [ "network.target" "docker.service" "kube-apiserver.service" "kubelet-bootstrap.service" ];
path = with pkgs; [ gitMinimal openssh docker utillinux iproute ethtool thin-provisioning-tools iptables socat ] ++ top.path;
serviceConfig = {
Slice = "kubernetes.slice";
CPUAccounting = true;
MemoryAccounting = true;
Restart = "on-failure";
RestartSec = "1000ms";
ExecStart = ''${top.package}/bin/kubelet \
--address=${cfg.address} \
--allow-privileged=${boolToString cfg.allowPrivileged} \