[AEWS] #3์ฃผ์ฐจ EKS ๋…ธ๋“œ ๋ฆฌ์†Œ์Šค ํ• ๋‹น ๋ฐ ์Šคํ† ๋ฆฌ์ง€ ์„ฑ๋Šฅ ํ…Œ์ŠคํŠธ (3)

25๋…„๋„ AWS EKS Hands-on Study ์Šคํ„ฐ๋”” ์ •๋ฆฌ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.

kubestr fio ํ…Œ์ŠคํŠธ

fio ํ…Œ์ŠคํŠธ

[global]
ioengine=libaio
direct=1
bs=4k
runtime=120
time_based=1
iodepth=16
numjobs=4
group_reporting
size=1g
rw=randread
[read]

 

kubestr fio -f fio-read.fio -s local-path --size 10G
PVC created kubestr-fio-pvc-lrn6s
Pod created kubestr-fio-pod-tsbdw
Running FIO test (fio-read.fio) on StorageClass (local-path) with a PVC of Size (10G)
Elapsed time- 2m33.026228946s
FIO test results:

FIO version - fio-3.36
Global options - ioengine=libaio verify= direct=1 gtod_reduce=

JobName:
  blocksize= filesize= iodepth= rw=
read:
  IOPS=3024.037598 BW(KiB/s)=12096
  iops: min=2144 max=9001 avg=3025.845215
  bw(KiB/s): min=8576 max=36007 avg=12103.715820

Disk stats (read/write):
  nvme0n1: ios=362532/187 merge=0/9 ticks=6192083/4132 in_queue=6196215, util=96.232597%
  -  OK

 

AWS EBS Controller

EBS CSI Driver๋Š” ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค์—์„œ Amazon EBS ๋ณผ๋ฅจ์„ ๋™์ ์œผ๋กœ ํ”„๋กœ๋น„์ €๋‹ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” CSI(Container Storage Interface) ๊ธฐ๋ฐ˜์˜ ๋“œ๋ผ์ด๋ฒ„์ด๋‹ค.

 

(nana@myeks:N/A) [root@operator-host ~]# eksctl create addon --name aws-ebs-csi-driver --cluster ${CLUSTER_NAME} --service-account-role-arn arn:aws:iam::${ACCOUNT_ID}:role/AmazonEKS_EBS_CSI_DriverRole --force
2025-02-21 22:33:37 [โ„น]  Kubernetes version "1.31" in use by cluster "myeks"
2025-02-21 22:33:37 [โ„น]  IRSA is set for "aws-ebs-csi-driver" addon; will use this to configure IAM permissions
2025-02-21 22:33:37 [!]  the recommended way to provide IAM permissions for "aws-ebs-csi-driver" addon is via pod identity associations; after addon creation is completed, run `eksctl utils migrate-to-pod-identity`
2025-02-21 22:33:37 [โ„น]  using provided ServiceAccountRoleARN "arn:aws:iam::390844768149:role/AmazonEKS_EBS_CSI_DriverRole"
2025-02-21 22:33:37 [โ„น]  creating addon: aws-ebs-csi-driver

(nana@myeks:N/A) [root@operator-host ~]# kubectl get sa -n kube-system ebs-csi-controller-sa -o yaml | head -5
Error from server (NotFound): serviceaccounts "ebs-csi-controller-sa" not found

 

AmazonEKS_EBS_CSI_DriverRole IAM ์—ญํ• ์„ ์‚ฌ์šฉํ•˜์—ฌ ์• ๋“œ์˜จ์ด EBS ๋ณผ๋ฅจ์„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•œ๋‹ค.

์•„์ง ๋งŒ๋“ค์–ด์ง€๊ณ  ์žˆ๋Š” ์ค‘์ด๋ผ์„œ ์„œ๋น„์Šค ๊ณ„์ •์ด ์—†๋‹ค๊ณ  ๋‚˜์˜ค๊ฒŒ ๋œ๋‹ค.

(nana@myeks:N/A) [root@operator-host ~]# kubectl get deploy,ds -l=app.kubernetes.io/name=aws-ebs-csi-driver -n kube-system

NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/ebs-csi-controller   2/2     2            2           35s

NAME                                  DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR              AGE
daemonset.apps/ebs-csi-node           3         3         3       3            3           kubernetes.io/os=linux     36s
daemonset.apps/ebs-csi-node-windows   0         0         0       0            0           kubernetes.io/os=windows   36s

 

ebs-csi-node DaemonSet์ด ์ •์ƒ์ ์œผ๋กœ ๋ฐฐํฌ๋˜์—ˆ๋Š”๋ฐ, ๊ฐ ๋…ธ๋“œ๋งˆ๋‹ค 1๊ฐœ์˜ ebs-csi-node ํŒŒ๋“œ๊ฐ€ ์‹คํ–‰๋œ ๊ฒƒ์œผ๋กœ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

(nana@myeks:N/A) [root@operator-host ~]# kubectl get pod -n kube-system -l 'app in (ebs-csi-controller,ebs-csi-node)'
NAME                                 READY   STATUS    RESTARTS   AGE
ebs-csi-controller-7f8f8cb84-f27l4   6/6     Running   0          36s
ebs-csi-controller-7f8f8cb84-jlsqp   6/6     Running   0          36s
ebs-csi-node-7bd5h                   3/3     Running   0          37s
ebs-csi-node-dt2qr                   3/3     Running   0          37s
ebs-csi-node-fj97t                   3/3     Running   0          37s

(nana@myeks:N/A) [root@operator-host ~]# kubectl get pod -n kube-system -l app.kubernetes.io/component=csi-driver
NAME                                 READY   STATUS    RESTARTS   AGE
ebs-csi-controller-7f8f8cb84-f27l4   6/6     Running   0          37s
ebs-csi-controller-7f8f8cb84-jlsqp   6/6     Running   0          37s
ebs-csi-node-7bd5h                   3/3     Running   0          38s
ebs-csi-node-dt2qr                   3/3     Running   0          38s
ebs-csi-node-fj97t                   3/3     Running   0          38s

(nana@myeks:N/A) [root@operator-host ~]# kubectl get pod -n kube-system -l app=ebs-csi-controller -o jsonpath='{.items[0].spec.containers[*].name}' ; echo
ebs-plugin csi-provisioner csi-attacher csi-snapshotter csi-resizer liveness-probe

(nana@myeks:N/A) [root@operator-host ~]# kubectl api-resources | grep -i csi
csidrivers                                       storage.k8s.io/v1                 false        CSIDriver
csinodes                                         storage.k8s.io/v1                 false        CSINode
csistoragecapacities                             storage.k8s.io/v1                 true         CSIStorageCapacity
(nana@myeks:N/A) [root@operator-host ~]# kubectl get csinodes
NAME                                               DRIVERS   AGE
ip-192-168-1-13.ap-northeast-2.compute.internal    1         5d1h
ip-192-168-2-229.ap-northeast-2.compute.internal   1         5d1h
ip-192-168-3-122.ap-northeast-2.compute.internal   1         5d1h
(nana@myeks:N/A) [root@operator-host ~]# kubectl describe csinodes
Name:               ip-192-168-1-13.ap-northeast-2.compute.internal
Labels:             <none>
Annotations:        storage.alpha.kubernetes.io/migrated-plugins:
                      kubernetes.io/aws-ebs,kubernetes.io/azure-disk,kubernetes.io/azure-file,kubernetes.io/cinder,kubernetes.io/gce-pd,kubernetes.io/portworx-v...
CreationTimestamp:  Sun, 16 Feb 2025 20:43:06 +0900
Spec:
  Drivers:
    ebs.csi.aws.com:
      Node ID:  i-0d6799dedb360590e
      Allocatables:
        Count:        25
      Topology Keys:  [kubernetes.io/os topology.ebs.csi.aws.com/zone topology.kubernetes.io/zone]
Events:               <none>


Name:               ip-192-168-2-229.ap-northeast-2.compute.internal
Labels:             <none>
Annotations:        storage.alpha.kubernetes.io/migrated-plugins:
                      kubernetes.io/aws-ebs,kubernetes.io/azure-disk,kubernetes.io/azure-file,kubernetes.io/cinder,kubernetes.io/gce-pd,kubernetes.io/portworx-v...
CreationTimestamp:  Sun, 16 Feb 2025 20:43:00 +0900
Spec:
  Drivers:
    ebs.csi.aws.com:
      Node ID:  i-0ec89466e83491846
      Allocatables:
        Count:        25
      Topology Keys:  [kubernetes.io/os topology.ebs.csi.aws.com/zone topology.kubernetes.io/zone]
Events:               <none>


Name:               ip-192-168-3-122.ap-northeast-2.compute.internal
Labels:             <none>
Annotations:        storage.alpha.kubernetes.io/migrated-plugins:
                      kubernetes.io/aws-ebs,kubernetes.io/azure-disk,kubernetes.io/azure-file,kubernetes.io/cinder,kubernetes.io/gce-pd,kubernetes.io/portworx-v...
CreationTimestamp:  Sun, 16 Feb 2025 20:43:01 +0900
Spec:
  Drivers:
    ebs.csi.aws.com:
      Node ID:  i-060b87d1d161c0e48
      Allocatables:
        Count:        25
      Topology Keys:  [kubernetes.io/os topology.ebs.csi.aws.com/zone topology.kubernetes.io/zone]
Events:               <none>

 

๊ฐ๊ฐ์˜ EKS ๋…ธ๋“œ์— EBS CSI Driver๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์—ฐ๊ฒฐ๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, ๊ฐ ๋…ธ๋“œ๋Š” 25๊ฐœ์˜ ๋ณผ๋ฅจ์„ ํ• ๋‹น ๊ฐ€๋Šฅํ•˜๋ฉฐ BS ๋ณผ๋ฅจ์ด ํŠน์ • AZ์— ๋ฐฐ์น˜๋  ์ˆ˜ ์žˆ๋„๋ก topology.ebs.csi.aws.com/zone ์ •๋ณด๊ฐ€ ์„ค์ •๋œ๋‹ค.

 

EBS ํ• ๋‹น ๊ฐฏ์ˆ˜ ๋ณ€๊ฒฝ

(nana@myeks:N/A) [root@operator-host ~]# aws eks update-addon --cluster-name ${CLUSTER_NAME} --addon-name aws-ebs-csi-driver \
>   --addon-version v1.39.0-eksbuild.1 --configuration-values '{
>     "node": {
>       "volumeAttachLimit": 31,
>       "enableMetrics": true
>     }
>   }'
{
    "update": {
        "id": "a79dc9e7-8abc-38ad-9aaf-ea76635800ab",
        "status": "InProgress",
        "type": "AddonUpdate",
        "params": [
            {
                "type": "AddonVersion",
                "value": "v1.39.0-eksbuild.1"
            },
            {
                "type": "ConfigurationValues",
                "value": "{\n    \"node\": {\n      \"volumeAttachLimit\": 31,\n      \"enableMetrics\": true\n    }\n  }"
            }
        ],
        "createdAt": "2025-02-21T22:50:59.641000+09:00",
        "errors": []
    }
}

(nana@myeks:N/A) [root@operator-host ~]# kubectl describe csinodes
...
Spec:
  Drivers:
    ebs.csi.aws.com:
      Node ID:  i-0ec89466e83491846
      Allocatables:
        Count:        31

 

๋…ธ๋“œ์— ๋ถ€์ฐฉ๋˜๋Š” EBS์˜ ๊ฐฏ์ˆ˜๋ฅผ ๋ณ€๊ฒฝํ•ด์ฃผ๊ธฐ ์œ„ํ•ด์„œ ์•ผ๋ฏˆ ํŒŒ์ผ์„ ์ˆ˜์ •ํ•œ ํ›„ csinodes๋ฅผ ํ™•์ธํ•œ๋‹ค.

 

pvc, pv ์ƒ์„ฑ ํ…Œ์ŠคํŠธ

pvc ์ƒ์„ฑ

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 4Gi
  storageClassName: gp3
EOF

 

ํŒŒ๋“œ ์ƒ์„ฑ

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: app
spec:
  terminationGracePeriodSeconds: 3
  containers:
  - name: app
    image: centos
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo \$(date -u) >> /data/out.txt; sleep 5; done"]
    volumeMounts:
    - name: persistent-storage
      mountPath: /data
  volumes:
  - name: persistent-storage
    persistentVolumeClaim:
      claimName: ebs-claim
EOF

 

์ƒ์„ฑ ํ™•์ธ

(nana@myeks:N/A) [root@operator-host ~]# kubectl get pvc,pv,pod
NAME                                          STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
persistentvolumeclaim/ebs-claim               Bound    pvc-555a8439-31fd-475a-bd6e-aa5704bf188b   4Gi        RWO            gp3            <unset>                 27s
persistentvolumeclaim/kubestr-fio-pvc-zf8rq   Bound    pvc-18850c9e-88ed-48c4-97c2-b4a3dfc157f4   100Gi      RWO            local-path     <unset>                 36m

NAME                                                        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                           STORAGECLASS   VOLUMEATTRIBUTESCLASS   REASON   AGE
persistentvolume/pvc-18850c9e-88ed-48c4-97c2-b4a3dfc157f4   100Gi      RWO            Delete           Bound    default/kubestr-fio-pvc-zf8rq   local-path     <unset>                          36m
persistentvolume/pvc-555a8439-31fd-475a-bd6e-aa5704bf188b   4Gi        RWO            Delete           Bound    default/ebs-claim               gp3            <unset>                          4s

NAME                        READY   STATUS              RESTARTS   AGE
pod/app                     0/1     ContainerCreating   0          7s
pod/kubestr-fio-pod-gr6p7   1/1     Running             0          36m

(nana@myeks:N/A) [root@operator-host ~]# kubectl get VolumeAttachment
NAME                                                                   ATTACHER          PV                                         NODE                                               ATTACHED   AGE
csi-a0facaf2ca346eaf8e31569d53b71e401e993d69b485336d2ce585120cf9dcfd   ebs.csi.aws.com   pvc-555a8439-31fd-475a-bd6e-aa5704bf188b   ip-192-168-2-229.ap-northeast-2.compute.internal   true       10s

(nana@myeks:N/A) [root@operator-host ~]# kubectl df-pv
INFO[2025-02-21T22:55:39+09:00] Either no volumes found in namespace/s: 'all' or the storage provisioner used for the volumes does not publish metrics to kubelet

# ์กฐ๊ธˆ ๊ธฐ๋‹ค๋ ธ๋‹ค๊ฐ€ ๋‹ค์‹œ df-pv

(nana@myeks:N/A) [root@operator-host ~]# kubectl df-pv
 PV NAME                                   PVC NAME   NAMESPACE  NODE NAME                                         POD NAME  VOLUME MOUNT NAME   SIZE  USED  AVAILABLE  %USED  IUSED  IFREE    %IUSED
 pvc-555a8439-31fd-475a-bd6e-aa5704bf188b  ebs-claim  default    ip-192-168-2-229.ap-northeast-2.compute.internal  app       persistent-storage  3Gi   60Mi  3Gi        1.50   4      2097148  0.00

 

[ec2-user@ip-192-168-3-122 ~]$ while true; do aws ec2 describe-volumes --filters Name=tag:ebs.csi.aws.com/cluster,Values=true --query "Volumes[].{VolumeId: VolumeId, VolumeType: VolumeType, InstanceId: Attachments[0].InstanceId, State: Attachments[0].State}" --output text; date; sleep 1; done

Fri Feb 21 13:55:12 UTC 2025
Fri Feb 21 13:55:14 UTC 2025
Fri Feb 21 13:55:16 UTC 2025
Fri Feb 21 13:55:19 UTC 2025
None    None    vol-04ade57551c3cdee0   gp3
Fri Feb 21 13:55:21 UTC 2025
None    None    vol-04ade57551c3cdee0   gp3
Fri Feb 21 13:55:23 UTC 2025
i-0ec89466e83491846     attached        vol-04ade57551c3cdee0   gp3
Fri Feb 21 13:55:26 UTC 2025

 

(nana@myeks:N/A) [root@operator-host ~]# kubectl get node --label-columns=topology.ebs.csi.aws.com/zone,topology.k8s.aws/zone-id
NAME                                               STATUS   ROLES    AGE    VERSION               ZONE              ZONE-ID
ip-192-168-1-13.ap-northeast-2.compute.internal    Ready    <none>   5d2h   v1.31.5-eks-5d632ec   ap-northeast-2a   apne2-az1
ip-192-168-2-229.ap-northeast-2.compute.internal   Ready    <none>   5d2h   v1.31.5-eks-5d632ec   ap-northeast-2b   apne2-az2
ip-192-168-3-122.ap-northeast-2.compute.internal   Ready    <none>   5d2h   v1.31.5-eks-5d632ec   ap-northeast-2c   apne2-az3

(nana@myeks:N/A) [root@operator-host ~]#
(nana@myeks:N/A) [root@operator-host ~]# kubectl describe node
Name:               ip-192-168-1-13.ap-northeast-2.compute.internal
Roles:              <none>
Labels:             alpha.eksctl.io/cluster-name=myeks
                    alpha.eksctl.io/nodegroup-name=ng1
                    beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/instance-type=t3.medium
                    beta.kubernetes.io/os=linux
                    eks.amazonaws.com/capacityType=ON_DEMAND
                    eks.amazonaws.com/nodegroup=ng1
                    eks.amazonaws.com/nodegroup-image=ami-09aa6ccd2d0305078
                    eks.amazonaws.com/sourceLaunchTemplateId=lt-09e54fc3c4a0843b5
                    eks.amazonaws.com/sourceLaunchTemplateVersion=1
                    failure-domain.beta.kubernetes.io/region=ap-northeast-2
                    failure-domain.beta.kubernetes.io/zone=ap-northeast-2a
                    k8s.io/cloud-provider-aws=5553ae84a0d29114870f67bbabd07d44
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=ip-192-168-1-13.ap-northeast-2.compute.internal
                    kubernetes.io/os=linux
                    node.kubernetes.io/instance-type=t3.medium
                    topology.ebs.csi.aws.com/zone=ap-northeast-2a
                    topology.k8s.aws/zone-id=apne2-az1
                    topology.kubernetes.io/region=ap-northeast-2
                    topology.kubernetes.io/zone=ap-northeast-2a
Annotations:        alpha.kubernetes.io/provided-node-ip: 192.168.1.13
                    csi.volume.kubernetes.io/nodeid: {"ebs.csi.aws.com":"i-0d6799dedb360590e"}
                    node.alpha.kubernetes.io/ttl: 0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Sun, 16 Feb 2025 20:43:06 +0900
Taints:             <none>
Unschedulable:      false
Lease:
  HolderIdentity:  ip-192-168-1-13.ap-northeast-2.compute.internal
  AcquireTime:     <unset>
  RenewTime:       Fri, 21 Feb 2025 23:33:18 +0900
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Fri, 21 Feb 2025 23:30:14 +0900   Sun, 16 Feb 2025 20:43:05 +0900   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Fri, 21 Feb 2025 23:30:14 +0900   Sun, 16 Feb 2025 20:43:05 +0900   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Fri, 21 Feb 2025 23:30:14 +0900   Sun, 16 Feb 2025 20:43:05 +0900   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            True    Fri, 21 Feb 2025 23:30:14 +0900   Sun, 16 Feb 2025 20:43:18 +0900   KubeletReady                 kubelet is posting ready status
Addresses:
  InternalIP:   192.168.1.13
  ExternalIP:   3.36.51.76
  InternalDNS:  ip-192-168-1-13.ap-northeast-2.compute.internal
  Hostname:     ip-192-168-1-13.ap-northeast-2.compute.internal
  ExternalDNS:  ec2-3-36-51-76.ap-northeast-2.compute.amazonaws.com
Capacity:
  cpu:                2
  ephemeral-storage:  125751276Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3919536Ki
  pods:               100
Allocatable:
  cpu:                1930m
  ephemeral-storage:  114818633946
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3364528Ki
  pods:               100
System Info:
  Machine ID:                 ec2c51e08a14eb59df9e9435dfcf2229
  System UUID:                ec2c51e0-8a14-eb59-df9e-9435dfcf2229
  Boot ID:                    de5cde2c-7797-4e32-950d-6e14d436e050
  Kernel Version:             6.1.127-135.201.amzn2023.x86_64
  OS Image:                   Amazon Linux 2023.6.20250203
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  containerd://1.7.25
  Kubelet Version:            v1.31.5-eks-5d632ec
  Kube-Proxy Version:         v1.31.5-eks-5d632ec
ProviderID:                   aws:///ap-northeast-2a/i-0d6799dedb360590e
Non-terminated Pods:          (7 in total)
  Namespace                   Name                                      CPU Requests  CPU Limits  Memory Requests  Memory Limits  Age
  ---------                   ----                                      ------------  ----------  ---------------  -------------  ---
  kube-system                 aws-node-r64zs                            50m (2%)      0 (0%)      0 (0%)           0 (0%)         5d2h
  kube-system                 ebs-csi-controller-7f8f8cb84-f27l4        60m (3%)      0 (0%)      240Mi (7%)       1536Mi (46%)   59m
  kube-system                 ebs-csi-node-hnjrv                        30m (1%)      0 (0%)      120Mi (3%)       768Mi (23%)    42m
  kube-system                 external-dns-5dbdd664bc-v25xp             0 (0%)        0 (0%)      0 (0%)           0 (0%)         46h
  kube-system                 kube-ops-view-657dbc6cd8-7kvtw            0 (0%)        0 (0%)      0 (0%)           0 (0%)         46h
  kube-system                 kube-proxy-hh4tr                          100m (5%)     0 (0%)      0 (0%)           0 (0%)         5d2h
  local-path-storage          local-path-provisioner-84967477f-7bg7g    0 (0%)        0 (0%)      0 (0%)           0 (0%)         3d21h
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests     Limits
  --------           --------     ------
  cpu                240m (12%)   0 (0%)
  memory             360Mi (10%)  2304Mi (70%)
  ephemeral-storage  0 (0%)       0 (0%)
  hugepages-1Gi      0 (0%)       0 (0%)
  hugepages-2Mi      0 (0%)       0 (0%)
Events:              <none>


Name:               ip-192-168-2-229.ap-northeast-2.compute.internal
Roles:              <none>
Labels:             alpha.eksctl.io/cluster-name=myeks
                    alpha.eksctl.io/nodegroup-name=ng1
                    beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/instance-type=t3.medium
                    beta.kubernetes.io/os=linux
                    eks.amazonaws.com/capacityType=ON_DEMAND
                    eks.amazonaws.com/nodegroup=ng1
                    eks.amazonaws.com/nodegroup-image=ami-09aa6ccd2d0305078
                    eks.amazonaws.com/sourceLaunchTemplateId=lt-09e54fc3c4a0843b5
                    eks.amazonaws.com/sourceLaunchTemplateVersion=1
                    failure-domain.beta.kubernetes.io/region=ap-northeast-2
                    failure-domain.beta.kubernetes.io/zone=ap-northeast-2b
                    k8s.io/cloud-provider-aws=5553ae84a0d29114870f67bbabd07d44
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=ip-192-168-2-229.ap-northeast-2.compute.internal
                    kubernetes.io/os=linux
                    node.kubernetes.io/instance-type=t3.medium
                    topology.ebs.csi.aws.com/zone=ap-northeast-2b
                    topology.k8s.aws/zone-id=apne2-az2
                    topology.kubernetes.io/region=ap-northeast-2
                    topology.kubernetes.io/zone=ap-northeast-2b
Annotations:        alpha.kubernetes.io/provided-node-ip: 192.168.2.229
                    csi.volume.kubernetes.io/nodeid: {"ebs.csi.aws.com":"i-0ec89466e83491846"}
                    node.alpha.kubernetes.io/ttl: 0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Sun, 16 Feb 2025 20:43:00 +0900
Taints:             <none>
Unschedulable:      false
Lease:
  HolderIdentity:  ip-192-168-2-229.ap-northeast-2.compute.internal
  AcquireTime:     <unset>
  RenewTime:       Fri, 21 Feb 2025 23:33:16 +0900
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Fri, 21 Feb 2025 23:31:44 +0900   Sun, 16 Feb 2025 20:42:59 +0900   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Fri, 21 Feb 2025 23:31:44 +0900   Sun, 16 Feb 2025 20:42:59 +0900   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Fri, 21 Feb 2025 23:31:44 +0900   Sun, 16 Feb 2025 20:42:59 +0900   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            True    Fri, 21 Feb 2025 23:31:44 +0900   Sun, 16 Feb 2025 20:43:10 +0900   KubeletReady                 kubelet is posting ready status
Addresses:
  InternalIP:   192.168.2.229
  ExternalIP:   43.203.132.94
  InternalDNS:  ip-192-168-2-229.ap-northeast-2.compute.internal
  Hostname:     ip-192-168-2-229.ap-northeast-2.compute.internal
  ExternalDNS:  ec2-43-203-132-94.ap-northeast-2.compute.amazonaws.com
Capacity:
  cpu:                2
  ephemeral-storage:  125751276Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3919536Ki
  pods:               100
Allocatable:
  cpu:                1930m
  ephemeral-storage:  114818633946
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3364528Ki
  pods:               100
System Info:
  Machine ID:                 ec2975cab785ece83de533411578550f
  System UUID:                ec2975ca-b785-ece8-3de5-33411578550f
  Boot ID:                    359912a2-38ba-4d7c-8480-bf6417ad646f
  Kernel Version:             6.1.127-135.201.amzn2023.x86_64
  OS Image:                   Amazon Linux 2023.6.20250203
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  containerd://1.7.25
  Kubelet Version:            v1.31.5-eks-5d632ec
  Kube-Proxy Version:         v1.31.5-eks-5d632ec
ProviderID:                   aws:///ap-northeast-2b/i-0ec89466e83491846
Non-terminated Pods:          (8 in total)
  Namespace                   Name                                           CPU Requests  CPU Limits  Memory Requests  Memory Limits  Age
  ---------                   ----                                           ------------  ----------  ---------------  -------------  ---
  default                     app                                            0 (0%)        0 (0%)      0 (0%)           0 (0%)         38m
  kube-system                 aws-load-balancer-controller-554fbd9d-qxc6v    0 (0%)        0 (0%)      0 (0%)           0 (0%)         46h
  kube-system                 aws-node-z8sdh                                 50m (2%)      0 (0%)      0 (0%)           0 (0%)         5d2h
  kube-system                 coredns-86f5954566-xbnc8                       100m (5%)     0 (0%)      70Mi (2%)        170Mi (5%)     5d2h
  kube-system                 ebs-csi-controller-7f8f8cb84-jlsqp             60m (3%)      0 (0%)      240Mi (7%)       1536Mi (46%)   59m
  kube-system                 ebs-csi-node-9dld4                             30m (1%)      0 (0%)      120Mi (3%)       768Mi (23%)    42m
  kube-system                 kube-proxy-8sgcl                               100m (5%)     0 (0%)      0 (0%)           0 (0%)         5d2h
  kube-system                 metrics-server-6bf5998d9c-56skp                100m (5%)     0 (0%)      200Mi (6%)       400Mi (12%)    5d2h
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests     Limits
  --------           --------     ------
  cpu                440m (22%)   0 (0%)
  memory             630Mi (19%)  2874Mi (87%)
  ephemeral-storage  0 (0%)       0 (0%)
  hugepages-1Gi      0 (0%)       0 (0%)
  hugepages-2Mi      0 (0%)       0 (0%)
Events:              <none>


Name:               ip-192-168-3-122.ap-northeast-2.compute.internal
Roles:              <none>
Labels:             alpha.eksctl.io/cluster-name=myeks
                    alpha.eksctl.io/nodegroup-name=ng1
                    beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/instance-type=t3.medium
                    beta.kubernetes.io/os=linux
                    eks.amazonaws.com/capacityType=ON_DEMAND
                    eks.amazonaws.com/nodegroup=ng1
                    eks.amazonaws.com/nodegroup-image=ami-09aa6ccd2d0305078
                    eks.amazonaws.com/sourceLaunchTemplateId=lt-09e54fc3c4a0843b5
                    eks.amazonaws.com/sourceLaunchTemplateVersion=1
                    failure-domain.beta.kubernetes.io/region=ap-northeast-2
                    failure-domain.beta.kubernetes.io/zone=ap-northeast-2c
                    k8s.io/cloud-provider-aws=5553ae84a0d29114870f67bbabd07d44
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=ip-192-168-3-122.ap-northeast-2.compute.internal
                    kubernetes.io/os=linux
                    node.kubernetes.io/instance-type=t3.medium
                    topology.ebs.csi.aws.com/zone=ap-northeast-2c
                    topology.k8s.aws/zone-id=apne2-az3
                    topology.kubernetes.io/region=ap-northeast-2
                    topology.kubernetes.io/zone=ap-northeast-2c
Annotations:        alpha.kubernetes.io/provided-node-ip: 192.168.3.122
                    csi.volume.kubernetes.io/nodeid: {"ebs.csi.aws.com":"i-060b87d1d161c0e48"}
                    node.alpha.kubernetes.io/ttl: 0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Sun, 16 Feb 2025 20:43:01 +0900
Taints:             <none>
Unschedulable:      false
Lease:
  HolderIdentity:  ip-192-168-3-122.ap-northeast-2.compute.internal
  AcquireTime:     <unset>
  RenewTime:       Fri, 21 Feb 2025 23:33:12 +0900
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Fri, 21 Feb 2025 23:30:02 +0900   Sun, 16 Feb 2025 20:43:00 +0900   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Fri, 21 Feb 2025 23:30:02 +0900   Sun, 16 Feb 2025 20:43:00 +0900   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Fri, 21 Feb 2025 23:30:02 +0900   Sun, 16 Feb 2025 20:43:00 +0900   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            True    Fri, 21 Feb 2025 23:30:02 +0900   Sun, 16 Feb 2025 20:43:12 +0900   KubeletReady                 kubelet is posting ready status
Addresses:
  InternalIP:   192.168.3.122
  ExternalIP:   54.180.83.145
  InternalDNS:  ip-192-168-3-122.ap-northeast-2.compute.internal
  Hostname:     ip-192-168-3-122.ap-northeast-2.compute.internal
  ExternalDNS:  ec2-54-180-83-145.ap-northeast-2.compute.amazonaws.com
Capacity:
  cpu:                2
  ephemeral-storage:  125751276Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3919536Ki
  pods:               100
Allocatable:
  cpu:                1930m
  ephemeral-storage:  114818633946
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3364528Ki
  pods:               100
System Info:
  Machine ID:                 ec2e23debc7133e222b82c4289eee47f
  System UUID:                ec2e23de-bc71-33e2-22b8-2c4289eee47f
  Boot ID:                    d1b7846e-78e6-4f01-be08-74a5a6c76dbe
  Kernel Version:             6.1.127-135.201.amzn2023.x86_64
  OS Image:                   Amazon Linux 2023.6.20250203
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  containerd://1.7.25
  Kubelet Version:            v1.31.5-eks-5d632ec
  Kube-Proxy Version:         v1.31.5-eks-5d632ec
ProviderID:                   aws:///ap-northeast-2c/i-060b87d1d161c0e48
Non-terminated Pods:          (7 in total)
  Namespace                   Name                                           CPU Requests  CPU Limits  Memory Requests  Memory Limits  Age
  ---------                   ----                                           ------------  ----------  ---------------  -------------  ---
  default                     kubestr-fio-pod-gr6p7                          0 (0%)        0 (0%)      0 (0%)           0 (0%)         74m
  kube-system                 aws-load-balancer-controller-554fbd9d-bb2wm    0 (0%)        0 (0%)      0 (0%)           0 (0%)         46h
  kube-system                 aws-node-2btth                                 50m (2%)      0 (0%)      0 (0%)           0 (0%)         5d2h
  kube-system                 coredns-86f5954566-w24vz                       100m (5%)     0 (0%)      70Mi (2%)        170Mi (5%)     5d2h
  kube-system                 ebs-csi-node-k8t2k                             30m (1%)      0 (0%)      120Mi (3%)       768Mi (23%)    42m
  kube-system                 kube-proxy-4nlwd                               100m (5%)     0 (0%)      0 (0%)           0 (0%)         5d2h
  kube-system                 metrics-server-6bf5998d9c-h88hw                100m (5%)     0 (0%)      200Mi (6%)       400Mi (12%)    5d2h
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests     Limits
  --------           --------     ------
  cpu                380m (19%)   0 (0%)
  memory             390Mi (11%)  1338Mi (40%)
  ephemeral-storage  0 (0%)       0 (0%)
  hugepages-1Gi      0 (0%)       0 (0%)
  hugepages-2Mi      0 (0%)       0 (0%)
Events:              <none>
(nana@myeks:N/A) [root@operator-host ~]# kubectl exec app -- tail -f /data/out.txt
Fri Feb 21 14:33:16 UTC 2025
Fri Feb 21 14:33:21 UTC 2025
Fri Feb 21 14:33:26 UTC 2025
Fri Feb 21 14:33:31 UTC 2025
Fri Feb 21 14:33:36 UTC 2025
Fri Feb 21 14:33:41 UTC 2025
Fri Feb 21 14:33:46 UTC 2025
Fri Feb 21 14:33:51 UTC 2025
Fri Feb 21 14:33:56 UTC 2025
Fri Feb 21 14:34:01 UTC 2025
Fri Feb 21 14:34:06 UTC 2025
^C

(nana@myeks:N/A) [root@operator-host ~]# kubectl exec -it app -- sh -c 'df -hT --type=overlay'
Filesystem     Type     Size  Used Avail Use% Mounted on
overlay        overlay  120G  4.4G  116G   4% /
(nana@myeks:N/A) [root@operator-host ~]# kubectl exec -it app -- sh -c 'df -hT --type=xfs'
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/nvme1n1   xfs   4.0G   61M  3.9G   2% /data
/dev/nvme0n1p1 xfs   120G  4.4G  116G   4% /etc/hosts

 

AWS EFS Controller

EFS๋Š” NFS ๊ธฐ๋ฐ˜์˜ ๊ณต์œ  ํŒŒ์ผ ์Šคํ† ๋ฆฌ์ง€๋กœ, ์—ฌ๋Ÿฌ ์ธ์Šคํ„ด์Šค๋‚˜ ์ปจํ…Œ์ด๋„ˆ์—์„œ ๋™์‹œ์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋‹ค.

ํ•˜์ง€๋งŒ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ๊ธฐ๋ณธ ๋“œ๋ผ์ด๋ฒ„๋กœ๋Š” EFS๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋Š”๋ฐ,EFS CSI Controller๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค์™€ EFS๋ฅผ ์—ฐ๊ฒฐํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋กœ ๋™์ž‘ํ•˜๊ฒŒ ๋œ๋‹ค.

 

kubectl get pv
NAME       CAPACITY  ACCESS MODES  RECLAIM POLICY  STATUS      STORAGECLASS
efs-pv     5Gi       RWX           Retain          Available   efs-sc

 

kubectl get pvc
NAME         STATUS   VOLUME   CAPACITY  ACCESS MODES  STORAGECLASS
efs-claim    Bound    efs-pv   5Gi       RWX           efs-sc

 

kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE
app1    1/1     Running   0          6s
app2    1/1     Running   0          6s

 

pvc๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ๋งŒ๋“ค์–ด์ค€ pv์™€ ๋ฐ”์šด๋“œํ•˜์—ฌ ํŒŒ๋“œ๋ฅผ ๋ฐฐํฌํ•œ๋‹ค.

๋‘ ํŒŒ๋“œ๋Š” /data ๋””๋ ‰ํ„ฐ๋ฆฌ์— EFS๋ฅผ ๋งˆ์šดํŠธํ•˜์—ฌ ๊ฐ™์€ ์Šคํ† ๋ฆฌ์ง€๋ฅผ ๊ณต์œ ํ•˜๋„๋ก ์„ค์ •๋ผ์žˆ๋‹ค.

kubectl get pods

NAME                    READY   STATUS    RESTARTS   AGE
app1                    1/1     Running   0          6s
app2                    1/1     Running   0          6s
kubestr-fio-pod-gr6p7   1/1     Running   0          4h19m

kubectl exec -ti app1 -- sh -c "df -hT -t nfs4"
kubectl exec -ti app2 -- sh -c "df -hT -t nfs4"
Filesystem           Type            Size      Used Available Use% Mounted on
127.0.0.1:/          nfs4            8.0E         0      8.0E   0% /data

tree /mnt/myefs
/mnt/myefs
โ”œโ”€โ”€ out1.txt
โ”œโ”€โ”€ out2.txt
โ””โ”€โ”€ test.txt

0 directories, 3 files

 

EFS ์Šคํ† ๋ฆฌ์ง€์— ์ €์žฅ๋œ ํŒŒ์ผ๋“ค์„ ํ™•์ธํ•จ์œผ๋กœ์จ ์—ฌ๋Ÿฌ ํŒŒ๋“œ๊ฐ€ ๊ฐ™์€ ๋ฐ์ดํ„ฐ๋ฅผ ๊ณต์œ ํ•˜๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

Instance Store

EKS ํด๋Ÿฌ์Šคํ„ฐ์— ์ƒˆ๋กœ์šด ๋…ธ๋“œ ๊ทธ๋ฃน์„ ์ถ”๊ฐ€ํ•˜๊ณ  ํ•ด๋‹น ๋…ธ๋“œ์— ์›๊ฒฉ ์ ‘์†ํ•˜์—ฌ ๋””์Šคํฌ, ๋„คํŠธ์›Œํฌ, ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ์„ค์ •์„ ํ™•์ธํ•ด๋ณธ๋‹ค.

ssh ec2-user@$N4 sudo nvme list
Node             SN                   Model                                    Namespace Usage                      Format           FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     vol026622c5300b95916 Amazon Elastic Block Store               1          32.21  GB /  32.21  GB    512   B +  0 B   1.0
/dev/nvme1n1     AWS21EF3B4C02F591522 Amazon EC2 NVMe Instance Storage         1          50.00  GB /  50.00  GB    512   B +  0 B   0

ssh ec2-user@$N4 sudo lsblk -e 7 -d
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0    0   30G  0 disk
nvme1n1 259:1    0 46.6G  0 disk /data

ssh ec2-user@$N4 sudo df -hT -t xfs
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/nvme0n1p1 xfs    30G  3.5G   27G  12% /
/dev/nvme1n1   xfs    47G  365M   47G   1% /data

ssh ec2-user@$N4 sudo tree /data
/data

0 directories, 0 files

ssh ec2-user@$N4 sudo cat /etc/fstab
#
UUID=1dfdfe0d-276a-4d52-8572-ceb3b011d9ea     /           xfs    defaults,noatime  1   1
/dev/nvme1n1 /data xfs defaults,noatime 0 2

 

NVMe ๋””์Šคํฌ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ธ์‹๋˜๊ณ , XFS๋กœ ํฌ๋งท๋˜์–ด ์žˆ์œผ๋ฉฐ, /data์— ๋งˆ์šดํŠธ๋จ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

kubectl describe node -l disk=instancestore | grep Allocatable: -A7
Allocatable:
  cpu:                1930m
  ephemeral-storage:  27905944324
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3068808Ki
  pods:               110
System Info:

 ssh ec2-user@$N4 sudo ps -ef | grep kubelet
root        3017       1  0 15:54 ?        00:00:04 /usr/bin/kubelet --config /etc/kubernetes/kubelet/kubelet-config.json --kubeconfig /var/lib/kubelet/kubeconfig --container-runtime-endpoint unix:///run/containerd/containerd.sock --image-credential-provider-config /etc/eks/image-credential-provider/config.json --image-credential-provider-bin-dir /etc/eks/image-credential-provider --node-ip=192.168.1.54 --pod-infra-container-image=602401143452.dkr.ecr.ap-northeast-2.amazonaws.com/eks/pause:3.5 --v=2 --hostname-override=ip-192-168-1-54.ap-northeast-2.compute.internal --cloud-provider=external --node-labels=eks.amazonaws.com/sourceLaunchTemplateVersion=1,alpha.eksctl.io/cluster-name=myeks,alpha.eksctl.io/nodegroup-name=ng2,disk=instancestore,eks.amazonaws.com/nodegroup-image=ami-0fa05db9e3c145f63,eks.amazonaws.com/capacityType=ON_DEMAND,eks.amazonaws.com/nodegroup=ng2,eks.amazonaws.com/sourceLaunchTemplateId=lt-01b2db7fd90cca5d0 --max-pods=29 --max-pods=110
root        3782    3711  0 15:54 ?        00:00:00 /bin/aws-ebs-csi-driver node --endpoint=unix:/csi/csi.sock --http-endpoint=0.0.0.0:3302 --csi-mount-point-prefix=/var/lib/kubelet/plugins/kubernetes.io/csi/ebs.csi.aws.com/ --volume-attach-limit=31 --logging-format=text --v=2
root        3828    3711  0 15:54 ?        00:00:00 /csi-node-driver-registrar --csi-address=/csi/csi.sock --kubelet-registration-path=/var/lib/kubelet/plugins/ebs.csi.aws.com/csi.sock --v=2

 

ํ•ด๋‹น ๋…ธ๋“œ๋Š” ์•ฝ 2 vCPU, 3GB RAM, 110๊ฐœ์˜ Pod์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ์„ ์ œ๊ณตํ•œ๋‹ค.

 

kubestr fio -f fio-read.fio -s local-path --size 10G --nodeselector disk=instancestore
PVC created kubestr-fio-pvc-fkg48
Pod created kubestr-fio-pod-pxw9j
Running FIO test (fio-read.fio) on StorageClass (local-path) with a PVC of Size (10G)
Elapsed time- 3m42.696294755s
FIO test results:

FIO version - fio-3.36
Global options - ioengine=libaio verify= direct=1 gtod_reduce=

JobName:
  blocksize= filesize= iodepth= rw=
read:
  IOPS=20308.748047 BW(KiB/s)=81234
  iops: min=16210 max=93722 avg=20317.226562
  bw(KiB/s): min=64840 max=374888 avg=81268.945312

Disk stats (read/write):
  nvme1n1: ios=2433053/10 merge=0/3 ticks=7645486/14 in_queue=7645500, util=99.954948%
  -  OK

 

IOPS๊ฐ€ ์ดˆ๋‹น ํ‰๊ท  20,308๊ฐœ์˜ ์ฝ๊ธฐ ์ž‘์—… ์ˆ˜ํ–‰ ๋Œ€์—ญํญ์€ ํ‰๊ท  81,234 KiB/s(์•ฝ 80 MB/s)์˜ ์†๋„๋กœ ๋ฐ์ดํ„ฐ ์ฝ๊ธฐ ์ˆ˜ํ–‰๊ฐ€๋Šฅํ•˜๋‹ค.