microk8s ์ค์น ์ค calico-kube-controller ๊ฐ CrashLoopBackOff ์ํ์ ๋จธ๋ฌด๋ฅด๋ ์ฆ์์ด ๋ฐ์ํ์ฌ ๋คํธ์ํฌ ์ค์ ์ ํฌํจํ ์ธํ ๊ณผ์ ์ ๊ธฐ๋กํ์๋ค.
์์คํ ๋ ์ง ์ธํ
$ sudo apt update
$ sudo timedatectl set-timezone 'Asia/Seoul'
# ๋ณ๊ฒฝ ํ์ธ
$ datecgroup enable
$ sudo vim /etc/default/grubGRUB_CMDLINE_LINUX ์ ๋ค์ ์ต์
์ ์ถ๊ฐํ๋ค.
cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=0
- ์์ฑ ์๋ฃ ์์
$ sudo cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=0"
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
\#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
\#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
\#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
\#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
\#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
\#GRUB_INIT_TUNE="480 440 1"
```
```bash
$ sudo update-initramfs -u
$ sudo update-grub๋คํธ์ํฌ ์ธํ
$ cat << EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
$ sudo systemctl enable --now iptables
$ sudo iptables -P INPUT ACCEPT
$ sudo iptables -P FORWARD ACCEPT
$ sudo iptables -P OUTPUT ACCEPT
$ sudo iptables -F
$ sudo iptables --flush
$ sudo iptables -tnat --flushmicrok8s ์ค์น
# microk8s ์ค์น
$ sudo snap install microk8s --classic
# ๊ทธ๋ฃน์ถ๊ฐ, config ํ์ผ ๊ถํ ์ค์
$ sudo usermod -a -G microk8s $USER
$ sudo chown -f -R $USER ~/.kube
$ su โ $USER
# core-dns, local-path-storage kube-dashboard ์ค์น
# microk8s status ์์ enable ํ ์ ์๋ ๋ชฉ๋ก์ ํ์ธํ ์ ์์
$ microk8s enable dns storage dashboard
$ microk8s stop
$ microk8s start๊ธฐํ. bash alias & completion ์ค์
$ sudo apt install bash-completion
# k ๋ 'microk8s kubectl' mc ๋ 'microk8s' ๋ก ์ธํ
ํ๋ค.
$ cat << EOF | sudo tee -a /etc/bash.bashrc
# microk8s
alias mc='microk8s'
alias k='microk8s kubectl'
alias kubectl='microk8s kubectl'
source <(microk8s kubectl completion bash)
complete -o default -F __start_kubectl k
source <(microk8s helm3 completion bash)
alias helm='microk8s helm3'
EOF