٩(๑•̀o•́๑)و

14. NFS 설치 본문

Container Infrastructure/Side Project_202108

14. NFS 설치

11mia 2021. 8. 29. 23:27

노드 간 PVC, PV 구성을 위해 NFS 서버 구성 진행

1. nfs 서버 구성 : master node

apt install nfs-common nfs-kernel-server portmap

# 공유할 폴더 생성
midir /home/share/nfs

# 권한 변경
chmod 777 /home/share/nfs

# 공유 폴더에 대해 허용 ip 및 권한 설정
# /home/share/nfs *(rw,sync,root_squash) 추가
vi /etc/exports

# 설정 변경적용 위해 재기동
service nfs-server restart

# 서버 상태 확인
systemctl status nfs-server.service

# 서버 재기동시 활성화되도록 설정
systemctl enable nfs-server

# 최종적으로 공유폴더를 /mnt 경로에 마운트
mount -t nfs 10.0.2.15:/home/share/nfs /mnt

2. NFS server 테스트

# 서버에서 테스트용 파일 생성
echo tst >> /home/share/nfs/test.txt

3. NFS Client 구성 - Worker node

apt update

# nfs 클라이언트 설치
apt install nfs-common

# 서버의 공유폴더 마운트 상태 확인
showmount -e 10.0.2.15

# woker의 test_mount 폴더를 공유폴더에 마운팅
# 서버의 공유폴더(/home/share/nfs)와 워커의 test_mount 가 동기화된다
mount -t 10.0.2.15:/home/share/nfs test_mount

# 동기화 확인용 파일 생성 후 worker와 master 각각에서 확인
touch /test_mount/worker.txt

worker에선 master에서 만든 테스트 파일이 확인된다
master에서도 worker에서 만든 worker.txt 파일이 확인된다
worker2 에서도 설치 후 마운트 확인

4. 마운트 해제하기

umount 마운트된경로

마운트 해제 후 동기화되었던 파일들이 제거되었다

# 어디까지 했나

 

# 참고

https://cla9.tistory.com/93

 

4. 쿠버네티스 클러스터 구축 - NFS 설치

서론 이전 포스팅을 통해 VirtualBox에서 쿠버네티스 클러스터를 구축하는 방법을 살펴봤습니다. 이번 포스팅에서는 클러스터내 Pod 끼리 디스크를 공유해야하는 경우 사용되는 Persistent Volume 유형

cla9.tistory.com

https://sws1223.tistory.com/6

 

내가 보기 위한 쿠버네티스 정리글 - 4 (volume)

오늘은 쿠버네티스의 볼륨에 대하여 알아볼 예정이다. 먼저 쿠버네티스에서 지원하는 볼륨에는 아래와 같이 다양한 유형들이 존재한다. awsElasticBlockStore - AWS Elastic Block Store (EBS) azureDisk - Azur..

sws1223.tistory.com

 

'Container Infrastructure > Side Project_202108' 카테고리의 다른 글

16. Jenkins PipeLine 작성  (0) 2021.08.30
15. Jenkins  (0) 2021.08.30
13. Helm  (0) 2021.08.29
12. Docker Container  (0) 2021.08.28
11. kubernetes dashboard 생성  (0) 2021.08.28