当前位置: > 其它学习 > Kubernetes >

Rancher2.0安装Kubernetes

时间:2019-04-09 13:02来源:linux.it.net.cn 作者:IT
Docker安装
可以参考
https://blog.csdn.net/xiegh2014/article/details/80454019
 
配置Docker镜像仓库地址
cat /etc/docker/daemon.json 
{
  "registry-mirrors": ["https://kuamavit.mirror.aliyuncs.com", "https://registry.docker-cn.com", "https://docker.mirrors.ustc.edu.cn"], 
  "insecure-registries": ["172.16.8.49"], 
  "max-concurrent-downloads": 10,
  "log-driver": "json-file",
  "log-level": "warn",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
    }
}
 
Rancher安装部署所需资源
 
Deployment Size Clusters Nodes vCPUs RAM
Small Up to 10 Up to 50 2 4GB
Medium Up to 100 Up to 500 8 32GB
Large Over 100 Over 500 Contact Rancher
https://rancher.com/docs/rancher/v2.x/en/installation/single-node-install/
 
Rancher安装部署
安装稳定版:
docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:stable
 
如果想当小白鼠可以安装最新踩不完的坑。。。。。。。。。。。。。。。
docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:latest
 
https://172.16.8.46/
 
 
导入K8S集群
 
 
 
 
需要在K8S集群执行
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user admin
curl --insecure -sfL https://172.16.8.46/v3/import/4djm8tccwsd4g8qd7rf8l8ksptddz75dxdn7c2nphrjqtvz6xwbtzg.yaml | kubectl apply -f -
 
执行结果:
[root@qas-k8s-master01 ~]# kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user admin
clusterrolebinding.rbac.authorization.k8s.io/cluster-admin-binding created
[root@qas-k8s-master01 ~]# curl --insecure -sfL https://172.16.8.46/v3/import/4djm8tccwsd4g8qd7rf8l8ksptddz75dxdn7c2nphrjqtvz6xwbtzg.yaml | kubectl apply -f -
namespace/cattle-system created
serviceaccount/cattle created
clusterrolebinding.rbac.authorization.k8s.io/cattle-admin-binding created
secret/cattle-credentials-db7d937 created
clusterrole.rbac.authorization.k8s.io/cattle-admin created
deployment.extensions/cattle-cluster-agent created
daemonset.extensions/cattle-node-agent created
 




(责任编辑:IT)
------分隔线----------------------------