Using EBS
Create service account using eksctl
CLUSTER_NAME="<cluster name>"
ROLE_NAME="<role name>"
REGION="<region code>"
eksctl create iamserviceaccount \
--name ebs-csi-controller-sa \
--namespace kube-system \
--cluster $CLUSTER_NAME \
--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \
--role-name $ROLE_NAME \
--role-only \
--region $REGION \
--approve
$CLUSTER_NAME="<cluster name>"
$ROLE_NAME="<role name>"
$REGION="<region code>"
eksctl create iamserviceaccount `
--name ebs-csi-controller-sa `
--namespace kube-system `
--cluster $CLUSTER_NAME `
--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy `
--role-name $ROLE_NAME `
--role-only `
--region $REGION `
--approve
Install EBS CSI Driver
CLUSTER_NAME="<cluster name>"
ROLE_NAME="<role name>"
REGION="<region code>"
ROLE_ARN=$(aws iam get-role --role-name $ROLE_NAME --region $REGION --query 'Role.Arn' --output text)
eksctl create addon \
--name aws-ebs-csi-driver \
--cluster $CLUSTER_NAME \
--service-account-role-arn $ROLE_ARN \
--region $REGION \
--force
$CLUSTER_NAME="<cluster name>"
$ROLE_NAME="<role name>"
$REGION="<region code>"
$ROLE_ARN = aws iam get-role --role-name $ROLE_NAME --region $REGION --query 'Role.Arn' --output text
eksctl create addon `
--name aws-ebs-csi-driver `
--cluster $CLUSTER_NAME `
--service-account-role-arn $ROLE_ARN `
--region $REGION `
--force
Use EBS File System
Static Provisioning
Note
You can see examples in HERE.
persistent-volume-claim.yaml | |
---|---|
Dynamic Provisioning
Note
You can see examples in HERE.
storage-class.yaml | |
---|---|
persistent-volume-claim.yaml | |
---|---|