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库(稳定版本)
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
kubectl create namespace cattle-system
3.安装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/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.查看是否安装启动成功
kubectl get pods --namespace cert-manager
5.安装rancher(这里xxx是你自定义的域名)
helm install rancher rancher-stable/rancher \ > --namespace cattle-system \ > --set hostname=rancher.xxx.com
6.全部启动成功后,修改一下名称为rancher的service的type为LoadBalancer(因为默认是ClusterIP,你可能在你的本地访问不到)
kubectl patch service rancher -n cattle-system -p '{"spec":{"type":"LoadBalancer"}}'
7.访问域名就可以看到登录页面了
8.根据提示获取密码
kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{.data.bootstrapPassword|base64decode}}{{"\n"}}'
最后登录进去看看首页
标签:k3s,--,namespace,cert,rancher,manager,helm From: https://www.cnblogs.com/databank/p/18070209