update entrypoint and kindnetd
parent
a416e262cd
commit
1abc03c8f2
|
@ -102,22 +102,36 @@ overlayfs_preferrable() {
|
||||||
|
|
||||||
configure_containerd() {
|
configure_containerd() {
|
||||||
local snapshotter=${KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER:-}
|
local snapshotter=${KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER:-}
|
||||||
|
|
||||||
|
# handle userns (rootless)
|
||||||
if [[ -n "$userns" ]]; then
|
if [[ -n "$userns" ]]; then
|
||||||
# userns (rootless) configs
|
# enable restrict_oom_score_adj
|
||||||
|
|
||||||
# Adjust oomScoreAdj
|
|
||||||
sed -i 's/restrict_oom_score_adj = false/restrict_oom_score_adj = true/' /etc/containerd/config.toml
|
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
|
# Use fuse-overlayfs if overlayfs is not preferrable: https://github.com/kubernetes-sigs/kind/issues/2275
|
||||||
if [[ -z "$snapshotter" ]] && ! overlayfs_preferrable; then
|
if [[ -z "$snapshotter" ]] && ! overlayfs_preferrable; then
|
||||||
snapshotter="fuse-overlayfs"
|
snapshotter="fuse-overlayfs"
|
||||||
fi
|
fi
|
||||||
else
|
fi
|
||||||
# we need to switch to the 'native' snapshotter on zfs
|
|
||||||
if [[ -z "$snapshotter" ]] && [["$(stat -f -c %T /kind)" == 'zfs' ]]; then
|
# if we have not already overridden the snapshotter, attempt to auto select
|
||||||
snapshotter="native"
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if we've overridden or auto-selected the snapshotter vs the default, update containerd
|
||||||
if [[ -n "$snapshotter" ]]; then
|
if [[ -n "$snapshotter" ]]; then
|
||||||
echo "INFO: changing snapshotter from \"overlayfs\" to \"$snapshotter\""
|
echo "INFO: changing snapshotter from \"overlayfs\" to \"$snapshotter\""
|
||||||
sed -i "s/snapshotter = \"overlayfs\"/snapshotter = \"$snapshotter\"/" /etc/containerd/config.toml
|
sed -i "s/snapshotter = \"overlayfs\"/snapshotter = \"$snapshotter\"/" /etc/containerd/config.toml
|
||||||
|
@ -386,22 +400,6 @@ fix_product_uuid() {
|
||||||
fi
|
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() {
|
select_iptables() {
|
||||||
# based on: https://github.com/kubernetes-sigs/iptables-wrappers/blob/97b01f43a8e8db07840fc4b95e833a37c0d36b12/iptables-wrapper-installer.sh
|
# based on: https://github.com/kubernetes-sigs/iptables-wrappers/blob/97b01f43a8e8db07840fc4b95e833a37c0d36b12/iptables-wrapper-installer.sh
|
||||||
local mode num_legacy_lines num_nft_lines
|
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
|
# NOTE: it's important that we do configure* first in this order to avoid races
|
||||||
configure_containerd
|
configure_containerd
|
||||||
configure_proxy
|
configure_proxy
|
||||||
fix_kmsg
|
|
||||||
fix_mount
|
fix_mount
|
||||||
retryable_fix_cgroup
|
retryable_fix_cgroup
|
||||||
fix_machine_id
|
fix_machine_id
|
||||||
|
|
|
@ -182,7 +182,7 @@ func KindNet(repo string) string {
|
||||||
if repo == "" {
|
if repo == "" {
|
||||||
repo = "kindest"
|
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
|
// all calico images are from https://docs.projectcalico.org/manifests/calico.yaml
|
||||||
|
|
Loading…
Reference in New Issue