当前位置:网站首页>终极套娃 2.0 | 云原生交付的封装
终极套娃 2.0 | 云原生交付的封装
2022-07-01 03:06:00 【Erda技术团队】
本文约 3000 字,预计阅读时间:8 分钟
我总是喜欢一些比喻,这样可以让我们更加形象地认识事物。
Erda 是一个 PaaS 平台,底层用到的技术曾经从 marathon + mesos 切换到现在的 K8s,它们一般被认为是“容器层”。Erda 在“容器层”之上又堆叠了 CI/CD Pipeline、集群和部署管理、应用监控、自动化测试等等能力,这样分层的体现非常像网络的分层,每一层各司其职,不过我更喜欢将其比喻为「编程语言」。
一门高阶编程语言拥有更符合人类理解的语法,其通过编译成汇编或者机器码来实现运行,或者是编译成低阶语言再进行二次编译。
与此类似,Erda 通过对“容器层”的封装,对我们的用户呈现了具有“Erda 理念”的功能设计和使用体验。而所谓封装最重要的就是减少人为的“失误”,就好像高阶语言通过受限和优雅的语法、智能的编译提示以及丰富的类库,大大减少开发者的心智负担,可以轻松地写出健壮的代码。而在其之上的程序设计方法、最佳实践,为高速交付实现提供理论支撑。
Erda 的身骨是以「应用」为中心打造的,假设 Erda 只能剩下一个功能的话,那就是应用的“交付”。
交付可以非常简单,我称之为“两步走”:
将代码编译成应用安装包
在客户要求的环境中安装应用
制品是对 docker 镜像的进一步抽象,类似 docker-compose.yml,涵盖了多个镜像(服务)的总体描述,以及互相之间的依赖关系 制品是对应用交付环境的声明(结构化、可被系统识别的软件安装部署说明书),不仅声明每个镜像服务的资源限制,也能够声明所需要的中间件(比如 mysql)


制品的 Addons 详情
其中 rds 和 MySQL 可以互为替换


dice.yml:version: "2.0"envs:ETCDCTL_API: "3"services::cmd: /app/cluster-agentdeployments:replicas: 1envs:DEBUG: "false"resources:cpu: ${request_cpu:1}max_cpu: 1max_mem: 1024mem: ${request_mem:1024}addons:mysql:plan: mysql:basic
dice.yml,可以在开源代码中找到:dice.yml 对微服务/多应用整体“交付环境”的封装(实例个数、环境变量、资源消耗、中间件依赖),我们可以很自信地说:“开发者只需要关心其必要知晓的,其他由平台代为负责”。镜像列表(docker images) dice.yml声明了各个服务(镜像列表所对应的)部署所需的资源,以及需要的中间件
dice.yml 的语法规范和配置了。dice.yml 内容,并最终转换成“容器层”认知的结构(如果是 K8s 则是 Deployment、Service、Ingress,以及 StatefulSet 或者 Operator),进而交由“容器层”施展部署动作。熟悉 K8s 会知道,如果让用户手工编写这些配置,需要理解许多本不用知晓的知识(大多是运维相关),并且容易出错。dice.yml 似乎是一门“高阶语言”,而 K8s yml 则是“低阶语言”(我们这里所指高阶和低阶,并非认为“高阶”一定是“优秀”和“正确”的,而是指相对于方便人类认知而言,是更倾向于易于理解和防止出错的,而且恰恰是“低阶”在性能、灵活度、控制力以及正确逻辑方面是更有优势的),Erda 经过一次复杂的“编译”,将用户(我们不妨说业务研发人员)更容易理解的配置和声明格式或者语法,转变成实际部署的工作负载(Workload)和内生亦或外部的服务(Addons)。
———
Erda Github 地址: https://github.com/erda-project/erda Erda Cloud 官网: https://www.erda.cloud/

本文分享自微信公众号 - 尔达 Erda(gh_0f507c84dfb0)。
如有侵权,请联系 [email protected] 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。
边栏推荐
- mybati sql 语句打印
- Introduction to kubernetes resource objects and common commands (II)
- POI exports excel and displays hierarchically according to parent-child nodes
- Const and the secret of pointers
- ctfshow爆破wp
- Communication protocol -- Classification and characteristics Introduction
- PHP batch Excel to word
- [QT] add knowledge supplement of third-party database
- Huawei operator level router configuration example | configuration optionA mode cross domain LDP VPLS example
- STM32 - DS18B20 temperature sampling of first-line protocol
猜你喜欢
![[linear DP] longest common subsequence](/img/47/c3172422e997009facbada929adb1a.jpg)
[linear DP] longest common subsequence

Introduction to kubernetes resource objects and common commands (II)
![[machine learning] vectorized computing -- a must on the way of machine learning](/img/3f/d672bb254f845ea705b3a0ca10ee19.png)
[machine learning] vectorized computing -- a must on the way of machine learning

Redis tutorial

Saving images of different depths in opencv
![[QT] add knowledge supplement of third-party database](/img/ea/ca8b07ad80485208f2bb8ee8a78a28.png)
[QT] add knowledge supplement of third-party database

Restcloud ETL WebService data synchronization to local

Druid监控统计数据源

Gartner research: in China, the adoption of hybrid cloud has become the mainstream trend

Share Creators萌芽人才培養計劃來了!
随机推荐
An article explaining the publisher subscriber model and the observer model
调试定位导航遇到的问题总结
Let's just say I can use thousands of expression packs
Mouse over effect 8
Magnetic manometer and measurement of foreign coins
Communication protocol -- Classification and characteristics Introduction
HTB-Lame
Hello World generation
Pytest -- plug-in writing
Chapitre 03 Bar _ Gestion des utilisateurs et des droits
PTA 1017
Mouse over effect IV
[machine learning] vectorized computing -- a must on the way of machine learning
通信协议——分类及其特征介绍
Error accessing URL 404
Multithreaded printing
Poj-3486-computers[dynamic planning]
如何校验两个文件内容是否相同
Huawei operator level router configuration example | configuration optionA mode cross domain LDP VPLS example
Restcloud ETL practice data row column conversion