rancher管理多个集群

一、rancher部署

单独部署到一台机器上,及独立于k8s集群之外:

删除所有yum源,重新建yum源:

# 建centos7.9的yum源
# cat CentOS-Base.repo 
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7# 建docker-ce 的yum源
# cat docker-ce.repo 
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-stable-debuginfo]
name=Docker CE Stable - Debuginfo $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/debug-$basearch/stable
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/source/stable
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-test]
name=Docker CE Test - $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-test-debuginfo]
name=Docker CE Test - Debuginfo $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/debug-$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-test-source]
name=Docker CE Test - Sources
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/source/test
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-nightly]
name=Docker CE Nightly - $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-nightly-debuginfo]
name=Docker CE Nightly - Debuginfo $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/debug-$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg[docker-ce-nightly-source]
name=Docker CE Nightly - Sources
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/source/nightly
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg

# yum install docker

二、安装rancher

# 获取镜像
# docker pull dhub.kubesre.xyz/rancher/rancher:v2.7.1# mkdir /opt/data/rancher_data -p# systemctl start docker# 运行镜像:
# docker run -d --privileged -p 80:80 -p 443:443 -v /opt/data/rancher_data:/var/lib/rancher --restart=always --name rancher-2.7.1 dhub.kubesre.xyz/rancher/rancher:v2.7.1

访问:

192.168.110.40

获取密码<账号为:admin>:# docker logs  ab3d162a9d61 2>&1 | grep "Bootstrap Password:"ab3d162a9d61 这个是容器的id号

三、添加集群

四、在master上执行报错处理

k8s注册到rancher服务器时,用到一个cattle-system命名空间,由于多次试验,在多次删除此命名空间cattle-system是会出现下面状态:

处理方法1:

查看有无绑定资源,无:

# kubectl api-resources -o name --verbs=list --namespaced | xargs -n 1 kubectl get --show-kind --ignore-not-found -n cattle-system

处理方法二:

有占用资源:

# kubectl api-resources -o name --verbs=list --namespaced | xargs -n 1 kubectl get --show-kind --ignore-not-found -n cattle-system

# kubectl get ns cattle-system -o json > cattle-system.json

# kubectl proxy

# curl -k -H "Content-Type: application/json" -X PUT --data-binary @cattle-system.json http://127.0.0.1:8001/api/v1/namespaces/cattle-system/finalize

五、新建cattle-system命名空间报错:

使用下面命令查看是否存在rancher.cattle.io:# kubectl get MutatingWebhookConfiguration
# kubectl get ValidatingWebhookConfiguration
存在则删除:
kubectl delete ValidatingWebhookConfiguration rancher.cattle.io
kubectl delete MutatingWebhookConfiguration rancher.cattle.io

六、在master在此执行:

# curl --insecure -sfL https://192.168.110.40/v3/import/rn4wc2llmvbt7b96pl2pf7dxlksgwcpvcwc9flhzrrjl4mjp8qcqgq_c-m-zvll8v49.yaml | kubectl apply -f -

七、在rancher检查

八、文章参考:

如何删除Terminating状态的命名空间?_云容器引擎 CCE

https://support.huaweicloud.com/cce_faq/cce_faq_00277.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/44729.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

OR-152 IGBT光耦系列

●缓冲逻辑类型&#xff08;图腾柱输出&#xff09; ●输出峰值电流&#xff1a; 2.5 A &#xff08;最大值&#xff09; ●电源电流&#xff1a; 3 mA &#xff08;最大值&#xff09; ● 电源电压&#xff1a; 10 至 30 V ●阈值输入电流&#xff1a; 7.5 mA&#xf…

Java面向对象进阶篇综合训练(附带全套源代码及逐语句分析)->基于javabeen

一、前言 面向对象这一块也要结束了&#xff0c;不知道读者们掌握的如何呢。不过面向对象的路程远不止于此&#xff0c;可以利用面向对象来做一些小型的系统来巩固一下。接下来就进入新的章节了&#xff0c;回顾一下这已经是第五天了&#xff0c;之前说的7天拿下java还是太过于…

常用的Redis命令介绍

常用的Redis命令介绍 Redis 是一个高性能的键值存储数据库&#xff0c;支持多种数据结构&#xff0c;如字符串&#xff08;String&#xff09;、哈希&#xff08;Hash&#xff09;、列表&#xff08;List&#xff09;、集合&#xff08;Set&#xff09;和有序集合&#xff08;S…

51单片机:使用蜂鸣器演奏《盗将行》(附代码详解)

一、功能实现&#xff1a; 二、代码内容&#xff1a; 主函数.c #include <REGX52.H> #include "Delay.h" #include "Timer0.h"sbit BuzzerP2^5;#define SPEED 500 //原先默认一个四分音符延迟500ms#define P 0 //休止 #define L1 1 //低音…

LLaMA-Factory:开源的低代码大模型训练框架

LLaMA-Factory 是一个由零隙智能&#xff08;SeamLessAI&#xff09;开源的低代码大模型训练框架&#xff0c;它集成了业界最广泛使用的微调方法和优化技术&#xff0c;并支持众多开源模型的微调和二次训练。 一、功能特点 支持多种开源模型&#xff1a;LLaMA-Factory支持包括…

辐射神经场算法——Instant-NGP / Mipi-NeRF 360 / 3D Gaussian Splatting

辐射神经场算法——Instant-NGP / Mipi-NeRF 360 / 3D Gaussian Splatting 1. Instant-NGP1. MultiResolution Hash Encoding1.2 Accelerated Ray Marching1.3 实验结果 2. Mip-NeRF 3602.1 场景参数化2.2 在线蒸馏2.3 失真正则化2.4 实验结果 3. 3D Gaussian Splatting3.1 Dif…

krpano开启日志公能

<krpano version"1.21" title"博物馆" debugmode"true" > 之后鼠标右键菜单栏最后一行 点击&#xff08;开启后会发生变化&#xff09;。

汽车预约维修小程序的设计

管理员账户功能包括&#xff1a;系统首页&#xff0c;个人中心&#xff0c;技师管理&#xff0c;技师信息管理&#xff0c;用户预约管理&#xff0c;取消预约管理&#xff0c;订单信息管理&#xff0c;系统管理 微信端账号功能包括&#xff1a;系统首页&#xff0c;技师信息&a…

新开发的软件老被系统拦截有什么办法解决吗?

一套新开发的软件要想在windows操作系统畅通无阻&#xff0c;那就需要使用代码签名证书&#xff0c;只要是对软件进行实名从而证明软件发布者身份&#xff0c;确保该软件是一个合法有效的主体开发的&#xff0c;也是让这个软件开发者承担相应的责任。 特别主要如果要获得即时性…

【深度学习入门篇 ③】PyTorch的数据加载

【&#x1f34a; 易编橙&#xff1a;一个帮助编程小伙伴少走弯路的终身成长社群&#x1f34a; 】 大家好&#xff0c;我是小森( &#xfe61;ˆoˆ&#xfe61; ) &#xff01; 易编橙终身成长社群创始团队嘉宾&#xff0c;橙似锦计划领衔成员、阿里云专家博主、腾讯云内容共创…

【漏洞复现】宏景HCM-LoadOtherTreeServlet SQL注入

声明&#xff1a;本文档或演示材料仅用于教育和教学目的。如果任何个人或组织利用本文档中的信息进行非法活动&#xff0c;将与本文档的作者或发布者无关。 一、漏洞描述 宏景HCM人力资源信息管理系统是一个全面的人力资源管理软件&#xff0c;它覆盖了人力资源管理的各个模块…

报错:python扩展中的调试器不再支持小于3.7的python版本(debugpy)

报错&#xff1a;python扩展中的调试器不再支持小于3.7的python版本 原因1&#xff1a; debugpy的版本问题原因2 原因1&#xff1a; debugpy的版本问题 是debugpy和你vscode安装的python解释器不匹配&#xff0c;根据你使用的python解释器的版本重新安装一个debugpy。 原因2 …

华为官方出品:《应用现代化实践指南》电子书,可免费下载

本期云享书库为各位开发者带来了应用现代化方面的技术内容。 在数字化时代&#xff0c;企业面临着前所未有的机遇与挑战。随着技术的飞速发展&#xff0c;特别是云计算、大数据、人工智能&#xff08;AI&#xff09;和机器学习&#xff08;ML&#xff09;的兴起&#xff0c;正…

Python爬虫速成之路(1):获取网页源代码

hello hello~ &#xff0c;这里是绝命Coding——老白~&#x1f496;&#x1f496; &#xff0c;欢迎大家点赞&#x1f973;&#x1f973;关注&#x1f4a5;&#x1f4a5;收藏&#x1f339;&#x1f339;&#x1f339; &#x1f4a5;个人主页&#xff1a;绝命Coding-CSDN博客 &a…

C#面:简述什么是中间件(Middleware)?

中间件是组装到应⽤程序管道中以处理请求和响应的软件。 每个组件&#xff1a; 选择是否将请求传递给管道中的下⼀个组件。 可以在调⽤管道中的下⼀个组件之前和之后执⾏⼯作。 请求委托&#xff08;Request delegates&#xff09;⽤于构建请求管道&#xff0c;处理每个HTTP请…

Threadlocal使用获取最后更新人信息

Threadlocal 的作用范围是一个线程&#xff0c;tomcat启动默认开启一个线程 首先点击登录&#xff0c;登录方法会返回token 拿到token后放在请求头中发送商品的插入请求&#xff0c;在插入是设置拿到token中的nickName&#xff08;花名&#xff09;放入&#xff08;lastUpdate…

windows系统长时间不用,无法唤醒

问题背景 在我们使用windows系统的时候&#xff0c;有这样一种情况&#xff0c;就是电脑长时间不不操作&#xff0c;就会“睡死”过去。此时再用鼠标键盘都无法将其唤醒。没办法只能长按电源键强制关机&#xff0c;再重启。那么该如何解决这种问题呢&#xff1f; 原因分析 系…

PLSQL Day7

--9.用户键盘输入5个数字&#xff0c;将数字按从小到大的顺序存入集合中&#xff1a;declare declare type num_type is table of number; n_tab num_type; temp_n number ; begin n_tab: num_type(&n1,&n2,&n3,&n4,&n5); for i in 1..n_tab.co…

高可用hadoop分布式节点的扩容

解决方案 修改hdfs-site.xml 文件 原xml文件 <?xml version"1.0" encoding"UTF-8"?> <?xml-stylesheet type"text/xsl" href"configuration.xsl"?> <!--Licensed under the Apache License, Version 2.0 (th…

编程参考 - 在C++类成员函数声明中使用const关键字

在 C 中&#xff0c;可以在类成员函数声明中使用 const 关键字来表示函数不修改对象的状态。这就是所谓的 "const 成员函数"。将成员函数声明为 const 时&#xff0c;意味着该函数承诺不更改对象的任何成员变量&#xff08;标记为可变的变量除外&#xff09;。 In C,…