简体   繁体   English

每个应用程序Kubernetes集群?

[英]Kubernetes Cluster per app?

I have a two-cluster multi-region HA enabled in production working in MS Azure. 我在MS Azure中的生产中启用了双群集多区域HA。

I was asked to reuse the same cluster to manage several new projects using Microservices. 我被要求重用同一个集群来管理几个使用微服务的新项目。

What is the best practice here ? 这里的最佳做法是什么? Should I create a cluster per app ? 我应该为每个应用创建一个群集吗? Is it better to isolate every project in different clusters and cloud account subcriptions? 隔离不同群集中的每个项目和云帐户子订单是否更好?

Looking forward for opinions. 期待有意见。

Thanks. 谢谢。

I would suggest you slice and dice your cluster by using Namespaces .You can easily create a namespace by using the following command. 我建议您使用命名空间对群集进行切片和切块。您可以使用以下命令轻松创建命名空间。

kubectl create namespace my-project

Now you can feed your all manifest files (deployment, services, secrets, PersistentVolumeClaims) to API Server to that my-project namespace. 现在,您可以将所有清单文件(部署,服务,机密,PersistentVolumeClaims)提供给API服务器到该my-project命名空间。 for instance, 例如,

kubectl create -f my-deployment.yaml --namespace my-project

Do not forget to use namespace flag otherwise these manifest would be applied to the default namespace. 不要忘记使用名称空间标志,否则这些清单将应用于默认名称空间。

If you want to delete your project. 如果要删除项目。 you just need to delete the namespace.It will delete all of the resources related to that project. 您只需删除命名空间。它将删除与该项目相关的所有资源。

kubectl delete namespace my-project

furthermore, You can limit the quota to each namespace for resources utilization. 此外,您可以将配额限制为每个命名空间以用于资源利用。

you can further dig up with Namespace 你可以进一步挖掘命名空间

Edited 编辑

Namespaces are virtual clusters in a physical cluster 命名空间是物理群集中的虚拟群集

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM