New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Kubelet] Use the custom mounter script for Nfs and Glusterfs only #35821
Changes from all commits
1ecc12f
e5c6192
414e4ae
40fc804
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,14 +23,25 @@ MOUNTER_USER=root | |
RKT_BINARY=/home/kubernetes/bin/rkt | ||
|
||
function gc { | ||
${RKT_BINARY} gc --grace-period=0s &> /dev/null | ||
# 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just want to double check 5 retry won't cause any issue or interfere other ongoing mounter command? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should only garbage collect |
||
} | ||
|
||
# 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=rootfs,kind=host,source=/,readOnly=false,recursive=true \ | ||
--mount volume=rootfs,target=/media/root \ | ||
--volume=kubelet,kind=host,source=/var/lib/kubelet,readOnly=false,recursive=true \ | ||
--mount volume=kubelet,target=/var/lib/kubelet \ | ||
docker://${MOUNTER_DOCKER_IMAGE}:${MOUNTER_DOCKER_VERSION} --user=${MOUNTER_USER} --exec /bin/mount -- "$@" | ||
|
||
echo "Successfully ran mount using a rkt fly container" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ func (realConntracker) SetTCPEstablishedTimeout(seconds int) error { | |
func isSysFSWritable() (bool, error) { | ||
const permWritable = "rw" | ||
const sysfsDevice = "sysfs" | ||
m := mount.New() | ||
m := mount.New("" /* default mount path */) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would prefer NewDefault() |
||
mountPoints, err := m.List() | ||
if err != nil { | ||
glog.Errorf("failed to list mount points: %v", err) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's this coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
mounter
? It is installed as part of cloud init. https://github.com/vishh/kubernetes/blob/3bd69a02563a2f3bc0a9aadd0f5ea059fcd06337/cluster/gce/gci/configure.sh#L183