From 3411f4349df5400f887d851850a1de8009540458 Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Tue, 10 May 2016 18:24:24 +0000 Subject: [PATCH] expose rpcbind service, so nfs client can use service IP to access NFS share Signed-off-by: Huamin Chen --- examples/nfs/nfs-data/Dockerfile | 4 ++-- examples/nfs/nfs-server-rc.yaml | 4 +++- examples/nfs/nfs-server-service.yaml | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/nfs/nfs-data/Dockerfile b/examples/nfs/nfs-data/Dockerfile index ae7615b8f10..6a9c689120f 100644 --- a/examples/nfs/nfs-data/Dockerfile +++ b/examples/nfs/nfs-data/Dockerfile @@ -20,7 +20,7 @@ ADD run_nfs.sh /usr/local/bin/ ADD index.html /tmp/index.html RUN chmod 644 /tmp/index.html -# expose mountd 20048/tcp and nfsd 2049/tcp -EXPOSE 2049/tcp 20048/tcp +# expose mountd 20048/tcp and nfsd 2049/tcp and rpcbind 111/tcp +EXPOSE 2049/tcp 20048/tcp 111/tcp 111/udp ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports"] diff --git a/examples/nfs/nfs-server-rc.yaml b/examples/nfs/nfs-server-rc.yaml index 6c1f00ebf2c..91649264c12 100644 --- a/examples/nfs/nfs-server-rc.yaml +++ b/examples/nfs/nfs-server-rc.yaml @@ -13,12 +13,14 @@ spec: spec: containers: - name: nfs-server - image: gcr.io/google-samples/nfs-server:1.0 + image: hchen/nfs3-server:latest #gcr.io/google-samples/nfs-server:1.0 ports: - name: nfs containerPort: 2049 - name: mountd containerPort: 20048 + - name: rpcbind + containerPort: 111 securityContext: privileged: true volumeMounts: diff --git a/examples/nfs/nfs-server-service.yaml b/examples/nfs/nfs-server-service.yaml index 5b6ec6014e2..9654d158384 100644 --- a/examples/nfs/nfs-server-service.yaml +++ b/examples/nfs/nfs-server-service.yaml @@ -8,5 +8,7 @@ spec: port: 2049 - name: mountd port: 20048 + - name: rpcbind + port: 111 selector: role: nfs-server