2021.09. ์ด์žฅ์žฌ ๐Ÿ“ง [email protected] ๐Ÿ“‚ https://github.com/jangjaelee ๐Ÿ“’ http://www.awx.kr



๋ชฉํ‘œ

์˜คํ”ˆ์†Œ์Šค ๋ถ„์‚ฐ ๋ธ”๋ก ์Šคํ† ๋ฆฌ์ง€ ์‹œ์Šคํ…œ(distributed block storage system) ์†”๋ฃจ์…˜ Longhorn์˜ Volume์„ ์ƒ์„ฑํ•˜๊ณ  Persistent Volumes (PVs), Persistent Volue Claims (PVCs)๋ฅผ Kubernetes persistent storage resources๋กœ ์ƒ์„ฑ ํ•˜์—ฌ POD์—์„œ ๋ณผ๋ฅจ์„ ๋งˆ์šดํŠธ ํ•˜๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ํ•ฉ๋‹ˆ๋‹ค.


Step 1. using Kubernetes Persistent Storage with Longhorn

Longhorn Volume์„ ์ƒ์„ฑํ•˜๊ณ  Persistent Volumes (PVs) ๋ฐ Persistent Volume Claims (PVCs)๋ฅผ Kubernetes persistent storage๋กœ ์ƒ์„ฑํ›„ POD์— ์ƒ์„ฑํ•œ Volume์„ ๋งˆ์šดํŠธ ๋ฐฉ๋ฒ•์„ ์•Œ์•„ ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

Longhorn์€ Kubernetes Persistent Volume์˜ Access Mode ๋ณ„๋กœ ๋™์ž‘๋ฐฉ์‹ ๋‹ค๋ฅด๋ฉฐ ๋™์ž‘ ๋ฐฉ์‹์— ๋”ฐ๋ฅธ Longhorn Engine์˜ ๋™์ž‘์€ ์•„๋ž˜ ํ…Œ์ด๋ธ”์„ ์ฐธ์กฐ ํ•˜์„ธ์š”.

The way Longhorn Engine works by Access Modes

Step 1.1. Create Longhorn Volumes

Longhorn UI์— ์ ‘์†ํ•˜์—ฌ Kubernetes Persistent Storage๋ฅผ ์œ„ํ•œ Longhorn Volume์„ ์ƒ์„ฑ ํ•ฉ๋‹ˆ๋‹ค.

ReadWriteOnce(RWO)์™€ ReadWriteMany(RWX)๋ฅผ ์œ„ํ•œ ๋ณผ๋ฅจ์„ ๊ฐ๊ฐ ์ƒ์„ฑ ํ•ฉ๋‹ˆ๋‹ค.

longhorn-volume-create-1.png

RWO๋ฅผ ์œ„ํ•œ Longhorn Volume์˜ Name *"volume-block-rwo"*๊ณผ Size *"10Gi"*๋ฅผ ์ž…๋ ฅํ•˜๊ณ  Access Mode๋ฅผ ReadWriteOnce๋กœ ์„ ํƒํ›„ ๋ณผ๋ฅจ์„ ์ƒ์„ฑ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋•Œ, Frontend๋Š” ๋ณ€๊ฒฝํ•˜์ง€ ์•Š๊ณ  Block Device ์ƒํƒœ๋กœ ์œ ์ง€ ํ•ฉ๋‹ˆ๋‹ค.

longhorn-volume-create-block-rwo.png

ReadWriteOnce(RWO)๋ฅผ ์œ„ํ•œ ๋ณผ๋ฅจ์„ ์ƒ์„ฑ ์™„๋ฃŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ถ”๊ฐ€๋กœ RWX๋ฅผ ์œ„ํ•œ ๋ณผ๋ฅจ ์ƒ์„ฑ์„ ์ง„ํ–‰ ํ•ฉ๋‹ˆ๋‹ค. Name *"volume-block-rwx"*๊ณผ Size *"10Gi"*๋ฅผ ์ž‘์„ฑํ•˜๊ณ  Access Mode๋ฅผ ReadWriteMany๋กœ ์„ ํƒ ํ•ฉ๋‹ˆ๋‹ค.