简于形,大于界

NFS

这份快速指南将引导你如何使用NFS。

安装服务器

yum
1yum -y install nfs-utils rpcbind
2mkdir -p /data/k8s
3chmod 755 /data/k8s
4vi /etc/exports
5# /etc/exports
6# /data/k8s 192.168.1.0/24(rw,sync,no_root_squash) // /data/k8s *(rw,sync,no_root_squash)
7curl -v telnet://nfs.fewbox.lan:2049

卸载服务器

yum
1yum remove nfs-utils

启动服务器

systemctl
1systemctl enable rpcbind
2systemctl enable nfs
3systemctl start rpcbind
4systemctl start nfs
5rpcinfo -p
6exportfs -r
7exportfs

安装客户端

yum
1yum install nfs-common nfs-utils -y

挂载

mount
1mount -t nfs nas.fewbox.lan:/NFS/k8s /root/mount/nfs # Master and Worker Nodes, All point to NFS Server.
2# mount -t nfs registry.fewbox.lan:/data/k8s /mount/nfs # Master and Worker Nodes, All point to NFS Server.
3# mount -t nfs registry.fewbox.lan:/NFS/nginx /mount/nfs
4curl -v telnet://nas.fewbox.lan:2049
5umount -f -l /root/mount/nfs

Kubernetes

yum
1# IMPORTANT!!! Need to install in the master(optional) and worker node.
2yum install nfs-utils
3```
4**NFS issue**
5https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/issues/25
6
7Using Kubernetes v1.20.0, getting "unexpected error getting claim reference: selfLink was empty, can't make reference"
8
9quay.io/external_storage/nfs-client-provisioner:latest
10
11gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.0