



## 쿠버네티스용 EFS 구성하기

- 보안그룹 추가 (해당 워커노드 서브넷 모두)
: k8s-ClusterSharedNodeSecurityGroup~
: k8s-nodegroup-ng~



- EFS ID 생성



## Node와 연결 TEST


- mkdir /web-data
- mount -t nfs4 <EFS ID> /web-data
- mount | tail -1 (연결 정보 확인)

## EFS Dynamic Provisioner 배포하기


- Dynamic Provisioner 4개 파일 활용

: configmap.yaml (환경변수 정의)

: storage-class.yaml

: efs-provisioner-deploy.yaml




: kubectl apply -f ~~ 4개 파일 실행

: kubectl get storageclasses~
: kubectl get pods (EFS 프로비저너 POD 확인)


## PVC 생성 (웹서버가 사용할 디스크 요청)


- web-pvc.yaml
- kubectl apply -f web-pvc.yaml
- kubectl get pvc



- 워커노드 1번에서 /web-data 폴더 확인 (pvc 폴더 생성 확인)
- index.html 생성


## EFS 사용하는 웹서비스 Deployment


## web-deployment.yaml


## kubectl get pvc


## kubectl get pods


## 외부 접속을 위한 SVC 생성
- web-svc-yaml
- kubectl apply -f web-svc.yaml

- kubectl get svc (ALB 생성시 소요시간 필요 - 약 10분)





## 서비스 종료
- kubectl delete -f .

- kubectl get pv
- kubectl delete pv pvc-~~ (먼저 삭제해야 EFS 삭제 가능)

- 각 노드에서 사전에 Mount 해제해야 EFS 삭제 가능 (안되면 리부팅)



- eksctl delete cluster --name k8s-demo
- ./stop.sh


https://github.com/kubernetes-retired/external-storage/tree/master/aws/efs/deploy
GitHub - kubernetes-retired/external-storage: [EOL] External storage plugins, provisioners, and helper libraries
[EOL] External storage plugins, provisioners, and helper libraries - GitHub - kubernetes-retired/external-storage: [EOL] External storage plugins, provisioners, and helper libraries
github.com
'[따베클]' 카테고리의 다른 글
AWS (Amazon Web Service) EKS를 이용하여 Kubernetes를 구축해보자! - 2 (0) | 2023.01.10 |
---|---|
AWS (Amazon Web Service) EKS를 이용하여 Kubernetes를 구축해보자! - 1 (0) | 2023.01.09 |