mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
Merge pull request #112901 from vinaykul/ubuntu-kube-up-fix
Fix 'ctr not found' error with gce kube-up for Ubuntu OS deployments
This commit is contained in:
commit
51185b77a3
@ -585,12 +585,29 @@ providers:
|
||||
EOF
|
||||
}
|
||||
|
||||
function ensure-container-runtime {
|
||||
function ensure-containerd-runtime {
|
||||
# Install containerd/runc if requested
|
||||
if [[ -n "${UBUNTU_INSTALL_CONTAINERD_VERSION:-}" || -n "${UBUNTU_INSTALL_RUNC_VERSION:-}" ]]; then
|
||||
log-wrap "InstallContainerdUbuntu" install-containerd-ubuntu
|
||||
fi
|
||||
|
||||
# Fall back to installing distro specific containerd, if not found
|
||||
if ! command -v containerd >/dev/null 2>&1; then
|
||||
local linuxrelease="cos"
|
||||
if [[ -n "$(command -v lsb_release)" ]]; then
|
||||
linuxrelease=$(lsb_release -si)
|
||||
fi
|
||||
case "${linuxrelease}" in
|
||||
Ubuntu)
|
||||
log-wrap "InstallContainerdUbuntu" install-containerd-ubuntu
|
||||
;;
|
||||
*)
|
||||
echo "Installing containerd for linux release ${linuxrelease} not supported" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# when custom containerd version is installed sourcing containerd_env.sh will add all tools like ctr to the PATH
|
||||
if [[ -e "/etc/profile.d/containerd_env.sh" ]]; then
|
||||
log-wrap 'SourceContainerdEnv' source "/etc/profile.d/containerd_env.sh"
|
||||
@ -614,6 +631,19 @@ function ensure-container-runtime {
|
||||
runc --version
|
||||
}
|
||||
|
||||
function ensure-container-runtime {
|
||||
case "${CONTAINER_RUNTIME_NAME:-containerd}" in
|
||||
containerd)
|
||||
ensure-containerd-runtime
|
||||
;;
|
||||
#TODO: Add crio support
|
||||
*)
|
||||
echo "Unsupported container runtime (${CONTAINER_RUNTIME_NAME})." >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Downloads kubernetes binaries and kube-system manifest tarball, unpacks them,
|
||||
# and places them into suitable directories. Files are placed in /home/kubernetes.
|
||||
function install-kube-binary-config {
|
||||
|
Loading…
Reference in New Issue
Block a user