微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

k8s 安装 rancher


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

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

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐