diff --git a/deploy/kicbase/entrypoint b/deploy/kicbase/entrypoint index 687ba2d494..de3e797a5c 100755 --- a/deploy/kicbase/entrypoint +++ b/deploy/kicbase/entrypoint @@ -102,22 +102,36 @@ overlayfs_preferrable() { configure_containerd() { local snapshotter=${KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER:-} + + # handle userns (rootless) if [[ -n "$userns" ]]; then - # userns (rootless) configs - - # Adjust oomScoreAdj + # enable restrict_oom_score_adj sed -i 's/restrict_oom_score_adj = false/restrict_oom_score_adj = true/' /etc/containerd/config.toml - # Use fuse-overlayfs if overlayfs is not preferrable: https://github.com/kubernetes-sigs/kind/issues/2275 if [[ -z "$snapshotter" ]] && ! overlayfs_preferrable; then snapshotter="fuse-overlayfs" fi - else - # we need to switch to the 'native' snapshotter on zfs - if [[ -z "$snapshotter" ]] && [["$(stat -f -c %T /kind)" == 'zfs' ]]; then - snapshotter="native" + fi + + # if we have not already overridden the snapshotter, attempt to auto select + if [[ -z "$snapshotter" ]]; then + # we need to switch to 'native' or 'fuse-overlayfs' on zfs + container_filesystem="$(stat -f -c %T /kind)" + if [[ "$container_filesystem" == 'zfs' ]]; then + # if fuse is present, use fuse-overlayfs, else fallback to native + # we do not use the ZFS snapshotter because of skew issues vs the host + if [[ -e /dev/fuse ]]; then + snapshotter="fuse-overlayfs" + else + snapshotter="native" + fi + # fuse likely implies fuse-overlayfs, we should switch to fuse-overlayfs (or native) + elif [[ "$container_filesystem" == 'fuseblk' ]]; then + snapshotter="fuse-overlayfs" fi fi + + # if we've overridden or auto-selected the snapshotter vs the default, update containerd if [[ -n "$snapshotter" ]]; then echo "INFO: changing snapshotter from \"overlayfs\" to \"$snapshotter\"" sed -i "s/snapshotter = \"overlayfs\"/snapshotter = \"$snapshotter\"/" /etc/containerd/config.toml @@ -386,22 +400,6 @@ fix_product_uuid() { fi } -fix_kmsg() { - # In environments where /dev/kmsg is not available, the kubelet (1.15+) won't - # start because it cannot open /dev/kmsg when starting the kmsgparser in the - # OOM parser. - # To support those environments, we link /dev/kmsg to /dev/console. - # https://github.com/kubernetes-sigs/kind/issues/662 - if [[ ! -e /dev/kmsg ]]; then - if [[ -e /dev/console ]]; then - echo 'WARN: /dev/kmsg does not exist, symlinking /dev/console' >&2 - ln -s /dev/console /dev/kmsg - else - echo 'WARN: /dev/kmsg does not exist, nor does /dev/console!' >&2 - fi - fi -} - select_iptables() { # based on: https://github.com/kubernetes-sigs/iptables-wrappers/blob/97b01f43a8e8db07840fc4b95e833a37c0d36b12/iptables-wrapper-installer.sh local mode num_legacy_lines num_nft_lines @@ -534,7 +532,6 @@ validate_userns # NOTE: it's important that we do configure* first in this order to avoid races configure_containerd configure_proxy -fix_kmsg fix_mount retryable_fix_cgroup fix_machine_id diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index eb37ad053b..16d84147c4 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -182,7 +182,7 @@ func KindNet(repo string) string { if repo == "" { repo = "kindest" } - return path.Join(repo, "kindnetd:v20220726-ed811e41") + return path.Join(repo, "kindnetd:v20220927-ce36d7c0") } // all calico images are from https://docs.projectcalico.org/manifests/calico.yaml