這是本文件的舊版!
使用 rke 安裝 K8s 的程序
- 安裝環境 Ubuntu 20.04.2 LTS x86_64
- 兩個節點 IP : 10.20.0.35 / 10.20.0.37
前置作業
- apt 更新與安裝套件
sudo apt update sudo apt-get install unzip curl software-properties-common snap -y
- 安裝 Docker 19.03.14
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 install docker-ce=5:19.03.14~3-0~ubuntu-focal docker-ce-cli=5:19.03.14~3-0~ubuntu-focal containerd.io -y
- 安裝 kubectl 與 helm
sudo snap install kubectl --channel=1.18/stable --classic sudo snap install helm --channel=3.5/stable --classic mkdir -p ~/.kube/;
- 關閉 swap
sudo swapoff -a
- cluster.yml
nodes: - address: "10.20.0.35" port: "22" internal_address: "10.20.0.35" role: - controlplane - worker - etcd hostname_override: "Cori-test3" user: rkeuser docker_socket: /var/run/docker.sock ssh_key: "" ssh_key_path: ~/.ssh/id_rsa ssh_cert: "" ssh_cert_path: "" labels: {} taints: [] services: etcd: : :