简体   繁体   English

Kubernetes Statefulset 缩减

[英]Kubernetes Statefulset Downscaling

Currently I am running a solr cluster on Kubernetes as a statefulset.目前我正在 Kubernetes 上运行一个 solr 集群作为 statefulset。 My solr cluster has 39 pods running in it.我的 solr 集群中有 39 个 pod 在其中运行。 I am running a single pod on a single physical node.我在单个物理节点上运行单个 Pod。 My solr cluster has just 1 collection divived into 3 shards, each shard has 13 nodes (or pods) running in it and out of those 13 nodes (or pods), 3 are TLOG replicas and 10 are PULL replicas.我的 solr 集群只有 1 个集合,分为 3 个分片,每个分片有 13 个节点(或 pod)在其中运行,并且在这 13 个节点(或 pod)之外,3 个是 TLOG 副本,10 个是 PULL 副本。

The problem that I want to disucss is - I want to autoscale my solr cluster .我想讨论的问题是 - 我想自动缩放我的 solr 集群 On the basis of some condition I want to downscale my PULL replica nodes (or pods) to minimum, so that unnecessary consumption can be reduced.基于某些条件,我想将我的 PULL 副本节点(或 pod)缩小到最小,以便减少不必要的消耗。 Now I know I can use HPA in Kuberntes to autoscale, but while downscaling I don't want to stop my TLOG nodes (or pods).现在我知道我可以在 Kuberntes 中使用 HPA 进行自动缩放,但是在缩减时我不想停止我的 TLOG 节点(或 pod)。 Similarly, while scaling up I want to just add PULL replicas to my cluster.同样,在扩展时,我只想将 PULL 副本添加到我的集群中。

Can anyone please help me with this problem.任何人都可以帮我解决这个问题。

You can have different deployments for each one of the pod types, eg one Deployment for TLOG pods and another one for PULL pods.您可以对每种 pod 类型进行不同的部署,例如,一种部署用于 TLOG pod,另一种用于 PULL pod。 Then you can define a fixed number of replicas for the TLOG pods and an HPA for the PULL pods.然后,您可以为 TLOG pod 定义固定数量的副本,并为 PULL pod 定义一个 HPA。 This will allow for adding / removing PULL pods only, without any impact on the TLOG pods.这将只允许添加/删除 PULL pod,而不会对 TLOG pod 产生任何影响。

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

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