FacetController:我们如何让Lyft的基础设施变更变得简单

Written by Miguel Molina and Arvind Subramanian

撰写者 Miguel MolinaArvind Subramanian

Logo for FacetController

FacetController

FacetController

If you are curious about Lyft’s automatic deployment process on a higher level, please read our blog post on Continuous Deployment.

如果您对 Lyft 的自动部署过程感兴趣,请阅读我们关于 持续部署 的博客文章。

In this post, we will go a little deeper into the deployment stack and how we leverage Kubernetes Custom Resource Definitions (CRDs) to create an abstraction on top of Kubernetes native resources, known at Lyft as facets. Additionally, we will discuss the new controller we developed to manage these facets and to streamline infrastructure rollouts across the company.

在这篇文章中,我们将深入探讨部署栈以及我们如何利用 Kubernetes 自定义资源定义 (CRDs) 在 Kubernetes 原生资源之上创建一个抽象层,这在 Lyft 被称为 facets。此外,我们还将讨论我们开发的新控制器,以管理这些 facets 并简化公司内部的基础设施发布。

What are facets?

什么是 facets?

When deploying code, each Lyft microservice is composed of smaller deployable Kubernetes components called facets. There are several facet types representing different deployable Kubernetes objects, and they are defined in a generic manifest.yaml file within each project’s repository.

在部署代码时,每个 Lyft 微服务由称为 facets 的较小可部署 Kubernetes 组件组成。有几种 facet 类型代表不同的可部署 Kubernetes 对象,它们在每个项目的代码库中的通用 manifest.yaml 文件中定义。

The following are some of the facet types we have at Lyft:

以下是我们在 Lyft 拥有的一些 facet 类型:

Service facets

服务面

These facets receive and send traffic, typically web servers containing APIs for a microservice. In this example the service facet will have different autoscaling min and max sizes per environment, and the HPA will scale up when CPU utilization reaches 70%.

这些 facets 接收和发送流量,通常是包含微服务 API 的 Web 服务器。在这个例子中,服务 facet 将根据环境具有不同的自动扩展最小和最大大小,当 CPU 利用率达到 70% 时,HPA 将进行扩展。

- name: webservice
container_command: go run main.go
type: service
autoscaling:
criteria:
cpu_target: 70
environment:
staging:
min_size: 5
max_size: 20
production:
min_size: 5
max_size: 200

- name: webservice
container_command: go run main.go
type: service
autoscaling:
criteria:
cpu_target: 70
environment:
staging:
min_size: 5
max_siz...

开通本站会员,查看完整译文。

ホーム - Wiki
Copyright © 2011-2025 iteam. Current version is 2.142.0. UTC+08:00, 2025-02-25 19:02
浙ICP备14020137号-1 $お客様$