์•ˆ๋…•ํ•˜์„ธ์š”, ์–‘ํ˜„์ฃผ์ž…๋‹ˆ๋‹ค.

์˜ค๋Š˜ ํฌ์ŠคํŒ…์—์„œ๋Š” Kubernetes ๊ธฐ๋ฐ˜์˜ ํ”„๋ผ์ด๋น— ํด๋ผ์šฐ๋“œ ํ”Œ๋žซํผ์ธ
IBM Cloud Private์˜ ์ƒ์šฉ๋ฒ„์ „ (Cloud Native ํ˜น์€ Enterprise ๋ฒ„์ „)์„ ์„ค์น˜ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

์„ค์น˜ํ•˜๊ธฐ์— ์•ž์„œ ํ•„์š”ํ•œ ํ•˜๋“œ์›จ์–ด ์‚ฌ์–‘, IBM Cloud Private ๊ตฌ์„ฑ ์•„ํ‚คํ…์ฒ˜๋Š” ๊ฐ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

1๋‹จ๊ณ„ – ํด๋Ÿฌ์Šคํ„ฐ ๋…ธ๋“œ ๊ตฌ์„ฑํ•˜๊ธฐ

๋ณด๋‹ค ์ƒ์„ธํ•œ ์ •๋ณด๋Š” ๊ณต์‹ ์˜จ๋ผ์ธ ๋ฌธ์„œ์ธ Knowledge Center๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

๋ณธ ์‹ค์Šต์€ Ubuntu 16.04 ์™€ Docker CE ๋ฅผ ์„ค์น˜ํ•œ ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
RedHat ํ˜น์€ Docker EE ๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๋Š” ๊ฒฝ์šฐ ์„ค์น˜ํ•˜๋Š” ๊ณผ์ •์ด ์ƒ์ดํ•  ์ˆ˜ ์žˆ์œผ๋‹ˆ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

[Host ํŒŒ์ผ ์ˆ˜์ •ํ•˜๊ธฐ]

์ €๋Š” Master Node 1, Proxy Node 1, Management Node 1, Worker Node 1 ๋กœ ๊ตฌ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.
์—ฌ๊ธฐ์„œ Master/Proxy/Management ๋…ธ๋“œ๋Š” ํด๋Ÿฌ์Šคํ„ฐ ๊ด€๋ฆฌ ๋…ธ๋“œ์— ์†ํ•˜๋ฉฐ, Worker ๋…ธ๋“œ๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ณผ ๊ฐ™์€ ์›Œํฌ๋กœ๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋…ธ๋“œ๋กœ ๋ณด์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
์ฆ‰, ์ €๋Š” ๋„ค ๊ฐœ์˜ ๋…ธ๋“œ๋กœ IBM Cloud Private ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๊ตฌ์„ฑํ•˜๋„๋ก ํ–ˆ์œผ๋ฉฐ ์›Œํฌ๋กœ๋“œ ์ฆ๊ฐ€์‹œ ์„ค์น˜ ์ดํ›„์—๋„ Worker Node๋ฅผ ํด๋Ÿฌ์Šคํ„ฐ์— ์ถ”๊ฐ€ํ•˜์—ฌ ํ™•์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ƒํ˜ธ ํ˜ธ์ŠคํŠธ๋„ค์ž„์„ ์‹๋ณ„ํ•˜๊ธฐ ์œ„ํ•ด ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๋ชจ๋“  ๋จธ์‹  (VM ํ˜น์€ ๋ฌผ๋ฆฌ ์„œ๋ฒ„)์— ์žˆ๋Š” /etc/hosts ํŒŒ์ผ์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜ ip ์™€ hostname ์€ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค. ํด๋Ÿฌ์Šคํ„ฐ๋กœ ๊ตฌ์„ฑํ•˜๊ณ ์ž ํ•˜๋Š” ๋จธ์‹ ์˜ ip ์™€ hostname์„ ์ž…๋ ฅํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

10.10.80.172 iccuser19-xenial-cloud02
10.10.80.206 icp-proxy1
10.10.80.173 iccuser19-xenial-cloud03
10.10.80.208 icp-mng

์ €๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด Node ์ •๋ณด๋ฅผ ์ž…๋ ฅํ–ˆ์Šต๋‹ˆ๋‹ค.

[ํ•„์š”ํ•œ ์†Œํ”„ํŠธ์›จ์–ด ์„ค์น˜ํ•˜๊ธฐ]

  1. ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๋ชจ๋“  ๋…ธ๋“œ ๊ฐ„ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋…ธ๋“œ์—์„œ ํ•ด๋‹น ๋…ธ๋“œ ์™ธ ๋‹ค๋ฅธ ๋ชจ๋“  ๋…ธ๋“œ๋กœ์˜ ์—ฐ๊ฒฐ์ด ๋˜๋Š”์ง€ ๋ฐ˜๋“œ์‹œ ํ…Œ์ŠคํŠธ ํ•ด๋ณด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
  2. Master Node์—์„œ vm.max_map_count ์…‹ํŒ…์„ ์ตœ์†Œ 262144๋กœ ์…‹ํŒ…ํ•ฉ๋‹ˆ๋‹ค.
    1. vm.max_map_count ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ๊ฐ’์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

      sudo sysctl vm.max_map_count

    2. vm.max_map_count ๊ฐ’์ด 262144 ์ดํ•˜๋ผ๋ฉด ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

      sudo sysctl -w vm.max_map_count=262144

    3. ์‹œ์Šคํ…œ ์žฌ์‹œ์ž‘ ํ›„์—๋„ ๊ฐ’์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ค์ •๊ฐ’์„ /etc/sysctl.conf ํŒŒ์ผ์— ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๋ฃจํŠธ ์œ ์ €๋กœ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

      echo "vm.max_map_count=262144" | tee -a /etc/sysctl.conf

  3. Master Node์—์„œ ํฌํŠธ ๋ฒ”์œ„๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
    1. ๋จผ์ € net.ipv4.ip_local_port_range ๊ฐ’์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

      sudo sysctl net.ipv4.ip_local_port_range

    2. ๋งŒ์•ฝ ์ถœ๋ ฅ๊ฐ’์ด 10240 ๋ฏธ๋งŒ์ด๋ผ๋ฉด, ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

      sudo sysctl -w net.ipv4.ip_local_port_range="10240 60999"

    3. ์‹œ์Šคํ…œ ์žฌ์‹œ์ž‘ ํ›„์—๋„ ๊ฐ’์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ค์ • ๊ฐ’์„ /etc/sysctl.conf ํŒŒ์ผ์— ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๋ฃจํŠธ ์œ ์ €๋กœ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

      echo 'net.ipv4.ip_local_port_range="10240 60999"' | tee -a /etc/sysctl.conf

  4. Docker ์„ค์น˜ํ•˜๊ธฐ
    Kubernetes๋Š” Docker Container๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. Master Node์—๋งŒ Docker ๋ฅผ ์„ค์น˜ํ•˜๋ฉด IBM Cloud Private ์„ค์น˜์‹œ ๋‚˜๋จธ์ง€ Node์—๋„ ์ž๋™์œผ๋กœ Docker ๋ฅผ ์„ค์น˜ํ•˜๊ฒŒ ๋˜๋ฏ€๋กœ, ๋ณธ ํŠœํ† ๋ฆฌ์–ผ์—์„œ๋Š” ํ•˜๋‚˜์˜ Master Node์—๋งŒ Docker ๋ฅผ ์„ค์น˜ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

    1. Docker pre-req ํŒจํ‚ค์ง€
    2. sudo apt-get update -y
      sudo apt-get install -y python unzip nfs-common jq
      sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
    3. Docker-CE ์„ค์น˜ํ•˜๊ธฐ
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    sudo apt-get install -y docker-ce
    service docker start
    sudo apt-get install -y python-pip
    docker version

    docker version ๊ฐ’์ด ์ถœ๋ ฅ๋˜๋ฉด docker๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

  5. ๋ชจ๋“  ๋…ธ๋“œ์— Python ์„ค์น˜ํ•˜๊ธฐ
apt-get update
apt-get install -y python-pip

[์ธ์ฆ ๋ฐฉ์‹ ์„ค์ •ํ•˜๊ธฐ (SSH Key๋กœ ์ธ์ฆ)]

  1. Master/Boot ๋…ธ๋“œ์— Root๋กœ ์ ‘์† ํ›„ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ˆ˜ํ–‰ํ•˜์—ฌ SSH Key ์ƒ์„ฑ:

    ssh-keygen -b 4096 -t rsa -f /root/.ssh/id_rsa -N ""

  2. ์ƒ์„ฑ๋œ SSH Key ํ™•์ธ

    cat /root/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys

  3. Master Node๋กœ๋ถ€ํ„ฐ ์•„๋ž˜ [ip ์ฃผ์†Œ=10.10.80.xxx] ์ž๋ฆฌ์— ๊ฐ ๋…ธ๋“œ (Master Node, Proxy Node, Management Node, Worker Node, NFS ๋“ฑ) ์˜ IP ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ์•„๋ž˜ ์Šคํ…์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.
    ssh -t root@10.10.80.206 'mkdir -p /root/.ssh'  
    scp /root/.ssh/id_rsa.pub root@10.10.80.206:/root/.ssh/id_rsa.pub
    ssh -t root@10.10.80.206 'cat /root/.ssh/id_rsa.pub | tee -a /root/.ssh/authorized_keys;echo "PermitRootLogin yes" | tee -a /etc/ssh/sshd_config'
    ssh-keyscan 10.10.80.206 | tee -a /root/.ssh/known_hosts
  4. ์—ฌ๊ธฐ๊นŒ์ง€ SSH Key ์…‹ํŒ…์ด ์™„๋ฃŒ๋˜๋ฉด Master Node๋กœ๋ถ€ํ„ฐ ๋‹ค๋ฅธ ๋…ธ๋“œ๋กœ ํŒจ์Šค์›Œ๋“œ ์—†์ด ์ ‘์†์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
    Master Node๋กœ๋ถ€ํ„ฐ ๋‹ค๋ฅธ Node๋กœ ํŒจ์Šค์›Œ๋“œ ์—†์ด ๋กœ๊ทธ์ธ ๋˜๋Š”์ง€ ๋ฐ˜๋“œ์‹œ ํ™•์ธ ํ•ด๋ณด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
    ์˜ˆ๋ฅผ ๋“ค์–ด, ssh root@<proxy-node-ip> ์™€ ๊ฐ™์ด ์ž…๋ ฅ์‹œ ํŒจ์Šค์›Œ๋“œ ์ž…๋ ฅ ์—†์ด ๋ฐ”๋กœ ๋‹ค๋ฅธ ๋…ธ๋“œ์— ์ ‘์†์ด ๋œ๋‹ค๋ฉด ์…‹ํŒ…์ด ์™„๋ฃŒ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์—ฌ๊ธฐ๊นŒ์ง€ IBM Cloud Private ์„ค์น˜๋ฅผ ์œ„ํ•œ ๊ธฐ๋ณธ ์„ค์ • ๋‹จ๊ณ„์˜€์Šต๋‹ˆ๋‹ค.
์ด์ œ ๋‹ค์Œ ํฌ์ŠคํŒ…์—์„œ ๋ณธ๊ฒฉ์ ์œผ๋กœ IBM Cloud Private์„ ์„ค์น˜ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

2๋‹จ๊ณ„ โ€“ IBM Cloud Privateํด๋Ÿฌ์Šคํ„ฐ ์„ค์น˜ํ•˜๊ธฐ

ํ† ๋ก  ์ฐธ๊ฐ€

์ด๋ฉ”์ผ์€ ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ์ž…๋ ฅ์ฐฝ์€ * ๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.