expose rpcbind service, so nfs client can use service IP to access NFS share

Signed-off-by: Huamin Chen <hchen@redhat.com>
pull/6/head
Huamin Chen 2016-05-10 18:24:24 +00:00
parent bd68007f80
commit 3411f4349d
3 changed files with 7 additions and 3 deletions

View File

@ -20,7 +20,7 @@ ADD run_nfs.sh /usr/local/bin/
ADD index.html /tmp/index.html ADD index.html /tmp/index.html
RUN chmod 644 /tmp/index.html RUN chmod 644 /tmp/index.html
# expose mountd 20048/tcp and nfsd 2049/tcp # expose mountd 20048/tcp and nfsd 2049/tcp and rpcbind 111/tcp
EXPOSE 2049/tcp 20048/tcp EXPOSE 2049/tcp 20048/tcp 111/tcp 111/udp
ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports"] ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports"]

View File

@ -13,12 +13,14 @@ spec:
spec: spec:
containers: containers:
- name: nfs-server - 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: ports:
- name: nfs - name: nfs
containerPort: 2049 containerPort: 2049
- name: mountd - name: mountd
containerPort: 20048 containerPort: 20048
- name: rpcbind
containerPort: 111
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:

View File

@ -8,5 +8,7 @@ spec:
port: 2049 port: 2049
- name: mountd - name: mountd
port: 20048 port: 20048
- name: rpcbind
port: 111
selector: selector:
role: nfs-server role: nfs-server