Install Rancher สำหรับ บริหารจัดการ K8s Cluster

Описание к видео Install Rancher สำหรับ บริหารจัดการ K8s Cluster

update 27 Jan 2023 (Rancher 2.7)
เนื่องจากมีคนถามว่า Rancher มันไม่ขึ้นทำไงดี ผมเลยลองทำอีกที บน K3s ล่าสุด ซึ่งใช้ Kubernetes 1.25+ ลองไปดูเอกสารของ Rancher 2.7(ในวีดีโอ 2.5) มันรองรับ Kubernetes สูงสุดแค่ 1.24 ค้นในอินเตอร์เน็ตบอกว่ามันยกเลิก API บางตัวไป และ cert-manager มันใช้ 1.7.1 (ในวีดีโอผมใช้ 1.5.1)
https://www.suse.com/suse-rancher/sup...
ผมเลยถอยไปเวอร์ชั่น INSTALL_K3S_VERSION="v1.24.10+k3s1" แทนก็ใช้งานได้ครับ ผมติดตั้งตามหน้านี้
https://ranchermanager.docs.rancher.c...
หลังติดตั้งให้ลองใช้คำสั่งตรวจสอบดู รอจนกว่ามันจะอัปขึ้นมาพร้อมใช้ค่อยเข้าไปดู
kubectl -n cattle-system get pods -l app=rancher -o wide -w

ติดตั้ง Rancher เพื่อบริหารจัดการคลัสเตอร์ การติดตั้งและใช้งานค่อนข้างง่าย มี่โปรแกรมที่เซ็ตค่าพร้อมใช้กับ Rancher ให้เลือกติดตั้งหลายตัวเลย ผมก็ยังใช้ไม่ค่อยเป็นเดี๋ยวขอลองหัดดูก่อน
ในวีดีโอจะใช้ K3D เพราะสร้าง Cluster ง่ายและมี Loadbalance และ Ingress มาให้แล้ว ถ้าใช้ K8s ตัวอื่นก็ต้องติดตั้ง ลิงค์ https://rancher.local จะชีไปที่ IP Address ของ Loadbalance

[ลิงค์ที่เกี่ยวข้อง]
https://rancher.com/docs/rancher/v2.5...

[คำสั่ง]
Create cluster on K3d
k3d cluster create cluster1 -p "80:80@loadbalancer" -p "443:443@loadbalancer" --servers 1 --agents 1

Install helm on Linux
wget https://get.helm.sh/helm-v3.8.0-linux...
tar -zxvf helm-v3.8.0-linux-amd64.tar.gz
helm version

Install cert-manager and rancher
helm repo add rancher-stable https://releases.rancher.com/server-c...
helm repo list
helm repo update
kubectl create namespace cattle-system
kubectl get namespace
kubectl apply -f https://github.com/jetstack/cert-mana...
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.5.1
helm install rancher rancher-stable/rancher \
--namespace cattle-system \
--set hostname=rancher.local \
--set replicas=2
kubectl -n cattle-system rollout status deploy/rancher

Комментарии

Информация по комментариям в разработке