使用容器中的应用程序公开的使用REST API的水平Pod自动缩放

问题描述 投票:0回答:1

我正在使用Windows上的minikube,只有一个节点“ master”。

Spring Boot应用程序已部署具有REST端点,该端点提供了当前服务的客户端数量。当请求达到一定限制时,我想水平扩展或自动旋转吊舱。

Lets say:
There is 1 pod in the cluster.
If the request limit reached 50 (for Pod 1), spin up a new pod.
If the request limit reached 50 for Pod 1 and Pod 2, spin up a new Pod (Pod 3).

我曾尝试研究如何实现这一目标,但我一无所获。我所能找到的就是使用Horizo​​ntalPodAutoscaler(HPA)的CPU使用率进行横向扩展。收到有关如何使用Kubernetes HPA实现此目的的指南将很有帮助。

我在Windows上使用minikube,只有一个节点“ master”。部署的spring boot应用程序具有REST端点,该端点提供了其当前服务的客户端数量。我想缩放...

kubernetes autoscaling minikube kubernetes-pod
1个回答
0
投票

我相信您可以从autoscaling on custom metrics article开始。据我所知-这是可以通过将自定义指标与Prometheus Adapter for Kubernetes Metrics APIs(使用Prometheus实现的custom.metrics.k8s.io API)结合使用来实现的。

Prometheus Adapter for Kubernetes Metrics APIs repo包含Kubernetesresource metricsAPI和custom metrics API的实现。

© www.soinside.com 2019 - 2024. All rights reserved.