首页 >> 用品 >> KubeVela v1.3 多集群初体验,得心应手管理应用分发和差异化配置

KubeVela v1.3 多集群初体验,得心应手管理应用分发和差异化配置

2025-08-08 12:17:30

ment。

劝注意,管控协同对三子协同报送教育资源获得成功的前提是,三子协同必须有已经新建的对应取名为密闭。由于每个协同默认都有 default 取名为密闭,所以可以正常报送。也就是说我们将 basic.yaml 的取名为密闭改用 multi-cluster ,则就会收到报错:

apiVersion: core.oam.dev/v1beta1

kind: Application

metadata:

name: example-app

namespace: default

spec:

components:

- name: hello-world-server

type: webservice

properties:

image: crccheck/hello-world

port: 8000

traits:

- type: scaler

properties:

replicas: 3

- type: gateway

properties:

domain: testsvc-mc.example.com

# classInSpec : true 如果你所报送的协同里头有安装 v1.20 表列出版的 Kubernetes ,劝加上这个字段

http:

"/": 8000

policies:

- type: topology

name: beijing-clusters

properties:

clusters: ["beijing-1","beijing-2"]

在未来的 KubeVela 版前,我们将支持采用鉴权三子系统,不够有效率不够公共安全的进行这项操作:通过管控协同一键在三子协同创设取名为密闭。

进行三子协同取名为密闭创设后,切回管控协同创设分析方法并报送教育资源:

➜ vela up -f basic.yaml

Applying an application in vela K8s object format...

"patching object" resource="core.oam.dev/v1beta1, Kind=Application"

✅ App has been deployed 🚀🚀🚀

Port forward: vela port-forward example-app

SSH: vela exec example-app

Logging: vela logs example-app

App status: vela status example-app

Service status: vela status example-app 便是svc hello-world-server

我们通过 vela status 详细信息服务项目关的信息:

➜ vela status example-app

About:

Name: example-app

Namespace: default

Created at: 2022-03-25 17:42:33 +0800 CST

Status: running

Workflow:

mode: DAG

finished: true

Suspend: false

Terminated: false

Steps

- id:wftf9d4exj

name:deploy-beijing-clusters

type:deploy

phase:succeeded

message:

Services:

- Name: hello-world-server

Cluster: beijing-1 Namespace: default

Type: webservice

Healthy Ready:3/3

Traits:

✅ scaler ✅ gateway: Visiting URL: testsvc-mc.example.com, IP: 60.205.222.30

- Name: hello-world-server

Cluster: beijing-2 Namespace: default

Type: webservice

Healthy Ready:3/3

Traits:

✅ scaler ✅ gateway: Visiting URL: testsvc-mc.example.com, IP: 182.92.222.128

beijing-1 和 beijing-2 都报送了对应的教育资源,它们可可供外部会面的 IP 地址也显示出来,你因而可以用你期望的作法可供浏览器会面了。

采用协同 labels 按必需组递送

除了上述的程序在,我们平常就会碰上另外的状况:串连人口众多部署到某些协同、自行决定哪个云的产品的协同等等。为了借助于类似这样的期望,可以采用多协同的 labels 功能。

在这里头,也就是说 us-west-1 协同来自 AWS,我们要额外递送分析方法到 AWS 的协同,则可以采用 vela cluster labels add 来对协同顺利进行标示出。当然,如果还有 us-west-2 等多个 AWS 关的协同,同样顺利进行标示出后,将就会统一报送:

➜ ~ vela cluster labels add us-west-1 provider=AWS

Successfully update labels for cluster us-west-1 (type: X509Certificate).

provider=AWS

➜ ~ vela cluster list

CLUSTER TYPE ENDPOINT ACCEPTED LABELS

beijing-1 X509Certificate true

beijing-2 X509Certificate true

us-west-1 X509Certificate true provider=AWS

接下来我们对 basic.yaml 顺利进行不够新,新增一个分析方法意图 topology-aws:

policies:

- type: topology

name: beijing-clusters

properties:

clusters: ["beijing-1","beijing-2"]

- type: topology

name: topology-aws

properties:

clusterLabelSelector:

provider: AWS

为了易于你学习,劝直接部署基于 basic.yaml 不够新后的 intermediate.yaml:

➜ ~ vela up -f intermediate.yaml

再次详细信息分析方法的状态:

➜ vela status example-app

- Name: hello-world-server

Cluster: us-west-1 Namespace: default

Type: webservice

Healthy Ready:3/3

Traits:

✅ scaler ✅ gateway: Visiting URL: testsvc-mc.example.com, IP: 192.168.40.10

通过分析方法意图顺利进行必需差异化

除了在 basic.yaml 里头界定的 deploy-beijing 这种分析方法意图,我们往往有不够多的分析方法意图期望,比如高必需,期望基本上给某些教育资源递送 5 个原件。仅仅,采用 override 类型的分析方法意图即可:

clusterLabelSelector:

provider: AWS

- type: override

name: override-high-availability

properties:

components:

- type: webservice

traits:

- type: scaler

properties:

replicas: 5

同时也就是说,我们期望的是,给 AWS 的分析方法递送并设为为高必需。那我们可以采用 KubeVela 提可供的专门用于界定过程控制的工作流过来负责管理。我们采用如下的一个工作流过,它期望将本次分析方法部署,首先通过 deploy-beijing 的分析方法意图,递送给北京的协同们,接着给 Label 为 AWS 的协同递送 5 个原件高必需的分析方法意图:

properties:

replicas: 5

workflow:

steps:

- type: deploy

name: deploy-beijing

properties:

policies: ["beijing-clusters"]

- type: deploy

name: deploy-aws

properties:

policies: ["override-high-availability","topology-aws"]

接着我们给 intermediate.yaml 加上以上的分析方法意图和工作流过后,不够新为 advanced.yaml:

policies:

- type: topology

name: beijing-clusters

properties:

clusters: ["beijing-1","beijing-2"]

- type: topology

name: topology-aws

properties:

clusterLabelSelector:

provider: AWS

- type: override

name: override-high-availability

properties:

components:

- type: webservice

traits:

- type: scaler

properties:

replicas: 5

workflow:

steps:

- type: deploy

name: deploy-beijing

properties:

policies: ["beijing-clusters"]

- type: deploy

name: deploy-aws

properties:

policies: ["override-high-availability","topology-aws"]

然后对其顺利进行部署,并再次详细信息分析方法的状态:

➜ vela up -f advanced.yaml

Applying an application in vela K8s object format...

"patching object" resource="core.oam.dev/v1beta1, Kind=Application"

✅ App has been deployed 🚀🚀🚀

Port forward: vela port-forward example-app

SSH: vela exec example-app

Logging: vela logs example-app

App status: vela status example-app

Service status: vela status example-app 便是svc hello-world-serverapplication.core.oam.dev/podinfo-app configured

➜ vela status example-app

- Name: hello-world-server

Cluster: us-west-1 Namespace: default

Type: webservice

Healthy Ready:5/5

Traits:

✅ scaler ✅ gateway: Visiting URL: testsvc-mc.example.com, IP: 192.168.40.10

以上就是本次的全部分享,来向你的阅读和一些游戏。

追捧你继续探讨 KubeVela v1.3 正式版[3],这里头有不够多差异化必需的进阶辞汇等你推测和采用,比如 override 分析方法意图如何进行教育资源类型通配还是针对某些特定组件顺利进行伸展等等,以满足不够加复杂的情节期望。

关的链接

[1] KubeVela v1.3

[2] multi-cluster-demo

_Cluster_Demo

[3] 继续探讨 KubeVela v1.3 正式版

本文为阿里头云原创内容,未经意味着不得刊载。

北京好的肠癌医院
信阳妇科专科医院有哪些
武汉看男科去哪家医院好
肇庆男科医院挂号咨询
合肥精神心理医院哪家好
美容
感染者又增加?新冠的三大知识点一定要知道!
急性支气管炎咳嗽治疗用药
止咳糖浆怎么选
性病科

上一篇: GTX1650还能用吗?RTX 40将至,我选择集中精力等等党

下一篇: 3家光谷企业获选2021中国“智能制造50强”

相关阅读
齐达内已在火车上!大巴黎更衣室得知消息,皇马隔空遭痛击

杭州等待时间1年末21日讯:根据西班牙媒体马卡报带来的确切传言,目前大阿姆斯特丹更衣内已经知道法国队将会在没多久后沦为阿姆斯特丹圣日尔曼的新任教头。一些大阿姆斯特丹的内部管理层,已经向国脚们提前

2025-10-23 00:16:15
又筹划控制权变更!勤上股份接盘方却是再现自然人李俊锋

性该一些公司持续亏损,在此之前无法可持续经营方式,布氏出售的所持财产评估值合理,不发挥作用价格低廉出售一些公司财产和以权谋私等情形。成都晚报馆新闻记者 马在换换。a h

2025-10-23 00:16:15
房价下跌了这么久,怎么还是不知广大炒房客们,着急抛售房产?

将近一年整整里,各地楼价遇冷得很突出,据中所国气象局颁行的数据资料来看,前些往常全国平均市价仍然重新跌回了万元比较大,这没法显然上述见解。此时的客户应在所持币观望,因为在市价下跌时买房,自己的贫

2025-10-23 00:16:15
财年的麻烦与困境

货脱离金子等实物本位(效用锚定)全盘转解构视作信用通货后,深受到诸多各种因素,仅限于企业、贫穷和银行业部门真诚既得利益最大解构,两党不够注重推动民心巩固执政地位,弱势群体转型银行业政治弱势群体转型转型

2025-10-23 00:16:15
大冷门!孙颖莎混双出局,王楚钦打脸自责,樊振东带赵学而闯进4强

大黑马!孙颖莎男子双打出交,王楚和文打脸自责,樊振东带师妹杀进4强 1月21日, WTT澳门冠军赛一触即发男子双打14决赛角力,诞生大黑马。新科世锦赛冠军王楚和文孙颖莎不敌首

2025-10-23 00:16:15