๋กœ์ผ“๐Ÿพ
article thumbnail

 

ํผ๋ธ”๋ฆญ ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์—์„œ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค๋ฅผ ์šด์˜ํ•  ๋•Œ ์˜จํ”„๋กœ๋ฏธ์Šค๋ณด๋‹ค ํŽธํ•œ ์  ์ค‘ ํ•˜๋‚˜๊ฐ€ ๋ฐ”๋กœ ๋ณผ๋ฅจ ๊ด€๋ฆฌ ๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

EBS CSI Driver ๋ฅผ ์„ค์น˜ ํ›„ Storage Class, PV ๊ทธ๋ฆฌ๊ณ  PVC ๋ฅผ ํ†ตํ•ด ์‰ฝ๊ฒŒ AWS EBS ๋ฅผ ํ†ตํ•ด ๋ณผ๋ฅจ์„ ์–ธ์ œ ์–ด๋””์„œ๋“  ๊ฐ€์ ธ๋‹ค ์“ธ ์ˆ˜ ์žˆ์ฃ .

์•„์ด์–ธ๋งจ ์ŠˆํŠธ์ฒ˜๋Ÿผ?

 

ํ•œํŽธ, ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค์—์„  ๋‹ค์–‘ํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ๋ณผ๋ฅจ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ์š”.

์ปจํ…Œ์ด๋„ˆ๊ฐ„ ๊ณต์œ ๋ฅผ ๊ฐ€๋Šฅ์ผ€ ํ•ด์ฃผ๋Š” EmptyDir, ๋…ธ๋“œ์˜ ๋ณผ๋ฅจ์„ ํ†ตํ•ด ํŒŒ๋“œ๊ฐ„ ๊ณต์œ ๋ฅผ ๊ฐ€๋Šฅ์ผ€ ํ•ด์ฃผ๋Š” HostPath, NFS ์„œ๋ฒ„๋ฅผ ์‚ฌ์šฉํ•˜๋Š” NFS ๊ธฐ๋Šฅ ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ทธ๋ผํŒŒ๋‚˜๋ฅผ ๋…ธ๋“œ์— ๋ฐฐํฌํ•  ๋•Œ, ๊ทธ๋ผํŒŒ๋‚˜์˜ ์„ค์ • ํŒŒ์ผ์€ ๊ทธ๋ผํŒŒ๋‚˜๊ฐ€ ๋ฐฐํฌ๋œ ๋…ธ๋“œ์˜ ๋ณผ๋ฅจ์— ์ €์žฅ์ด ๋ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋งŒ์•ฝ ๊ทธ๋ผํŒŒ๋‚˜ ํŒŒ๋“œ๊ฐ€ ๋‹ค๋ฅธ ๋…ธ๋“œ์— ๋ฐฐํฌ๊ฐ€ ๋  ๊ฒฝ์šฐ ์ด์ „์— ๊ฐ€์ง€๊ณ  ์žˆ๋˜ ๊ทธ๋ผํŒŒ๋‚˜ ์„ค์ •์„ ๋ถˆ๋Ÿฌ ์˜ฌ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋…ธ๋“œ์˜ ๋ณผ๋ฅจ์ด ๋ฐ”๊ผˆ๊ธฐ ๋•Œ๋ฌธ์ด์ฃ .

 

๊ฐ™์ง€ ์•Š์€ ๋…ธ๋“œ์— ํŒŒ๋“œ๊ฐ€ ๋ฐฐํฌ๋  ๊ฒฝ์šฐ ์ด์ „ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์—†์Œ

 

AWS EBS ๋Š” ๋ณดํ†ต ํ•œ ๋…ธ๋“œ์—๋งŒ ๋งˆ์šดํŠธ๊ฐ€ ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•  ๊ฒฝ์šฐ ์‰ฝ๊ฒŒ ๋งˆ์ฃผํ•  ์ˆ˜ ์žˆ๋Š” ๋ฌธ์ œ์ž…๋‹ˆ๋‹ค. 

 

์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„  2๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค. AWS EFS ๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ CNCF ํ”„๋กœ์ ํŠธ์ธ openEBS ๋ฅผ ์ด์šฉํ•˜๋Š” ๊ฒƒ์ด์ฃ .

EFS ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด ์‚ฌ์‹ค ์•„์ฃผ ์‰ฝ๊ฒŒ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv
spec:
  capacity:
    storage: 10Ei
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  persistentVolumeReclaimPolicy: Retain
  csi:
    driver: efs.csi.aws.com
    volumeHandle: <EFS ID>::<ACCESSPOINT ID>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 1Ei

 

์œ„ ์ฒ˜๋Ÿผ ๋ฐฐํฌํ•œ ํ›„ ๊ฐ€์ ธ๋‹ค ์‚ฌ์šฉํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. 

 

๊ทธ๋ฆฌ๊ณ  openEBS ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด cStor, Maya, Jiva ๋“ฑ ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

CAS ๋ฅผ ์ด์šฉํ•ด์„œ ๋…ธ๋“œ๊ฐ„ ๋ณผ๋ฅจ๋“ค์„ ๋™๊ธฐํ™” ์‹œ์ผœ์ฃผ๋Š” ๋ฐฉ์‹์ด์ฃ . ๋” ์ž์„ธํ•œ ๊ฑด ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”.

openEBS Overview

 

ํ•˜์ง€๋งŒ ์œ„ ๋ฐฉ๋ฒ•๋“ค์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ์š”?

 

ํ•œ ๋…ธ๋“œ์—๋งŒ ํŒŒ๋“œ๊ฐ€ ๋ฐฐํฌ๋  ์ˆ˜ ์žˆ๋„๋ก nodeSelector ๋ฅผ ์ง€์ •ํ•ด์ฃผ๊ณ , ํ•ด๋‹น ๋…ธ๋“œ์— EBS ๋ฅผ attach ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

๊ทธ๋ผํŒŒ๋‚˜์™€ ๊ฐ™์€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์€ ์‚ฌ์‹ค ์—ฌ๋Ÿฌ ๊ฐœ ํ•„์š”์—†์ด 1๊ฐœ์˜ ํŒŒ๋“œ๋งŒ ๋™์ž‘ ์ค‘์ด๋ฉด ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์—ฌ๋Ÿฌ ๋…ธ๋“œ์— ๊ฑฐ์ณ ๋ฐฐํฌ๋  ํ•„์š˜ ์—†์Šต๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ ๋…ธ๋“œ ํ•˜๋‚˜๋ฅผ ์ •ํ•œ ํ›„ ๊ฑฐ๊ธฐ์— ์ƒˆ๋กœ์šด EBS ๋ฅผ attach ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

๊ทธ๋Ÿผ ํ•œ๋ฒˆ ํ•ด๋ณด์ฃ .

 

AWS EBS ์—์„œ ๋ณผ๋ฅจ์„ ์ƒ์„ฑํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค. 

Dynamic ์ด ์•„๋‹Œ Static ํ•˜๊ฒŒ ๊ด€๋ฆฌํ•  ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— StorageClass ๋กœ ์ƒ์„ฑํ•  ํ•„์š”๋Š” ์—†์ฃ .

 

์ด์ œ PV ์™€ PVC ๋ฅผ ์ƒ์„ฑํ•˜์ฃ .

awsElasticBlockStore ๋Š” deprecated ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์— Static PV ๋ฅผ ์ƒ์„ฑํ•˜๋ ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
deprecated ๊ด€๋ จ ๋ฌธ์„œ๋Š” ์—ฌ๊ธฐ ์ฐธ์กฐ
apiVersion: v1
kind: PersistentVolume
metadata:
  name: grafana
spec:
  capacity:
    storage: 8Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: ""
  csi:
    driver: ebs.csi.aws.com
    volumeHandle: vol-xxxx
    volumeAttributes:
      fsType: ext4
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grafana
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi
  storageClassName: ""

 

์ดํ›„ kubectl get pv ์™€ kubectl get pvc ๋ฅผ ํ†ตํ•ด ์ž˜ ์ƒ์„ฑ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด์ค์‹œ๋‹ค. STATUS ๊ฐ€ Binding ์ด์—ฌ์•ผ ์„ฑ๊ณต์ ์œผ๋กœ ์ƒ์„ฑํ•œ ๊ฒ๋‹ˆ๋‹ค.

 

PV ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ƒ์„ฑ๋˜๋ฉด Available ์ด๊ณ , PV ๊ฐ€ PVC ์™€ ๊ด€๊ณ„๋ฅผ ๋งบ๊ฒŒ๋˜๋ฉด Bound ๋กœ ๋ฐ”๋€Œ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์—ฌ๊ธฐ์„œ ์ฃผ์˜ํ•  ์ ์€ PV ์™€ AWS EBS ๊ฐ€ ๋งบ์–ด์กŒ๋‹ค๊ณ  ํ•ด์„œ STATUS ๊ฐ€ Bound ๋˜๋Š” ๊ฒƒ์€ ์•„๋‹™๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  persistentVolumeReclaimPolicy ์€ ๋ฐ˜๋“œ์‹œ Retain ์œผ๋กœ ํ•ด์ค๋‹ˆ๋‹ค. Delete ๋กœ ํ•˜๊ฒŒ ๋˜๋ฉด UnBound ๊ฐ€ ๋˜์—ˆ์„ ๊ฒฝ์šฐ ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค.
NAME      CAPACITY  ACCESS MODES   RECLAIM POLICY   STATUS
grafana   8Gi       RWO            Retain           Available
grafana   8Gi       RWO            Retain           Bound

 

์ดํ›„ deploy.yaml ์— ๊ฐ€์ ธ๋‹ค ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. AWS EBS ์— ๋”ฐ๋กœ ์ €์žฅํ•˜๊ณ  ์žˆ์œผ๋‹ˆ ์ถ”ํ›„ ๊ทธ๋ผํŒŒ๋‚˜๋ฅผ ๋‹ค๋ฅธ ๋…ธ๋“œ์— ๋ฐฐํฌํ•œ๋‹ค๊ณ  ํ•ด๋„ ์ด์ „ ๋ฐ์ดํ„ฐ๋ฅผ ์ถฉ๋ถ„ํžˆ ๊ฐ€์ ธ๋‹ค ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

Node A ์—์„œ ์‚ฌ์šฉํ–ˆ๋˜ extra new EBS ๋ฅผ ๋–ผ์–ด ๋‹ค์‹œ Node B ์— attach

EBS ๊ฐ™์€ ๊ฒฝ์šฐ ์›Œ์ปค ๋…ธ๋“œ์™€ ๊ฐ™์€ ๊ฐ€์šฉ ์˜์—ญ์— ์กด์žฌํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๋งŒ์•ฝ ๋‹ค๋ฅธ ์˜์—ญ์— ์žˆ๋Š” ์›Œ์ปค ๋…ธ๋“œ์— ๋งˆ์šดํŠธํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, ์Šค๋ƒ…์ƒท์„ ์ด์šฉํ•ด ์›ํ•˜๋Š” ๊ฐ€์šฉ์˜์—ญ์— ๋ณต์‚ฌ ํ›„ ์‚ฌ์šฉํ•˜์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค,

 

 

์‚ฌ์‹ค EFS ๋ฅผ ๊ฐ€์ ธ๋‹ค ์“ฐ๋Š”๊ฒŒ ๊ฐ€์žฅ ํŽธํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋‹จ์ ์ด ์žˆ์ฃ .

  • EFS ๋Š” ๋น„์šฉ์ด ๋น„์‹ธ๋‹ค
  • EBS ๋ณด๋‹ค ์†๋„๊ฐ€ ๋Š๋ฆด ์ˆ˜ ๋ฐ–์— ์—†๋‹ค

 

ํ•˜์ง€๋งŒ ๊ด€๋ จ ๊ธ€๋“ค์„ ์ฐพ์•„๋ณด๋‹ˆ ๋Œ€๋ถ€๋ถ„ ๋‹ค๋ฅธ ๋…ธ๋“œ์— ํŒŒ๋“œ๊ฐ€ ๋ฐฐํฌ๋˜๋Š” ๊ฒฝ์šฐ ์„ค์ • ํŒŒ์ผ๋“ค์„ ๋™๊ธฐํ™” ์‹œํ‚ค๊ธฐ ์œ„ํ•ด์„  EFS ๋ฅผ ๋งŽ์ด ๊ถŒ์žฅํ•˜๋”๋ผ๊ณ ์š”. 

์ด๋ก ์ ์œผ๋ก  EFS ๋˜ํ•œ NFS ์ด๊ธฐ ๋•Œ๋ฌธ์— EBS ๋ณด๋‹ค ๋‹น์—ฐํžˆ ์†๋„๊ฐ€ ๋Š๋ฆด ์ˆ˜ ๋ฐ–์— ์—†๊ณ , File System ์ด๋ผ๋Š” ๋ชฉ์ ์—๋Š” ์•ฝ๊ฐ„ ๋ฒ—์–ด๋‚˜๊ธฐ๋Š” ํ•˜์ง€๋งŒ EFS ๋„ ์ถฉ๋ถ„ํžˆ ์†๋„๋ฉด์—์„  ๋น ๋ฅด๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

 

๊ทธ๋Ÿผ ์˜ค๋Š˜์€ ์—ฌ๊ธฐ๊นŒ์ง€!

 

profile on loading

Loading...