title: rancher 安装
tag: [kubernate]
comments: true

1. 设置 repo

helm repo add rancher-<CHART_REPO> http://rancher-mirror.oss-cn-beijing.aliyuncs.com/server-charts/<CHART_REPO>
替换为 stable

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

2. 为 Rancher 创建 Namespace

kubectl create namespace cattle-system

3. 选择您的 SSL 选项 (使用自己签发的证书)

helm install rancher rancher-stable/rancher \
 --namespace cattle-system \
 --set hostname=k3s.stu77.cn \
 --set replicas=1 \
 --set ingress.tls.source=secret
  • 假如出现以下错误:
    Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
    或者
    Error: Kubernetes cluster unreachable: the server could not find the requested resource,
    先在 shell 执行 export KUBECONFIG=/etc/rancher/k3s/k3s.yaml (参考 https://blog.csdn.net/varyuan/article/details/112111547)

3.1 自有证书需要添加证书

kubectl -n cattle-system create secret tls tls-rancher-ingress \
  --cert=/etc/letsencrypt/live/stu77.cn-0001/fullchain.pem \
  --key=/etc/letsencrypt/live/stu77.cn-0001/privkey.pem

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2021-12-26
  • 2022-02-19
  • 2022-12-23
  • 2021-11-30
  • 2021-10-30
猜你喜欢
  • 2022-12-23
  • 2021-10-07
  • 2021-09-16
  • 2023-04-04
  • 2021-07-04
  • 2021-05-24
相关资源
相似解决方案