nix/cluster-configuration: fix CNI plugins being deleted on kubelet restart
diff --git a/cluster/README b/cluster/README
index f5b5970..e798e96 100644
--- a/cluster/README
+++ b/cluster/README
@@ -49,12 +49,3 @@
`tools/rook-s3cmd-config` can be used to generate test configuration file for s3cmd.
Remember to append `:default-placement` to your region name (ie. `waw-hdd-redundant-1-object:default-placement`)
-
-Known Issues
-============
-
-After running `nixos-configure switch` on the hosts, the shared host/container CNI plugin directory gets nuked, and pods will fail to schedule on that node (TODO(q3k): error message here). To fix this, restart calico-node pods running on nodes that have this issue. The Calico Node pod will reschedule automatically and fix the CNI plugins directory.
-
- kubectl -n kube-system get pods -o wide | grep calico-node
- kubectl -n kube-system delete pod calico-node-XXXX
-
diff --git a/nix/cluster-configuration.nix b/nix/cluster-configuration.nix
index eb67095..c48761a 100644
--- a/nix/cluster-configuration.nix
+++ b/nix/cluster-configuration.nix
@@ -235,4 +235,11 @@
systemd.services.kubelet-online = {
script = pkgs.lib.mkForce "sleep 1";
};
+ # This by default removes all CNI plugins and replaces them with nix-defines ones
+ # Since we bring our own CNI plugins via containers with host mounts, this causes
+ # them to be removed on kubelet restart.
+ # TODO(q3k): file issue
+ systemd.services.kubelet = {
+ preStart = pkgs.lib.mkForce "sleep 1";
+ };
}