mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
fix #22529: disable nfsv4 and use nfsv3
This commit is contained in:
parent
e93c0d727f
commit
3a914c2583
@ -17,9 +17,10 @@ MAINTAINER Jan Safranek, jsafrane@redhat.com
|
|||||||
RUN yum -y install /usr/bin/ps nfs-utils && yum clean all
|
RUN yum -y install /usr/bin/ps nfs-utils && yum clean all
|
||||||
RUN mkdir -p /exports
|
RUN mkdir -p /exports
|
||||||
ADD run_nfs.sh /usr/local/bin/
|
ADD run_nfs.sh /usr/local/bin/
|
||||||
ADD index.html /exports/index.html
|
ADD index.html /tmp/index.html
|
||||||
RUN chmod 644 /exports/index.html
|
RUN chmod 644 /tmp/index.html
|
||||||
|
|
||||||
EXPOSE 2049/tcp
|
# expose mountd 20048/tcp and nfsd 2049/tcp
|
||||||
|
EXPOSE 2049/tcp 20048/tcp
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports"]
|
ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports", "/"]
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
TAG = 0.5
|
TAG = 0.6
|
||||||
PREFIX = gcr.io/google_containers
|
PREFIX = gcr.io/google_containers
|
||||||
|
|
||||||
all: push
|
all: push
|
||||||
|
@ -21,19 +21,29 @@ function start()
|
|||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
# fsid=0: needed for NFSv4
|
# fsid=0: needed for NFSv4
|
||||||
echo "$i *(rw,fsid=0,insecure,no_root_squash)" >> /etc/exports
|
echo "$i *(rw,fsid=0,insecure,no_root_squash)" >> /etc/exports
|
||||||
|
# move index.html to here
|
||||||
|
/bin/cp /tmp/index.html $i/
|
||||||
|
chmod 644 $i/index.html
|
||||||
echo "Serving $i"
|
echo "Serving $i"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# start rpcbind if it is not started yet
|
||||||
|
/usr/sbin/rpcinfo 127.0.0.1 > /dev/null; s=$?
|
||||||
|
if [ $s -ne 0 ]; then
|
||||||
|
echo "Starting rpcbind"
|
||||||
|
/usr/sbin/rpcbind -w
|
||||||
|
fi
|
||||||
|
|
||||||
mount -t nfsd nfds /proc/fs/nfsd
|
mount -t nfsd nfds /proc/fs/nfsd
|
||||||
|
|
||||||
# -N 2 -N 3: disable NFSv2+3
|
# -N 4.x: disable NFSv4
|
||||||
# -V 4.x: enable NFSv4
|
# -V 3: enable NFSv3
|
||||||
/usr/sbin/rpc.mountd -N 2 -N 3 -V 4 -V 4.1
|
/usr/sbin/rpc.mountd -N 2 -V 3 -N 4 -N 4.1
|
||||||
|
|
||||||
/usr/sbin/exportfs -r
|
/usr/sbin/exportfs -r
|
||||||
# -G 10 to reduce grace time to 10 seconds (the lowest allowed)
|
# -G 10 to reduce grace time to 10 seconds (the lowest allowed)
|
||||||
/usr/sbin/rpc.nfsd -G 10 -N 2 -N 3 -V 4 -V 4.1 2
|
/usr/sbin/rpc.nfsd -G 10 -N 2 -V 3 -N 4 -N 4.1 2
|
||||||
|
/usr/sbin/rpc.statd --no-notify
|
||||||
echo "NFS started"
|
echo "NFS started"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user