k3s中使用helm安装rancher

k3s中使用helm安装rancher
参考官方文档:https://ranchermanager.docs.rancher.com/zh/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster
版本:
docker: 24.0.7
rancher:2.8.2
k3s: v1.27.11+k3s1
helm: v3.9.0
此处省略docker,k3s,helm的安装过程
1.首先导入rancher的helm库(稳定版本)

1
2
helm repo add "stable" "https://charts.helm.sh/stable" --force-update
helm repo add rancher-stable https://releases.rancher.com/server-charts/stable

2.定义一个Kubernetes名称空间,Chart创建的资源应该安装在这个名称空间中:cattle-system

1
kubectl create namespace cattle-system

 

3.安装cert-manager

1
2
3
4
5
6
7
8
9
10
11
12
13
# 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/cert-manager/cert-manager/releases/download/v1.14.4/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

4.查看是否安装启动成功

1
kubectl get pods --namespace cert-manager

5.安装rancher(这里xxx是你自定义的域名)

1
2
3
helm install rancher rancher-stable/rancher \
> --namespace cattle-system \
> --set hostname=rancher.xxx.com

 

6.全部启动成功后,修改一下名称为rancher的service的type为LoadBalancer(因为默认是ClusterIP,你可能在你的本地访问不到)

1
kubectl patch service rancher -n cattle-system -p '{"spec":{"type":"LoadBalancer"}}'

7.访问域名就可以看到登录页面了

 


8.根据提示获取密码

1
kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{.data.bootstrapPassword|base64decode}}{{"\n"}}'

 

最后登录进去看看首页

 


__EOF__

本文作者东峰叵.com
本文链接https://www.cnblogs.com/databank/p/18070209.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   东峰叵,com  阅读(570)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2023-03-13 docker安装DM8
点击右上角即可分享
微信分享提示