nixos/kubernetes: bootstrap docker without networking
Before flannel is ready there is a brief time where docker will be running with a default docker0 bridge. If kubernetes happens to spawn containers before flannel is ready, docker can't be restarted when flannel is ready because some containers are still running on the docker0 bridge with potentially different network addresses. Environment variables in `EnvironmentFile` override those defined via `Environment` in the systemd service config. Co-authored-by: Christian Albrecht <christian.albrecht@mayflower.de>
This commit is contained in:
parent
6045068f6c
commit
3a02205496
1 changed files with 4 additions and 1 deletions
|
@ -66,7 +66,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
systemd.services.docker.serviceConfig.EnvironmentFile = "/run/flannel/docker";
|
||||
systemd.services.docker = {
|
||||
environment.DOCKER_OPTS = "-b none";
|
||||
serviceConfig.EnvironmentFile = "/run/flannel/docker";
|
||||
};
|
||||
|
||||
# read environment variables generated by mk-docker-opts
|
||||
virtualisation.docker.extraOptions = "$DOCKER_OPTS";
|
||||
|
|
Loading…
Reference in a new issue