Merge pull request #35349 from vishh/gci-cmount

Automatic merge from submit-queue

Update GCI mounter script to run in a rkt container

Depends on #35652
This commit is contained in:
Kubernetes Submit Queue
2016-10-27 13:49:37 -07:00
committed by GitHub
3 changed files with 26 additions and 10 deletions

18
cluster/gce/gci/mounter/mounter Normal file → Executable file
View File

@@ -17,4 +17,20 @@
set -e
set -o pipefail
sudo /bin/mount "$@"
MOUNTER_DOCKER_IMAGE=gcr.io/google_containers/gci-mounter
MOUNTER_DOCKER_VERSION=v1
MOUNTER_USER=root
RKT_BINARY=/home/kubernetes/bin/rkt
function gc {
${RKT_BINARY} gc --grace-period=0s &> /dev/null
}
# Garbage collect old rkt containers on exit
trap gc EXIT
${RKT_BINARY} run --stage1-name="coreos.com/rkt/stage1-fly:1.17.0" \
--insecure-options=image \
--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 -- "$@"