使用 GitHub Actions 作为 PaaS 控制平面的实验 | Mewayz Blog 跳至主要内容
Hacker News

使用 GitHub Actions 作为 PaaS 控制平面的实验

评论

6 最小阅读量

Mewayz Team

Editorial Team

Hacker News

意想不到的结合:Git 和平台

DevOps 的世界建立在自动化之上。我们编写部署脚本,将基础设施作为代码进行管理,并努力使每个流程可重复且可靠。对于无数开发团队来说,其核心是 GitHub,这是一个无处不在的代码协作平台。但如果它的功能可以扩展到版本控制和 CI/CD 之外呢?这是一个突破 GitHub Actions 界限的实验故事,将其从构建和测试协调器转变为整个平台即服务 (PaaS) 的中枢神经系统(控制平面)。

重新定义控制平面

传统上,PaaS 控制平面是一个复杂的定制软件。它是一个中央机构,负责接收命令(部署这个,扩展那个)并协调底层基础设施以实现这一目标。它处理配置、网络、安全和生命周期管理。建造一个是一项重大的工程任务。我们实验的假设很简单:我们可以利用现有的、强大的、熟悉的 GitHub Actions 工作流程来执行这些相同的职责吗?我们不会编写单一的控制平面,而是使用 YAML 文件、拉取请求和 GitHub 强大的事件驱动生态系统来管理我们的平台。

“最强大的工具是您的团队已经知道如何使用的工具。通过使用 GitHub Actions 作为我们的控制平面,我们无需构建 UI 或教授新概念;我们扩展了开发人员喜爱的现有以 Git 为中心的工作流程。”

构建 GitHub 驱动的 PaaS

该架构的重点是将基础设施声明和应用程序配置视为存储库中的代码。例如,开发人员部署新微服务的工作流程如下所示:

开发人员为其服务创建一个新目录,并添加一个定义其需求的“mewayz.app.yaml”文件:CPU、内存、环境变量和域。

他们提交该文件并打开拉取请求。打开 PR 的行为就会触发 GitHub Actions 工作流程。

该工作流充当控制平面,解析 YAML 文件、验证配置并执行基础设施更改的试运行。

PR 合并后,将触发单独的部署工作流程。此工作流程包含与各种云 API(Kubernetes、AWS 等)通信的逻辑,以实际配置必要的资源并部署服务。

💡 您知道吗?

Mewayz在一个平台内替代8+种商业工具

CRM·发票·人力资源·项目·预订·电子商务·销售点·分析。永久免费套餐可用。

免费开始 →

然后,工作流程使用新部署服务的实时链接对提交进行评论,从而完成循环。

这种方法与 Mewayz 的模块化理念和开发人员体验无缝集成。整个平台的状态是版本控制的、可审计的,并且遵循与应用程序代码本身相同的协作审查流程。

边疆的教训

该实验在证明可行性方面取得了巨大成功。我们实现了功能齐全、Git-ops 驱动的 PaaS,其中每个更改都是可追踪和可逆的。然而,它也揭示了重要的考虑因素。复杂的状态管理有时会突破 YAML 文件中优雅的界限。虽然 GitHub Actions 具有令人难以置信的可扩展性,但对于大规模平台来说,与专用的低延迟控制平面 API 相比,工作流的排队和执行时间可能会成为瓶颈。安全至关重要;我们必须精心管理机密和权限,以确保 GitHub Action 运行程序具有履行其职责所需的最低访问权限,这一概念与 Mewayz 的安全设计原则完全一致。

以 Git 为中心的未来一瞥

这个实验表明,我们用于协作和 CI/CD 的工具足够强大,可以重新用于我们平台的基础。它模糊了开发应用程序和管理其运行环境之间的界限,将它们统一在一个单一的环境下

Frequently Asked Questions

An Unexpected Union: Git and the Platform

The world of DevOps is built on automation. We script deployments, manage infrastructure as code, and strive to make every process repeatable and reliable. At the heart of this for countless development teams is GitHub, the ubiquitous platform for code collaboration. But what if its power could be extended beyond version control and CI/CD? This is the story of an experiment to push the boundaries of GitHub Actions, transforming it from a build-and-test orchestrator into the central nervous system—the control plane—for an entire Platform as a Service (PaaS).

Redefining the Control Plane

Traditionally, a PaaS control plane is a complex, bespoke piece of software. It's a central authority that receives commands (deploy this, scale that) and orchestrates the underlying infrastructure to make it happen. It handles provisioning, networking, security, and lifecycle management. Building one is a significant engineering undertaking. The hypothesis of our experiment was simple: could we leverage the existing, powerful, and familiar workflow of GitHub Actions to perform these same duties? Instead of writing a monolithic control plane, we would use YAML files, pull requests, and GitHub's robust event-driven ecosystem to manage our platform.

Architecting the GitHub-Driven PaaS

The architecture centered on treating infrastructure declarations and application configurations as code within a repository. A developer's workflow to deploy a new microservice, for instance, would look like this:

Lessons from the Frontier

The experiment was a resounding success in proving feasibility. We achieved a fully functional, Git-ops driven PaaS where every change was traceable and reversible. However, it also revealed important considerations. Complex state management sometimes pushed the boundaries of what was elegant in a YAML file. While GitHub Actions is incredibly scalable, for massive-scale platforms, the queueing and execution time of workflows could become a bottleneck compared to a dedicated, low-latency control plane API. Security was paramount; we had to meticulously manage secrets and permissions to ensure the GitHub Action runner had the exact minimum access required to perform its duties—a concept perfectly aligned with Mewayz's secure-by-design principles.

A Glimpse into a Git-Centric Future

This experiment demonstrates that the tools we use for collaboration and CI/CD are powerful enough to be repurposed into the very foundation of our platforms. It blurs the line between developing an application and managing the environment it runs on, unifying them under a single, Git-based workflow. For companies like Mewayz, which are building the next generation of business OS platforms, this exploration is invaluable. It challenges conventional architecture and opens doors to incredibly intuitive and integrated developer experiences. While it may not replace every custom control plane, it stands as a powerful testament to the idea that the best solution might already be in your toolkit.

All Your Business Tools in One Place

Stop juggling multiple apps. Mewayz combines 208 tools for just $49/month — from inventory to HR, booking to analytics. No credit card required to start.

Try Mewayz Free →

免费试用 Mewayz

集 CRM、发票、项目、人力资源等功能于一体的平台。无需信用卡。

立即开始更智能地管理您的业务

加入 6,208+ 家企业使用 Mewayz 专业开具发票、更快收款并减少追款时间。无需信用卡。

觉得这有用吗?分享一下。

准备好付诸实践了吗?

加入6,208+家使用Mewayz的企业。永久免费计划——无需信用卡。

开始免费试用 →

准备好采取行动了吗?

立即开始您的免费Mewayz试用

一体化商业平台。无需信用卡。

免费开始 →

14 天免费试用 · 无需信用卡 · 随时取消