当前位置: 首页 > news >正文

rancher v2.8.1 如何成功注册已有 k8s 集群

需要加入的集群为rke2部署的双节点集群

$ kubectl get node
NAME           STATUS   ROLES                              AGE   VERSION
rke-master01   Ready    control-plane,etcd,master,worker   94d   v1.26.8+rke2r1
rke-master02   Ready    control-plane,etcd,master,worker   93d   v1.26.8+rke2r1

登陆 rancher
在这里插入图片描述

在这里插入图片描述

注意:直接执行截图中的命令,不要改动yaml内容。当执行完后注册集群的agent会报错,随后,我们通过
kubectl edit deploy cattle-cluster-agent -n cattle-system命令添加hostAlias,其他方式会注册失败,例如:先修改yaml再apply执行。

格式如下:

      hostAliases:- hostnames:- rancher02.demo.comip: 192.168.23.80

完整内容:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:name: proxy-clusterrole-kubeapiserver
rules:
- apiGroups: [""]resources:- nodes/metrics- nodes/proxy- nodes/stats- nodes/log- nodes/specverbs: ["get", "list", "watch", "create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:name: proxy-role-binding-kubernetes-master
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: proxy-clusterrole-kubeapiserver
subjects:
- apiGroup: rbac.authorization.k8s.iokind: Username: kube-apiserver
---
apiVersion: v1
kind: Namespace
metadata:name: cattle-system---apiVersion: v1
kind: ServiceAccount
metadata:name: cattlenamespace: cattle-system---apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:name: cattle-admin-bindingnamespace: cattle-systemlabels:cattle.io/creator: "norman"
subjects:
- kind: ServiceAccountname: cattlenamespace: cattle-system
roleRef:kind: ClusterRolename: cattle-adminapiGroup: rbac.authorization.k8s.io---apiVersion: v1
kind: Secret
metadata:name: cattle-credentials-535d46anamespace: cattle-system
type: Opaque
data:url: "aHR0cHM6Ly9yYW5jaGVyMDIuZGVtby5jb20="token: "Z2hwZmJkbHBzbTk1NTJ4cXZuYmQ3NW5yOXA1N3d0ZnN4bGJ2dDd6cmwyY3Zwc3BxbGc5NWY1"namespace: ""---apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:name: cattle-adminlabels:cattle.io/creator: "norman"
rules:
- apiGroups:- '*'resources:- '*'verbs:- '*'
- nonResourceURLs:- '*'verbs:- '*'---apiVersion: apps/v1
kind: Deployment
metadata:name: cattle-cluster-agentnamespace: cattle-systemannotations:management.cattle.io/scale-available: "2"
spec:selector:matchLabels:app: cattle-cluster-agenttemplate:metadata:labels:app: cattle-cluster-agentspec:affinity:nodeAffinity:preferredDuringSchedulingIgnoredDuringExecution:- preference:matchExpressions:- key: node-role.kubernetes.io/controlplaneoperator: Invalues:- "true"weight: 100- preference:matchExpressions:- key: node-role.kubernetes.io/control-planeoperator: Invalues:- "true"weight: 100- preference:matchExpressions:- key: node-role.kubernetes.io/masteroperator: Invalues:- "true"weight: 100- preference:matchExpressions:- key: cattle.io/cluster-agentoperator: Invalues:- "true"weight: 1requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: beta.kubernetes.io/osoperator: NotInvalues:- windowspodAntiAffinity:preferredDuringSchedulingIgnoredDuringExecution:- podAffinityTerm:labelSelector:matchExpressions:- key: appoperator: Invalues:- cattle-cluster-agenttopologyKey: kubernetes.io/hostnameweight: 100serviceAccountName: cattlehostAliases:- hostnames:- rancher02.demo.comip: 192.168.23.80tolerations:# No taints or no controlplane nodes found, added defaults- effect: NoSchedulekey: node-role.kubernetes.io/controlplanevalue: "true"- effect: NoSchedulekey: "node-role.kubernetes.io/control-plane"operator: "Exists"- effect: NoSchedulekey: "node-role.kubernetes.io/master"operator: "Exists"containers:- name: cluster-registerimagePullPolicy: IfNotPresentenv:- name: CATTLE_IS_RKEvalue: "false"- name: CATTLE_SERVERvalue: "https://rancher02.demo.com"- name: CATTLE_CA_CHECKSUMvalue: "d818528e6c91a42ed9573c1cbe4b6e3df067d3ebca8b57efccb8e463306e3760"- name: CATTLE_CLUSTERvalue: "true"- name: CATTLE_K8S_MANAGEDvalue: "true"- name: CATTLE_CLUSTER_REGISTRYvalue: ""- name: CATTLE_SERVER_VERSIONvalue: v2.8.1- name: CATTLE_INSTALL_UUIDvalue: 26c8f3d4-ad4d-4412-87e6-2f4ecb3ce63c- name: CATTLE_INGRESS_IP_DOMAINvalue: sslip.ioimage: rancher/rancher-agent:v2.8.1volumeMounts:- name: cattle-credentialsmountPath: /cattle-credentialsreadOnly: truevolumes:- name: cattle-credentialssecret:secretName: cattle-credentials-535d46adefaultMode: 320strategy:type: RollingUpdaterollingUpdate:maxUnavailable: 0maxSurge: 1---
apiVersion: v1
kind: Service
metadata:name: cattle-cluster-agentnamespace: cattle-system
spec:ports:- port: 80targetPort: 80protocol: TCPname: http- port: 443targetPort: 444protocol: TCPname: https-internalselector:app: cattle-cluster-agent

注册成功。如图:
在这里插入图片描述

相关文章:

rancher v2.8.1 如何成功注册已有 k8s 集群

需要加入的集群为rke2部署的双节点集群 $ kubectl get node NAME STATUS ROLES AGE VERSION rke-master01 Ready control-plane,etcd,master,worker 94d v1.26.8rke2r1 rke-master02 Ready control-plane,etcd,mast…...

Vue中$root的使用方法

查看本专栏目录 关于作者 还是大剑师兰特:曾是美国某知名大学计算机专业研究生,现为航空航海领域高级前端工程师;CSDN知名博主,GIS领域优质创作者,深耕openlayers、leaflet、mapbox、cesium,canvas&#x…...

redis 异步队列

//produceMessage.ts 模拟生产者 import Redis from ioredis; const redis new Redis(); // 生产者:将消息推送到队列 async function produceMessage(queueName:string, message:string) {try {await redis.rpush(queueName, message);console.log(Produced messa…...

SpringBoot + Nacos 实现动态化线程池

1.背景 在后台开发中,会经常用到线程池技术,对于线程池核心参数的配置很大程度上依靠经验。然而,由于系统运行过程中存在的不确定性,我们很难一劳永逸地规划一个合理的线程池参数。 在对线程池配置参数进行调整时,一…...

《Docker极简教程》--Dockerfile--Dockerfile的基本语法

Dockerfile是一种文本文件,用于定义Docker镜像的内容和构建步骤。它包含一系列指令,每个指令代表一个构建步骤,从基础镜像开始,逐步构建出最终的镜像。通过Dockerfile,用户可以精确地描述应用程序运行环境的配置、依赖…...

css中, grid-auto-rows: 怎样简写在grid:中

grid-auto-rows:100px; grid-template-columns:1fr 1fr; 👆可以写成👇 grid:auto-flow 100px / 1fr 1fr;在CSS Grid布局中,grid-auto-rows 属性用于指定自动生成的网格容器的行的大小。如果你想要将 grid-auto-rows 的值简写在 grid 属性中&a…...

@ 代码随想录算法训练营第8周(C语言)|Day53(动态规划)

代码随想录算法训练营第8周(C语言)|Day53(动态规划) Day50、动态规划(包含题目 ● 123.买卖股票的最佳时机III ● 188.买卖股票的最佳时机IV ) 123.买卖股票的最佳时机III 题目描述 给定一个数组 price…...

算法-矩阵置零

1、题目来源 73. 矩阵置零 - 力扣(LeetCode) 2、题目描述 给定一个 m x n 的矩阵,如果一个元素为 0 ,则将其所在行和列的所有元素都设为 0 。请使用 原地 算法。 示例 1: 输入:matrix [[1,1,1],[1,0,1…...

xilinx除法器的使用

平台:Vivado2018.3. 芯片:xcku115-flva1517-2-i (active) 最近学习使用了xilinx除法器,在使用过程中出现了很多次除法器的结果和我预计的结果不一致,特此记录学习一下。 参考文件:pg151.下载地址 pg151-div-gen.pdf …...

算法沉淀——递归(leetcode真题剖析)

算法沉淀——递归 01.汉诺塔问题02.合并两个有序链表03.反转链表04.两两交换链表中的节点05.Pow(x, n) 递归是一种通过调用自身的方式来解决问题的算法。在递归算法中,问题被分解为更小的相似子问题,然后通过对这些子问题的解进行组合来解决原始问题。递…...

BERT模型中的input_ids和attention_mask参数

一、概述 1.1 input_ids 在BERT模型及其衍生体中,输入文本首先经过一个分词处理流程,其中文本被细分为单词或子单词(subwords),每个分词随后映射到一个唯一的整数标识符。这些标识符组成了所谓的input_ids数组&#x…...

java+vue_springboot企业设备安全信息系统14jbc

企业防爆安全信息系统采用B/S架构,数据库是MySQL。网站的搭建与开发采用了先进的java进行编写,使用了vue框架。该系统从三个对象:由管理员、人员和企业来对系统进行设计构建。主要功能包括:个人信息修改,对人员管理&am…...

vulhub中Apache Log4j Server 反序列化命令执行漏洞复现(CVE-2017-5645)

Apache Log4j是一个用于Java的日志记录库,其支持启动远程日志服务器。Apache Log4j 2.8.2之前的2.x版本中存在安全漏洞。攻击者可利用该漏洞执行任意代码。 1.我们使用ysoserial生成payload,然后直接发送给your-ip:4712端口即可。 java -jar ysoserial-…...

基于python+django+vue.js开发的医院门诊管理系统/医疗管理系统

功能介绍 平台采用B/S结构,后端采用主流的Python语言进行开发,前端采用主流的Vue.js进行开发。 功能包括:医生管理、科室管理、护士管理、住院管理、药品管理、用户管理、日志管理、系统信息模块。 源码地址 https://github.com/geeeeeee…...

Linux文件系统笔记

文章目录 FILE SYSTEM软硬链接 动静态库 使用别人提供的库 FILE SYSTEM 文件的管理工作: 1.基础知识: 文件 属性 内容不是所有文件都会打开所有的打开的,未打开的文件会进行管理未打开文件,要能做到快速定位文件磁盘–物理存…...

vue封装el-table表格组件

先上效果图&#xff1a; 本文包含了具名插槽、作用域插槽、jsx语法三种&#xff1a; Render.vue&#xff08;很重要&#xff0c;必须有&#xff09;: <script> export default {name: "FreeRender",functional: true,props: {scope:Object,render: Functio…...

「Python系列」Python数据结构

文章目录 一、数据结构二、相关链接 一、数据结构 Python提供了多种内置的数据结构&#xff0c;这些数据结构在编程中非常有用。以下是Python中常见的一些数据结构&#xff1a; 列表&#xff08;List&#xff09;: 列表是Python中最常用的数据结构之一&#xff0c;它是一个有…...

MySQL多实例部署:从概念到实操的全面指南

目录 MySQL多实例管理 单实例 什么是多实例 多实例的好处 多实例的弊端 MySQL多实例用在哪些场景 资金紧张的公司 用户并发访问量不大的业务 大型网站也有用多实例 部署MySQL多实例 rpm和源码的优缺点 二进制方式安装mysql 准备二进制mysql运行所需的环境 准备多…...

C++学习Day07之虚函数和纯虚函数

目录 前言一、程序及输出1.1 虚函数1.2 纯虚函数1.2.1 定义、示例1.2.2 引入原因1.2.3 抽象类 二、分析与总结 前言 在 C 中&#xff0c;虚函数和纯虚函数是实现多态性的重要概念。虚函数是在基类中声明为虚函数的函数&#xff0c;在派生类中可以被重写&#xff0c;实现动态联…...

GZ036 区块链技术应用赛项赛题第9套

2023年全国职业院校技能大赛 高职组 “区块链技术应用” 赛项赛卷&#xff08;9卷&#xff09; 任 务 书 参赛队编号&#xff1a; 背景描述 随着异地务工人员的增多&#xff0c;房屋租赁成为一个广阔是市场&#xff1b;目前&#xff0c;现有技术中的房屋租赁是由…...

TDengine 快速体验(Docker 镜像方式)

简介 TDengine 可以通过安装包、Docker 镜像 及云服务快速体验 TDengine 的功能&#xff0c;本节首先介绍如何通过 Docker 快速体验 TDengine&#xff0c;然后介绍如何在 Docker 环境下体验 TDengine 的写入和查询功能。如果你不熟悉 Docker&#xff0c;请使用 安装包的方式快…...

微软PowerBI考试 PL300-选择 Power BI 模型框架【附练习数据】

微软PowerBI考试 PL300-选择 Power BI 模型框架 20 多年来&#xff0c;Microsoft 持续对企业商业智能 (BI) 进行大量投资。 Azure Analysis Services (AAS) 和 SQL Server Analysis Services (SSAS) 基于无数企业使用的成熟的 BI 数据建模技术。 同样的技术也是 Power BI 数据…...

模型参数、模型存储精度、参数与显存

模型参数量衡量单位 M&#xff1a;百万&#xff08;Million&#xff09; B&#xff1a;十亿&#xff08;Billion&#xff09; 1 B 1000 M 1B 1000M 1B1000M 参数存储精度 模型参数是固定的&#xff0c;但是一个参数所表示多少字节不一定&#xff0c;需要看这个参数以什么…...

Python:操作 Excel 折叠

💖亲爱的技术爱好者们,热烈欢迎来到 Kant2048 的博客!我是 Thomas Kant,很开心能在CSDN上与你们相遇~💖 本博客的精华专栏: 【自动化测试】 【测试经验】 【人工智能】 【Python】 Python 操作 Excel 系列 读取单元格数据按行写入设置行高和列宽自动调整行高和列宽水平…...

通过Wrangler CLI在worker中创建数据库和表

官方使用文档&#xff1a;Getting started Cloudflare D1 docs 创建数据库 在命令行中执行完成之后&#xff0c;会在本地和远程创建数据库&#xff1a; npx wranglerlatest d1 create prod-d1-tutorial 在cf中就可以看到数据库&#xff1a; 现在&#xff0c;您的Cloudfla…...

安宝特方案丨XRSOP人员作业标准化管理平台:AR智慧点检验收套件

在选煤厂、化工厂、钢铁厂等过程生产型企业&#xff0c;其生产设备的运行效率和非计划停机对工业制造效益有较大影响。 随着企业自动化和智能化建设的推进&#xff0c;需提前预防假检、错检、漏检&#xff0c;推动智慧生产运维系统数据的流动和现场赋能应用。同时&#xff0c;…...

04-初识css

一、css样式引入 1.1.内部样式 <div style"width: 100px;"></div>1.2.外部样式 1.2.1.外部样式1 <style>.aa {width: 100px;} </style> <div class"aa"></div>1.2.2.外部样式2 <!-- rel内表面引入的是style样…...

GitHub 趋势日报 (2025年06月08日)

&#x1f4ca; 由 TrendForge 系统生成 | &#x1f310; https://trendforge.devlive.org/ &#x1f310; 本日报中的项目描述已自动翻译为中文 &#x1f4c8; 今日获星趋势图 今日获星趋势图 884 cognee 566 dify 414 HumanSystemOptimization 414 omni-tools 321 note-gen …...

docker 部署发现spring.profiles.active 问题

报错&#xff1a; org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property spring.profiles.active imported from location class path resource [application-test.yml] is invalid in a profile specific resource [origin: class path re…...

Python ROS2【机器人中间件框架】 简介

销量过万TEEIS德国护膝夏天用薄款 优惠券冠生园 百花蜂蜜428g 挤压瓶纯蜂蜜巨奇严选 鞋子除臭剂360ml 多芬身体磨砂膏280g健70%-75%酒精消毒棉片湿巾1418cm 80片/袋3袋大包清洁食品用消毒 优惠券AIMORNY52朵红玫瑰永生香皂花同城配送非鲜花七夕情人节生日礼物送女友 热卖妙洁棉…...