Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Setup NFS server and use inside a Kubernetes pods in RHEL/CENTOS7

Setup a NFS server in one of the node of Kubernetes Cluster using rhel 7.X


--------------------------------------------------------------------
$ yum update
$ rpm -qa | grep nfs-utils
$ yum install nfs-utils rpcbind
$ systemctl enable nfs-server
$ systemctl enable rpcbind
$ systemctl enable nfs-lock
$ systemctl enable nfs-idmap
$ systemctl start rpcbind
$ systemctl start nfs-server
$ systemctl start nfs-lock
$ systemctl start nfs-idmap
$ systemctl status nfs
$ mkdir /tecnotree
$ chmod 1777 /tecnotree
$ vi /etc/exports
------------------
/tecnotree *(rw)

exportfs -r
systemctl restart nfs-server
showmount -e 

Validate NFS server is working Manually


--------------------------------------------------------------------
rpm -qa | grep nfs-utils
yum install nfs-utils
mkdir /tmp/mylocal
sudo mount -t nfs -o ro,nosuid 172.31.26.152:/tecnotree /tmp/mylocal
mkdir /tmp/mylocal1
sudo mount -t nfs -o rw,nosuid 172.31.26.152:/tecnotree /tmp/mylocal1

vi /etc/fstab
172.31.26.152:/tecnotree 	/tmp/mylocal	 nfs 	ro,nosuid 	0 	0
172.31.26.152:/tecnotree 	/tmp/mylocal1	 nfs 	rw,nosuid 	0 	0

Using NFS server in Kubernetes Pods

Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)