OKE部署Rancher
视频地址:https://www.bilibili.com/video/BV1NS4y1C7JJ/
安装Helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
添加Helm Chart Repository
helm repo add rancher-stable https://releases.rancher.com/server-charts/stable
为Rancher创建命名空间
kubectl create namespace cattle-system
安装cert-manager
# If you have installed the CRDs manually instead of with the `--set installCRDs=true` option added to your Helm install command, you should upgrade your CRD resources before upgrading the Helm chart: kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.crds.yaml # Add the Jetstack Helm repository helm repo add jetstack https://charts.jetstack.io # Update your local Helm chart repository cache helm repo update # Install the cert-manager Helm chart helm install cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --version v1.5.1
kubectl get pods --namespace cert-manager
用Helm和RANCHER-GENERATED CERTIFICATES
选项安装Rancher
helm install rancher rancher-stable/rancher \ --namespace cattle-system \ --set hostname=rancher.oke.org \ --set bootstrapPassword=admin
验证Rancher服务器部署是否成功
kubectl -n cattle-system rollout status deploy/rancher
kubectl -n cattle-system get deploy rancher
以下命令更多service的type为LoadBalancer
,一会OKE就会为此service分配公网IP。
kubectl -n cattle-system get svc kubectl -n cattle-system patch svc/rancher -p '{"spec":{"type":"LoadBalancer"}}'
打开浏览器,通过https://LoadBalancer公网IP
进行访问。