# 2021-01-18 #「Kubernetes Cluster」- 多环境共用集群

问题描述

部署高可用的 Kuernetes Cluster 需要多台主机,成本较高。

其中一种解决方法为:多环境共用同个集群,比如 Production 与 Staging 位于相同集群,并做好资源限制。

我们是否应该采用这种方案呢?

解决方法

我们没有采用“多环境共用集群”的方案,原因如下:
1)因为该方案并没有解决其他问题,只是单纯节省资源,
2)它带来的其他优势可以忽略不计:
3)于此同时,还带来其他问题。比如:需要严格控制资源限制、跨命名空间服务访问(同个集群里一定会面临命名冲突的问题,或者会转移为其他问题)

官方文档 Using Kubernetes Namespaces to Manage Environments / Caveats 也进行一定程度的劝退。

换个角度,如果这些主机成本我们无法负担,那也许是因为我们的业务还没有那么大规模以至于要使用 Kubernetes 服务。

参考文献

WikiNotes/多环境共用集群
How to Save Big Using One Kubernetes Cluster for Multiple Environments | Blue Sentry
Checklist: pros and cons of using multiple Kubernetes clusters, and how to distribute workloads between them
Multiple environments (Staging, QA, production, etc) with Kubernetes - Stack Overflow
Multiple stages within a Kubernetes cluster - JAXenter

猜你喜欢

转载自blog.csdn.net/u013670453/article/details/112796907