mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 22:53:22 +00:00
Revert "Merge pull request #35821 from vishh/gci-mounter-scope"
This reverts commit973fa6b334
, reversing changes made to41b5fe86b6
.
This commit is contained in:
@@ -473,7 +473,6 @@ function start-kubelet {
|
||||
flags+=" --cluster-dns=${DNS_SERVER_IP}"
|
||||
flags+=" --cluster-domain=${DNS_DOMAIN}"
|
||||
flags+=" --config=/etc/kubernetes/manifests"
|
||||
flags+=" --experimental-mounter-path=${KUBE_HOME}/bin/mounter"
|
||||
|
||||
if [[ -n "${KUBELET_PORT:-}" ]]; then
|
||||
flags+=" --port=${KUBELET_PORT}"
|
||||
@@ -1169,15 +1168,9 @@ EOF
|
||||
}
|
||||
|
||||
function override-kubectl {
|
||||
echo "overriding kubectl"
|
||||
echo "export PATH=${KUBE_HOME}/bin:\$PATH" > /etc/profile.d/kube_env.sh
|
||||
}
|
||||
|
||||
function pre-warm-mounter {
|
||||
echo "prewarming mounter"
|
||||
${KUBE_HOME}/bin/mounter &> /dev/null
|
||||
}
|
||||
|
||||
########### Main Function ###########
|
||||
echo "Start to configure instance for kubernetes"
|
||||
|
||||
@@ -1212,8 +1205,6 @@ else
|
||||
fi
|
||||
|
||||
override-kubectl
|
||||
# Run the containerized mounter once to pre-cache the container image.
|
||||
pre-warm-mounter
|
||||
assemble-docker-flags
|
||||
load-docker-images
|
||||
start-kubelet
|
||||
|
@@ -23,25 +23,14 @@ MOUNTER_USER=root
|
||||
RKT_BINARY=/home/kubernetes/bin/rkt
|
||||
|
||||
function gc {
|
||||
# Attempt to garbage collect rkt pods with 5 retries.
|
||||
# Rkt pods end up creating new copies of mounts on the host. Hence it is ideal to clean them up right away.
|
||||
attempt=0
|
||||
until [ $attempt -ge 5 ]; do
|
||||
${RKT_BINARY} gc --grace-period=0s && break
|
||||
attempt=$[$attempt+1]
|
||||
sleep 1
|
||||
done
|
||||
${RKT_BINARY} gc --grace-period=0s &> /dev/null
|
||||
}
|
||||
|
||||
# Garbage collect old rkt containers on exit
|
||||
trap gc EXIT
|
||||
|
||||
echo "Running mount using a rkt fly container"
|
||||
|
||||
${RKT_BINARY} run --stage1-name="coreos.com/rkt/stage1-fly:1.18.0" \
|
||||
--insecure-options=image \
|
||||
--volume=kubelet,kind=host,source=/var/lib/kubelet,readOnly=false,recursive=true \
|
||||
--mount volume=kubelet,target=/var/lib/kubelet \
|
||||
--volume=rootfs,kind=host,source=/,readOnly=false,recursive=true \
|
||||
--mount volume=rootfs,target=/media/root \
|
||||
docker://${MOUNTER_DOCKER_IMAGE}:${MOUNTER_DOCKER_VERSION} --user=${MOUNTER_USER} --exec /bin/mount -- "$@"
|
||||
|
||||
echo "Successfully ran mount using a rkt fly container"
|
Reference in New Issue
Block a user