千云物流 - 使用k8s负载均衡openelb
openelb的介绍
具体根据官方文档进行安装官方文档,这里作为测试环境的安装使用.
OpenELB 是一个开源的云原生负载均衡器实现,可以在基于裸金属服务器、边缘以及虚拟化的 Kubernetes 环境中使用 LoadBalancer 类型的 Service 对外暴露服务。OpenELB 项目最初由 KubeSphere 社区 发起,目前已作为 CNCF 沙箱项目 加入 CNCF 基金会,由 OpenELB 开源社区维护与支持。
与MetalLB类似,OpenELB也拥有两种主要工作模式:Layer2模式和BGP模式。OpenELB的BGP模式目前暂不支持IPv6。
-
layer2 Mode


-
BGP Mode

准备k8s的环境
千云物流测试环境部署使用openelb部署.
| 所需要的软件&版本 | 对应依赖软件版本 |
|---|---|
| linux [CentOS] | 7.9.2009 |
| kubernetes | v1.22.12 |
| docker [20.10.8] | 20.10.8 |
| openelb | kubesphere/openelb:v0.5.1 |
准备Layer2 Mode配置
- 配置ARP参数
部署Layer2模式需要把k8s集群中的ipvs配置打开strictARP,
strict ARP configure arp_ignore and arp_announce to avoid answering ARP queries from kube-ipvs0 interface
# 查看kube-proxy中的strictARP配置
$ kubectl get configmap -n kube-system kube-proxy -o yaml | grep strictARP
#strictARP: false# 手动修改strictARP配置为true
$ kubectl edit configmap -n kube-system kube-proxy
configmap/kube-proxy edited# 使用命令直接修改并对比不同
$ kubectl get configmap kube-proxy -n kube-system -o yaml | sed -e "s/strictARP: false/strictARP: true/" | kubectl diff -f - -n kube-system# 确认无误后使用命令直接修改并生效
$ kubectl get configmap kube-proxy -n kube-system -o yaml | sed -e "s/strictARP: false/strictARP: true/" | kubectl apply -f - -n kube-system# 重启kube-proxy确保配置生效
$ kubectl rollout restart ds kube-proxy -n kube-system# 确认配置生效
$ kubectl get configmap -n kube-system kube-proxy -o yaml | grep strictARPstrictARP: true
开启之后k8s集群中的kube-proxy会停止响应kube-ipvs0网卡之外的其他网卡的arp请求,而由MetalLB接手处理。
strict ARP开启之后相当于把将arp_ignore设置为1;并将arp_announce设置为2启用严格的ARP,这个原理和LVS中的DR模式对RS的配置一样,可以参考之前的文章中的解释。
网卡配置

#多个网卡,需要指定master节点IP,一个网卡不需要
# kubectl annotate nodes k8s-master01 layer2.openelb.kubesphere.io/v1alpha1="masterip"
创建EIP
接下来我们需要配置loadbalancerIP所在的网段资源,这里我们创建一个Eip对象来进行定义,后面对IP段的管理也是在这里进行。
- 部署eip
apiVersion: network.kubesphere.io/v1alpha2
kind: Eip
metadata:# Eip 对象的名称。name: layer2-eip
spec:# Eip 对象的地址池address: 10.0.0.122-10.0.0.123# openELB的运行模式,默认为bgpprotocol: layer2# OpenELB 在其上侦听 ARP/NDP 请求的网卡。该字段仅在protocol设置为时有效layer2。interface: ens160# 指定是否禁用 Eip 对象# false表示可以继续分配# true表示不再继续分配disable: false
status:# 指定 Eip 对象中的IP地址是否已用完。occupied: false# 指定 Eip 对象中有多少个 IP 地址已分配给服务。# 直接留空,系统会自动生成usage:# Eip 对象中的 IP 地址总数。poolSize: 2# 指定使用的 IP 地址和使用 IP 地址的服务。服务以Namespace/Service name格式显示(例如,default/test-svc)。# 直接留空,系统会自动生成used:# Eip 对象中的第一个 IP 地址。firstIP: 10.0.0.122# Eip 对象中的最后一个 IP 地址。lastIP: 10.0.0.123ready: true# 指定IP协议栈是否为 IPv4。目前,OpenELB 仅支持 IPv4,其值只能是true.v4: true
- 检查eip状态
kubectl apply -f openelb/openelb-eip.yaml#部署完成后检查eip的状态kubectl get eip
部署openelb
这里我们还是使用yaml进行部署,官方把所有部署的资源整合到了一个文件中,我们还是老规矩先下载到本地再进行部署
apiVersion: v1
kind: Namespace
metadata:name: openelb-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:annotations:controller-gen.kubebuilder.io/version: v0.4.0creationTimestamp: nullname: bgpconfs.network.kubesphere.io
spec:group: network.kubesphere.ionames:kind: BgpConflistKind: BgpConfListplural: bgpconfssingular: bgpconfscope: Clusterversions:- name: v1alpha1schema:openAPIV3Schema:description: BgpConf is the Schema for the bgpconfs APIproperties:apiVersion:description: 'APIVersion defines the versioned schema of this representationof an object. Servers should convert recognized schemas to the latestinternal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'type: stringkind:description: 'Kind is a string value representing the REST resource thisobject represents. Servers may infer this from the endpoint the clientsubmits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'type: stringmetadata:type: objectspec:description: struct for container bgp:config. Configuration parametersrelating to the global BGP router.properties:as:description: original -> bgp:as bgp:as's original type is inet:as-number.Local autonomous system number of the router. Uses the 32-bit as-numbertype from the model in RFC 6991.format: int32type: integerport:description: original -> gobgp:portformat: int32maximum: 65535minimum: 1type: integerrouterID:description: original -> bgp:router-id bgp:router-id's original typeis inet:ipv4-address. Router id of the router, expressed as an 32-bitvalue, IPv4 address.pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}$type: stringrequired:- as- port- routerIDtype: objectstatus:description: BgpConfStatus defines the observed state of BgpConftype: objecttype: objectserved: truestorage: false- name: v1alpha2schema:openAPIV3Schema:description: BgpConf is the Schema for the bgpconfs APIproperties:apiVersion:description: 'APIVersion defines the versioned schema of this representationof an object. Servers should convert recognized schemas to the latestinternal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'type: stringkind:description: 'Kind is a string value representing the REST resource thisobject represents. Servers may infer this from the endpoint the clientsubmits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'type: stringmetadata:type: objectspec:description: Configuration parameters relating to the global BGP router.properties:as:format: int32type: integerasPerRack:additionalProperties:format: int32type: integertype: objectfamilies:items:format: int32type: integertype: arraygracefulRestart:properties:deferralTime:format: int32type: integerenabled:type: booleanhelperOnly:type: booleanlocalRestarting:type: booleanlonglivedEnabled:type: booleanmode:type: stringnotificationEnabled:type: booleanpeerRestartTime:format: int32type: integerpeerRestarting:type: booleanrestartTime:format: int32type: integerstaleRoutesTime:format: int32type: integertype: objectlistenAddresses:items:type: stringtype: arraylistenPort:format: int32type: integerpolicy:type: stringrouterId:type: stringuseMultiplePaths:type: booleantype: objectstatus:description: BgpConfStatus defines the observed state of BgpConfproperties:nodesConfStatus:additionalProperties:properties:as:format: int32type: integerrouterId:type: stringtype: objecttype: objecttype: objecttype: objectserved: truestorage: truesubresources:status: {}
status:acceptedNames:kind: ""plural: ""conditions: []storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:annotations:controller-gen.kubebuilder.io/version: v0.4.0creationTimestamp: nullname: bgppeers.network.kubesphere.io
spec:group: network.kubesphere.ionames:kind: BgpPeerlistKind: BgpPeerListplural: bgppeerssingular: bgppeerscope: Clusterversions:- name: v1alpha1schema:openAPIV3Schema:description: BgpPeer is the Schema for the bgppeers APIproperties:apiVersion:description: 'APIVersion defines the versioned schema of this representationof an object. Servers should convert recognized schemas to the latestinternal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'type: stringkind:description: 'Kind is a string value representing the REST resource thisobject represents. Servers may infer this from the endpoint the clientsubmits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'type: stringmetadata:type: objectspec:properties:addPaths:description: original -> bgp:add-paths Parameters relating to theadvertisement and receipt of multiple paths for a single NLRI (add-paths).properties:sendMax:description: original -> bgp:send-max The maximum number of pathsto advertise to neighbors for a single NLRI.type: integertype: objectconfig:description: original -> bgp:neighbor-address original -> bgp:相关文章:
千云物流 - 使用k8s负载均衡openelb
openelb的介绍 具体根据官方文档进行安装官方文档,这里作为测试环境的安装使用. OpenELB 是一个开源的云原生负载均衡器实现,可以在基于裸金属服务器、边缘以及虚拟化的 Kubernetes 环境中使用 LoadBalancer 类型的 Service 对外暴露服务。OpenELB 项目最初由 KubeSphere 社区…...
C语言之字符串函数
C语言之字符串函数 文章目录 C语言之字符串函数1. strlen的使用和模拟实现1.1 strlen的使用1.2 strlen的模拟实现 2. strcpy的使用和模拟实现2.1 strcpy的使用2.2 strncpy的使用2.3 strcpy的模拟实现 3. strcat的使用和模拟实现3.1 strcat的使用3.2 strncat3.3 strcat的模拟实现…...
python中一个文件(A.py)怎么调用另一个文件(B.py)中定义的类AA详解和示例
本文主要讲解python文件中怎么调用另外一个py文件中定义的类,将通过代码和示例解读,帮助大家理解和使用。 目录 代码B.pyA.py 调用过程 代码 B.py 如在文件B.py,定义了类别Bottleneck,其包含卷积层、正则化和激活函数层,主要对…...
spark shuffle 剖析
ShuffleExchangeExec private lazy val writeMetrics SQLShuffleWriteMetricsReporter.createShuffleWriteMetrics(sparkContext)private[sql] lazy val readMetrics SQLShuffleReadMetricsReporter.createShuffleReadMetrics(sparkContext)用在了两个地方,承接的是…...
C语言之认识柔性数组(flexible array)
在学习之前,我们首先要了解柔性数组是放在结构体当中的,知道这一点,我们就开始今天的学习吧! 1.柔性数组的声明 在C99中,结构中的最后一个元素允许是未知大小的数组,这就叫做柔性数组成员 这里的结构是结构…...
【MATLAB基础绘图第17棒】绘制玫瑰图
MATLAB绘制玫瑰图 玫瑰图(Nightingale Rose Chart)风玫瑰图(WindRose)准备工作:WindRose工具包下载案例案例1:基础绘图 参考 玫瑰图(Nightingale Rose Chart) 玫瑰图(Ni…...
Qt 基于海康相机的视频绘图
需求 在视频窗口上进行绘图,包括圆,矩形,扇形等 效果: 思路: 自己取图然后转成QImage ,再向QWidget 进行渲染,根据以往的经验,无法达到很高的帧率。因此决定使用相机SDK自带的渲染…...
FlinkCDC实现主数据与各业务系统数据的一致性(瀚高、TIDB)
文章末尾附有flinkcdc对应瀚高数据库flink-cdc-connector代码下载地址 1、业务需求 目前项目有主数据系统和N个业务系统,为保障“一数一源”,各业务系统表涉及到主数据系统的字段都需用主数据系统表中的字段进行实时覆盖,这里以某个业务系统的一张表举例说明:业务系统表Ta…...
JSP:Servlet
Servlet处理请求过程 B/S请求响应模型 Servlet介绍 JSP是Servlet的一个成功应用,其子集。 JSP页面负责前台用户界面,JavaBean负责后台数据处理,一般的Web应用采用JSPJavaBean就可以设计得很好了。 JSPServletJavaBean是MVC Servlet的核心…...
react中的state
没想到hooks中也有state这一说法 看下面的两个案例 1、无state变化不会执行父子函数 2、有state更改执行父子函数...
VR全景航拍要注意什么,航拍图片如何处理
引言: VR全景航拍技术是当前摄影和航拍领域的新潮流。它采用虚拟现实技术,通过360度全景镜头捕捉画面,可以为观众提供身临其境的视觉体验。在宣传展示中,利用VR全景航拍技术可以为品牌宣传带来更加生动、震撼的视觉效果。 一、航拍注意事项 …...
Spark---集群搭建
Standalone集群搭建与Spark on Yarn配置 1、Standalone Standalone集群是Spark自带的资源调度框架,支持分布式搭建,这里建议搭建Standalone节点数为3台,1台master节点,2台worker节点,这虚拟机中每台节点的内存至少给…...
Linux上通过SSL/TLS和start tls连接到LDAP服务器
一,大致流程。 1.首先在Linux上搭建一个LDAP服务器 2.在LDAP服务器上安装CA证书,服务器证书,因为SSL/TLS,start tls都属于机密通信,需要客户端和服务器都存在一个相同的证书认证双方的身份。3.安装phpldapadmin工具&am…...
【华为OD题库-034】字符串化繁为简-java
题目 给定一个输入字符串,字符串只可能由英文字母(a ~ z、A ~ Z)和左右小括号()组成。当字符里存在小括号时,小括号是成对的,可以有一个或多个小括号对,小括号对不会嵌套,小括号对内可以包含1个或多个英文字母也可以不…...
斯坦福大学引入FlashFFTConv来优化机器学习中长序列的FFT卷积
斯坦福大学的FlashFFTConv优化了扩展序列的快速傅里叶变换(FFT)卷积。该方法引入Monarch分解,在FLOP和I/O成本之间取得平衡,提高模型质量和效率。并且优于PyTorch和FlashAttention-v2。它可以处理更长的序列,并在人工智能应用程序中打开新的可…...
信息系统项目管理师-干系人管理论文提纲
快速导航 1.信息系统项目管理师-项目整合管理 2.信息系统项目管理师-项目范围管理 3.信息系统项目管理师-项目进度管理 4.信息系统项目管理师-项目成本管理 5.信息系统项目管理师-项目质量管理 6.信息系统项目管理师-项目资源管理 7.信息系统项目管理师-项目沟通管理 8.信息系…...
Windmill:最快的自托管开源工作流引擎
我们对 Windmill 进行了基准测试,认为它是 Airflow、Prefect 甚至 Temporal 中最快的自托管通用工作流引擎。对于 Airflow,有速度快了 10 倍! 工作流引擎编排工作人员的有向无环图 (DAG) 中定义的作业,同时尊重依赖性。 主要优点…...
线性代数 - 几何原理
目录 序言向量的定义线性组合、张成空间与向量基线性变换和矩阵线性复合变换与矩阵乘法三维空间的线性变换行列式矩阵的秩和逆矩阵维度变换点乘叉乘基变换特征值和特征向量抽象向量空间 序言 欢迎阅读这篇关于线性代数的文章。在这里,我们将从一个全新的角度去探索线…...
火电厂电气部分设计
摘要 本文首先根据任务书上所给系统与线路及所有负荷的参数,分析负荷发展趋势。从负荷增长方面阐明了建站的必要性,然后通过对拟建变电站的概括以及出线方向来考虑,并通过对负荷资料的分析,安全,经济及可靠性方面考虑…...
界面组件DevExpress Reporting v23.1 - Web报表设计器功能升级
DevExpress Reporting是.NET Framework下功能完善的报表平台,它附带了易于使用的Visual Studio报表设计器和丰富的报表控件集,包括数据透视表、图表,因此您可以构建无与伦比、信息清晰的报表 界面组件DevExpress Reporting v23.1已经发布一段…...
免费解密网易云NCM文件:3分钟快速转换加密音乐格式终极指南
免费解密网易云NCM文件:3分钟快速转换加密音乐格式终极指南 【免费下载链接】ncmdump 项目地址: https://gitcode.com/gh_mirrors/ncmd/ncmdump 你是否曾遇到从网易云音乐下载的歌曲无法在其他播放器上播放的困扰?那些以.ncm为扩展名的文件&…...
别再瞎调了!手把手教你读懂WiFi 6E的6GHz信道表,选对频宽网速翻倍
WiFi 6E实战指南:6GHz信道与频宽选择的艺术 每次打开路由器后台,面对密密麻麻的信道选项和频宽设置,你是否感到无从下手?WiFi 6E带来的6GHz频段确实为我们提供了更宽广的高速公路,但如何在这条新路上设置最佳的车道宽度…...
别再纠结选哪个了!Asterisk、FreeSWITCH、Kamailio、OpenSIPS四大开源SIP服务器保姆级对比(附选型指南)
四大开源SIP服务器深度横评:从架构设计到实战选型 当你需要为企业通信系统或呼叫中心搭建语音基础设施时,开源SIP服务器的选型往往令人眼花缭乱。Asterisk、FreeSWITCH、Kamailio和OpenSIPS这四大主流方案各有千秋,但选择不当可能导致后期架构…...
基于模板驱动的PPT自动化生成:解放重复劳动,实现高效办公
1. 项目概述:从重复劳动中解放,让PPT制作自动化如果你和我一样,经常需要基于公司或团队的固定PPT模板,批量生成内容相似但数据不同的演示文稿,那你一定对“复制粘贴、改数字、调格式”这套流程深恶痛绝。每次季度汇报、…...
AMD Ryzen终极性能调优指南:SMUDebugTool免费开源工具完全解析
AMD Ryzen终极性能调优指南:SMUDebugTool免费开源工具完全解析 【免费下载链接】SMUDebugTool A dedicated tool to help write/read various parameters of Ryzen-based systems, such as manual overclock, SMU, PCI, CPUID, MSR and Power Table. 项目地址: ht…...
FPGA远程升级的“安全气囊”:手把手教你用ICAP原语实现Multiboot回滚机制
FPGA远程升级的“安全气囊”:手把手教你用ICAP原语实现Multiboot回滚机制 在工业自动化、医疗设备和通信基站等关键领域,FPGA设备的远程升级能力已成为刚需。想象一下,当数百公里外的风力发电机组FPGA需要修复逻辑漏洞时,工程师不…...
保姆级教程:用Verilog手把手实现一个MIPI CSI-2 D-PHY接收器(附PPI接口时序详解)
保姆级教程:用Verilog手把手实现一个MIPI CSI-2 D-PHY接收器(附PPI接口时序详解) 在嵌入式视觉系统中,MIPI CSI-2接口因其高带宽和低功耗特性成为图像传感器与处理器之间的首选通信协议。本文将深入探讨D-PHY接收器的RTL实现细节&…...
competitive-ads-extractor技能:分析竞争对手广告的完整教程
competitive-ads-extractor技能:分析竞争对手广告的完整教程 【免费下载链接】awesome-codex-skills A curated list of practical Codex skills for automating workflows across the Codex CLI and API. 项目地址: https://gitcode.com/GitHub_Trending/aw/awes…...
深度学习(4)自动求导
1. 向量链式法则① 例子1是一个线性回归的例子,如下图所示。内积是一个标量,相当于对标量求导标量对行向量求导结果还是行向量这时,X是一个矩阵这里统一采用分子布局,分子布局和分母布局只差一个转置。I为单位矩阵2. 自动求导3. 计…...
Nixtla时间序列预测生态:统一接口、高速统计与深度学习模型实战
1. 项目概述:时间序列预测的“瑞士军刀”如果你正在处理时间序列数据,无论是销售预测、服务器监控还是能源消耗分析,那么“Nixtla/nixtla”这个名字很可能已经出现在你的雷达上。这不是一个单一的工具,而是一个由Nixtla团队维护的…...
