EKS - EBS CSI Driver 설치

목차

참고

EBS CSI Driver 설치를 위한 EKS 내 Service Account 생성

eksctl create iamserviceaccount \
--name ebs-csi-controller-sa \
--namespace kube-system \
--cluster <Cluste 이름> \
--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \
--approve \
--role-only \
--role-name AmazonEKS_EBS_CSI_DriverRole

EBS CSI Driver 설치

aws eks describe-addon-versions --addon-name aws-ebs-csi-driver
eksctl create addon \
--name aws-ebs-csi-driver \
--cluster <Cluste 이름> \
--service-account-role-arn arn:aws:iam::<AWS 계정 ID>:role/AmazonEKS_EBS_CSI_DriverRole \
--force

EBS StorageClass 생성

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: jenkins-ebs
namespace: cicd
volumeBindingMode: Immediate
# volumeBindingMode: WaitForFirstConsumer
provisioner: ebs.csi.aws.com
parameters:
type: gp3
tagSpecification_1: <tag name1>=<value1>
tagSpecification_2: <tag name2>=<value2>

reclaimPolicy: Retain
allowVolumeExpansion: true
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nexus-claim-efs
namespace: cicd
spec:
accessModes:
- ReadWriteOnce
storageClassName: nexus-ebs
resources:
requests:
storage: 20Gi
namespace: cicd
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: efs-sc
provisioner: efs.csi.aws.com
parameters:
provisioningMode: efs-ap
fileSystemId: "<EFS Filesystem ID>"
directoryPerms: "700"
gidRangeStart: "1000" # optional
gidRangeEnd: "2000" # optional
Share