버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

...

코드 블럭
# nfs-utils 패키지를 설치 합니다
yumapt install -y nfs-utilsserver
 
 
# nfs 공유로 사용할 폴더를 생성하고 테스트에 사용할 index.html 파일을 생성합니다
mkdir /nfs
chmod 777 /nfs 
echo "hihihi" > /nfs/index.html
 
# nfs공유 설정을 해줍니다.
cat <<EOF | tee /etc/exports
/nfs *(rw,no_root_squash)
EOF
 
 
# nfs서버 서비스를 실행하고 활성화 합니다.
systemctl enable nfs-server --now
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.
 
# 확인
[root@w2-k8s ~]# exportfs
/nfs            w2-k8s
 
# nfs설정이 정상인지 worker1번에서 마운트 하여 테스트 합니다 
ssh w1-k8s
 
# 모든 마스터/워커노드에서 nfs 패키지를 설치합니다.
yum install nfs-utils -y
 
mkdir /nfs
mount w2-k8s:/nfs /nfs
df -h
Filesystem      Size  Used Avail Use% Mounted on
.....
192.168.1.102:/nfs           38770304 4569856  34200448  12% /nfs
.....
 
 
[root@w1-k8s /]# ll /nfs
total 4
-rw-r--r--. 1 root root 6 Sep 13 12:47 index.html
 
#nfs서버가 정상 작동되는것을 확인 했으니 이제 실습을 진행 합니다.

#/nfs 폴더를 umount 해줍니다.
umount /nfs    
 
 
 
이제 설정이 완료된 nfs볼륨을 이용하여 pod를 생성하여 줍니다
 

(2) 설정이 완료된 NFS 볼륨을 이용하여 마운트하는 파드 yaml 파일을 작성합니다.

...