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 | <code-pre class= "code-pre" id = "pre-mmEsCC" ><code-line class= "line-numbers-rows" >< /code-line >helm repo add "stable" "https://charts.helm.sh/stable" --force-update <code-line class= "line-numbers-rows" >< /code-line >helm repo add rancher-stable https: //releases .rancher.com /server-charts/stable < /code-pre > |
2.定义一个Kubernetes名称空间,Chart创建的资源应该安装在这个名称空间中:cattle-system
1 2 | <code-pre class= "code-pre" id = "pre-hZn4kK" ><code-line class= "line-numbers-rows" >< /code-line >kubectl create namespace cattle-system < /code-pre > |
3.安装cert-manager
1 2 3 4 5 6 7 8 9 10 11 12 13 | <code-pre class= "code-pre" id = "pre-hJkkK6" ><code-line class= "line-numbers-rows" >< /code-line > # 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: <code-line class= "line-numbers-rows" >< /code-line >kubectl apply -f https: //github .com /cert-manager/cert-manager/releases/download/v1 .14.4 /cert-manager .crds.yaml <code-line class= "line-numbers-rows" >< /code-line > <code-line class= "line-numbers-rows" >< /code-line > # Add the Jetstack Helm repository <code-line class= "line-numbers-rows" >< /code-line >helm repo add jetstack https: //charts .jetstack.io <code-line class= "line-numbers-rows" >< /code-line > <code-line class= "line-numbers-rows" >< /code-line > # Update your local Helm chart repository cache <code-line class= "line-numbers-rows" >< /code-line >helm repo update <code-line class= "line-numbers-rows" >< /code-line > <code-line class= "line-numbers-rows" >< /code-line > # Install the cert-manager Helm chart <code-line class= "line-numbers-rows" >< /code-line >helm install cert-manager jetstack /cert-manager \ <code-line class= "line-numbers-rows" >< /code-line >--namespace cert-manager \ <code-line class= "line-numbers-rows" >< /code-line >--create-namespace< /code-pre > |
4.查看是否安装启动成功
1 | <code-pre class= "code-pre" id = "pre-PdNDKD" ><code-line class= "line-numbers-rows" >< /code-line >kubectl get pods --namespace cert-manager< /code-pre > |
5.安装rancher(这里xxx是你自定义的域名)
1 2 3 4 | <code-pre class= "code-pre" id = "pre-2emm4W" ><code-line class= "line-numbers-rows" >< /code-line >helm install rancher rancher-stable /rancher \ <code-line class= "line-numbers-rows" >< /code-line >> --namespace cattle-system \ <code-line class= "line-numbers-rows" >< /code-line >> -- set hostname =rancher.xxx.com < /code-pre > |
6.全部启动成功后,修改一下名称为rancher的service的type为LoadBalancer(因为默认是ClusterIP,你可能在你的本地访问不到)
1 | <code-pre class= "code-pre" id = "pre-H6fB7s" ><code-line class= "line-numbers-rows" >< /code-line >kubectl patch service rancher -n cattle-system -p '{"spec":{"type":"LoadBalancer"}}' < /code-pre > |
7.访问域名就可以看到登录页面了
8.根据提示获取密码
1 2 | <code-pre class= "code-pre" id = "pre-sGB3Np" ><code-line class= "line-numbers-rows" >< /code-line >kubectl get secret --namespace cattle-system bootstrap-secret -o go-template= '{{.data.bootstrapPassword|base64decode}}{{"\n"}}' < /code-pre > |
最后登录进去看看首页
__EOF__

本文作者:东峰叵.com
本文链接:https://www.cnblogs.com/databank/p/18070209.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!
本文链接:https://www.cnblogs.com/databank/p/18070209.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· Vue3状态管理终极指南:Pinia保姆级教程
2023-03-13 docker安装DM8