当前k8s集群是1.23.5

一. 2.6.4

1. 安装cert-manager

参考 https://blog.csdn.net/qq_38983728/article/details/103462543

2. 安装ingress-nginx

参考 https://blog.csdn.net/qq_38983728/article/details/123399245

3. 添加rancher repo

helm repo add rancher-stable http://rancher-mirror.oss-cn-beijing.aliyuncs.com/server-charts/stable

[root@master rancher]# helm search repo rancher-stable/rancher
NAME                  	CHART VERSION	APP VERSION	DESCRIPTION                                       
rancher-stable/rancher	2.6.4        	v2.6.4     	Install Rancher Server to manage Kubernetes clu...

4. my-values.yaml

cat <<EOF> my-values.yaml
hostname: rancher.wanfei.wang
ingress:
  extraAnnotations:
    kubernetes.io/ingress.class: "nginx"    
    kubernetes.io/tls-acme: "true"  
  tls:
    source: letsEncrypt
    secretName: tls-rancher-ingress
letsEncrypt:
  email: email@126.com
  environment: production
  ingress:
    class: "nginx"

replicas: 1
bootstrapPassword: "123456"
EOF

5. 安装

helm install rancher rancher-stable/rancher --version 2.6.4 \
 --no-hooks \
 --namespace cattle-system --create-namespace \
 -f my-values.yaml

参考官方安装 https://docs.rancher.cn/docs/rancher2.5/installation/install-rancher-on-k8s/_index

6. 卸载

helm uninstall rancher -n cattle-system

7. 使用

输入 https://rancher.wanfei.wang,输入上面设置的密码bootstrapPassword
在这里插入图片描述
设置中文
在这里插入图片描述

二. 2.6.9

2.1 安装

helm install rancher rancher-stable/rancher --version 2.6.9 \
 --namespace cattle-system --create-namespace \
 -f my-values.yaml

等待部署完成

[root@master rancher]# kubectl -n cattle-system rollout status deploy/rancher
Waiting for deployment "rancher" rollout to finish: 0 of 1 updated replicas are available...
Waiting for deployment spec update to be observed...
Waiting for deployment "rancher" rollout to finish: 0 of 1 updated replicas are available...
deployment "rancher" successfully rolled out

查看

[root@master rancher]# kubectl get pods -n cattle-system
NAME                       READY   STATUS    RESTARTS   AGE
helm-operation-k8l6t       2/2     Running   0          31s
rancher-6fcb974b96-wl4vv   1/1     Running   0          78s
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐