博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
安装rancher以及使用rancher倒入kubernetes集群和添加及管理集群
阅读量:4449 次
发布时间:2019-06-07

本文共 4000 字,大约阅读时间需要 13 分钟。

1.docker安装rancher

[root@rancher ~]# docker run -d --name rancher --restart=unless-stopped -p 80:80 -p 443:443 -v /opt/rancher:/var/lib/rancher rancher/rancher:v2.2.4Unable to find image 'rancher/rancher:v2.2.4' locallyTrying to pull repository docker.io/rancher/rancher ... v2.0.0: Pulling from docker.io/rancher/rancher68393378db12: Pull complete 9e3366501e0e: Pull complete 156ec05da9a5: Pull complete 281cba1133d9: Pull complete 0acdc2cc8ed1: Pull complete a8cef3d8a877: Pull complete 3e968117f1c2: Pull complete cf62fef10dfd: Pull complete 098edd097869: Pull complete 77a837c0bf2d: Pull complete Digest: sha256:38839bb19bdcac084a413a4edce7efb97ab99b6d896bda2f433dfacfd27f8770Status: Downloaded newer image for docker.io/rancher/rancher:v2.0.0215f26faeda5d32f18a25c23cfac4c2ea4d99643f0499163bdc0e06e3ca96336[root@rancher  ~]# docker psCONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                      NAMES215f26faeda5        rancher/rancher:v2.2.4   "rancher --http-li..."   9 seconds ago       Up 8 seconds        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   rancher

2.倒入集群

浏览器访问本机的ip,然后设置密码登陆上去,点击add cluster,选择import倒入现有集群

复制上面的其中一个到现有集群的master节点去执行

这里我们单独下载来执行

[root@master rancher]# wget --no-check-certificate https://10.0.1.186/v3/import/8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml--2019-06-19 23:35:56--  https://10.0.1.186/v3/import/8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yamlConnecting to 10.0.1.186:443... connected.WARNING: cannot verify 10.0.1.186's certificate, issued by ‘/O=the-ranch/CN=cattle-ca’:  Unable to locally verify the issuer's authority.HTTP request sent, awaiting response... 200 OKLength: unspecified [text/plain]Saving to: ‘8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml’    [ <=>                                                                                                          ] 3,426       --.-K/s   in 0s      2019-06-19 23:35:56 (56.1 MB/s) - ‘8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml’ saved [3426][root@master rancher]# mv  8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml rancher-import.yaml[root@master rancher]# kubectl apply -f rancher-import.yaml namespace/cattle-system createdserviceaccount/cattle createdclusterrolebinding.rbac.authorization.k8s.io/cattle createdsecret/cattle-credentials-db8ed0c createddeployment.extensions/cattle-cluster-agent createddaemonset.extensions/cattle-node-agent created[root@master rancher]# kubectl get pod -n cattle-systemNAME                                    READY   STATUS              RESTARTS   AGEcattle-cluster-agent-5b98f69764-cmhwt   0/1     ContainerCreating   0          2m14scattle-node-agent-4gxlt                 0/1     ContainerCreating   0          2m14scattle-node-agent-l2zmg                 0/1     ContainerCreating   0          2m14s

等待一段时间,镜像下载完毕

[root@master rancher]# kubectl get pod -n cattle-system -owideNAME                                    READY   STATUS    RESTARTS   AGE   IP            NODE     NOMINATED NODE   READINESS GATEScattle-cluster-agent-5b98f69764-cmhwt   1/1     Running   0          18m   10.244.2.41   node01   
cattle-node-agent-4gxlt 1/1 Running 0 18m 10.0.1.229 node01
cattle-node-agent-l2zmg 1/1 Running 0 18m 10.0.1.7 node02

回到浏览器发现集群已经倒入,但是还有错误

Exit status 1, W0619 16:36:49.951709 16814 factory_object_mapping.go:423] Failed to download OpenAPI (the server could not find the requested resource), falling back to swagger error: error validating "management-state/tmp/yaml-787242553": error validating data: the server could not find the requested resource; if you choose to ignore these errors, turn validation off with --validate=false

 

转载于:https://www.cnblogs.com/linyouyi/p/11056053.html

你可能感兴趣的文章
pyQuery的安装
查看>>
java 发展简史
查看>>
Js 数组排序函数sort()
查看>>
vtune 错误
查看>>
Sonya and Problem Wihtout a Legend CodeForces - 714E (dp)
查看>>
制作滑动门菜单
查看>>
jdk 8 新特性
查看>>
tomcat调优
查看>>
NameNode故障处理方法
查看>>
关于find的-perm
查看>>
修改pip默认安装目录
查看>>
[bzoj3073] Journeys 题解(线段树优化建图)
查看>>
vue中keepAlive的使用
查看>>
Oracle表空间、段、区和块简述
查看>>
Mysql数据库环境变量配置
查看>>
编程中经典语句
查看>>
自定义圆形头像
查看>>
JavaScript&jQuery.动态创建元素
查看>>
WebBrowser记录
查看>>
什么是FreeMaker
查看>>