diff --git a/images/base/files/usr/local/bin/entrypoint b/images/base/files/usr/local/bin/entrypoint index 588e025a1b..643b6d2214 100755 --- a/images/base/files/usr/local/bin/entrypoint +++ b/images/base/files/usr/local/bin/entrypoint @@ -101,22 +101,36 @@ overlayfs_preferrable() { configure_containerd() { local snapshotter=${KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER:-} - if [[ -n "$userns" ]]; then - # userns (rootless) configs - # Adjust oomScoreAdj + # handle userns (rootless) + if [[ -n "$userns" ]]; then + # 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 diff --git a/pkg/apis/config/defaults/image.go b/pkg/apis/config/defaults/image.go index 02c98f84be..d689c49335 100644 --- a/pkg/apis/config/defaults/image.go +++ b/pkg/apis/config/defaults/image.go @@ -18,4 +18,4 @@ limitations under the License. package defaults // Image is the default for the Config.Image field, aka the default node image. -const Image = "kindest/node:v1.24.3@sha256:e1a5c449fb2556b5fbba29fb43f28055cacb12ce53d1f281e8be442d0dd5cd1d" +const Image = "kindest/node:v1.24.3@sha256:09961d2443a557dfa59126ce8b5388e9c06610b0276dc0a986a74d3d0f01e53e" diff --git a/pkg/build/nodeimage/defaults.go b/pkg/build/nodeimage/defaults.go index d8b650949a..d86f5537bf 100644 --- a/pkg/build/nodeimage/defaults.go +++ b/pkg/build/nodeimage/defaults.go @@ -20,4 +20,4 @@ package nodeimage const DefaultImage = "kindest/node:latest" // DefaultBaseImage is the default base image used -const DefaultBaseImage = "docker.io/kindest/base:v20220808-a2dcbb47" +const DefaultBaseImage = "docker.io/kindest/base:v20220811-20da9c7c"