1.docker安装rancher

[root@rancher ~]# docker run -d --name rancher --restart=unless-stopped -p : -p : -v /opt/rancher:/var/lib/rancher rancher/rancher:v2.2.4
Unable to find image 'rancher/rancher:v2.2.4' locally
Trying to pull repository docker.io/rancher/rancher ...
v2.0.0: Pulling from docker.io/rancher/rancher
68393378db12: 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:38839bb19bdcac084a413a4edce7efb97ab99b6d896bda2f433dfacfd27f8770
Status: Downloaded newer image for docker.io/rancher/rancher:v2.0.0
215f26faeda5d32f18a25c23cfac4c2ea4d99643f0499163bdc0e06e3ca96336
[root@rancher ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
215f26faeda5 rancher/rancher:v2.2.4 "rancher --http-li..." seconds ago Up seconds 0.0.0.0:->/tcp, 0.0.0.0:->/tcp rancher

2.倒入集群

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

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

这里我们单独下载来执行

[root@master rancher]# wget --no-check-certificate https://10.0.1.186/v3/import/8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml
---- ::-- https://10.0.1.186/v3/import/8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml
Connecting to 10.0.1.186:... 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... OK
Length: unspecified [text/plain]
Saving to: ‘8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml’
[ <=> ] , --.-K/s in 0s
-- :: (56.1 MB/s) - ‘8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml’ saved []
[root@master rancher]# mv 8xhq4r95ptgghqbwx2sgf8t8vlvt5sg6wcqmvspwmn72dh4r7mp9lg.yaml rancher-import.yaml
[root@master rancher]# kubectl apply -f rancher-import.yaml
namespace/cattle-system created
serviceaccount/cattle created
clusterrolebinding.rbac.authorization.k8s.io/cattle created
secret/cattle-credentials-db8ed0c created
deployment.extensions/cattle-cluster-agent created
daemonset.extensions/cattle-node-agent created
[root@master rancher]# kubectl get pod -n cattle-system
NAME READY STATUS RESTARTS AGE
cattle-cluster-agent-5b98f69764-cmhwt / ContainerCreating 2m14s
cattle-node-agent-4gxlt / ContainerCreating 2m14s
cattle-node-agent-l2zmg / ContainerCreating 2m14s

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

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

回到浏览器发现集群已经倒入,集群能正常使用,但是还有报以下错误,有待研究

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

安装rancher以及使用rancher倒入kubernetes集群和添加及管理集群的更多相关文章

  1. redis 与java的连接 和集群环境下Session管理

    redis 的安装与设置开机自启(https://www.cnblogs.com/zhulina-917/p/11746993.html)  第一步: a) 搭建环境 引入 jedis jar包 co ...

  2. Ubuntu 18 使用docker安装rancher/server:stable并运行kubernetes

    1.安装docker sudo apt-get install docker.io docker的版本:Docker version 17.12.1-ce 2.安装virtualbox-qt,因为vi ...

  3. rancher导入k8s集群后添加监控无数据

    1.日志报错 rancher导入k8s集群后添加监控无数据,rancher日志报错: k8s.io/kube-state-metrics/pkg/collectors/builder.go:: Fai ...

  4. rancher 笔记 之 rancher应用中心

    rancher应用中心 rancher 的应用中心 可以 自定义,在 admin -> catlog 中 指定路劲 rancher的应用中心 就是一个git项目 指定git的路劲的时候 填写的是 ...

  5. zookeeper安装和应用场合(名字,配置,锁,队列,集群管理)

    安装和配置详解 本文介绍的 Zookeeper 是以 3.2.2 这个稳定版本为基础,最新的版本可以通过官网http://hadoop.apache.org/zookeeper/ 来获取,Zookee ...

  6. [转帖]安装prometheus+grafana监控mysql redis kubernetes等

    安装prometheus+grafana监控mysql redis kubernetes等 https://www.cnblogs.com/sfnz/p/6566951.html plug 的模式进行 ...

  7. Dubbo入门到精通学习笔记(十四):ActiveMQ集群的安装、配置、高可用测试,ActiveMQ高可用+负载均衡集群的安装、配置、高可用测试

    文章目录 ActiveMQ 高可用集群安装.配置.高可用测试( ZooKeeper + LevelDB) ActiveMQ高可用+负载均衡集群的安装.配置.高可用测试 准备 正式开始 ActiveMQ ...

  8. k8s笔记0528-基于KUBERNETES构建企业容器云手动部署集群记录-2

    三.ETCD集群部署 类似于走zookeeper集群分布式协调服务,可做以key v形式存储在ETCD中. 官方链接:https://github.com/coreos/etcd 分布式kv存储,为分 ...

  9. ASP.NET Core在Azure Kubernetes Service中的部署和管理

    目录 ASP.NET Core在Azure Kubernetes Service中的部署和管理 目标 准备工作 注册 Azure 账户 AKS文档 进入Azure门户(控制台) 安装 Azure Cl ...

随机推荐

  1. hadoop系列(二)分布式文件系统HDFS

    根据core-site.xml的配置,接下来就可以通过:hdfs://localhost:9000来对hdfs进行操作了. 1.创建输入目录 C:\WINDOWS\system32>hadoop ...

  2. 案例2:tab栏切换

    <style> body,ul,li,div{margin:0;padding: 0;} ul{font-size: 0px;} .tab_list{ border: 1px gray s ...

  3. Failed selinux 错误

    再看他如何解决,步骤大概是: 1.开机之后进入linux启动选择界面,停在平时启动的哪那一行按E键,进入grub编辑页面. 2.按↓键光标往下移,在标签fi下面的内容里加上一个enforcing=0. ...

  4. final、finally和finalized的区别?

    (1)final:被final修饰的类,不被能继承:被final修饰的方法,不能被重写:被fianl修饰的量,为常量,只能被赋值一次: (2)finally:异常处理,和try.catch结合使用,可 ...

  5. Python 爬取12306火车票

    获取火车站 stations.py #import certifi #import urllib3 import re import requests from pprint import pprin ...

  6. flume注意的事项

    bin/flume-ng agent --conf conf/ --name a3 --conf-file conf/flume-dir.conf & 在使用Spooling Director ...

  7. 去除springboot内置tomcat

    /** * @author zx * @title: ServletInitializer * @projectName activiti * @description: 解决内置tomcat * @ ...

  8. spring其他配置 (3)

    目录 一.自动装配 Autowired 二.bean的作用于singleton,prototype 三.引入外部资源properties文件 四.SpEL表达式 (可以为属性进行动态的赋值) 五.通过 ...

  9. ionic-CSS:ionic 列表

    ylbtech-ionic-CSS:ionic 列表 1.返回顶部 1. ionic 列表 列表是一个应用广泛的界面元素,在所有移动app中几乎都会使用到. 列表可以是基本文字.按钮,开关,图标和缩略 ...

  10. IntelliJ IDEA 创建的文件自动生成 Author 注释 签名

    IntelliJ IDEA 创建的文件自动生成 Author 注释 签名1.打开 File --> Setting2.找到 Editor --> File and Code Templat ...