hpa

How to supply external metrics into HPA?

倾然丶 夕夏残阳落幕 提交于 2021-02-19 02:28:06
问题 Problem setting. Suppose I have 2 pods, A and B. I want to be able to dynamically scale pod A based on some arbitrary number from some arbitrary source. Suppose that pod B is such a source: for example, it can have an HTTP server with an endpoint which responds with the number of desired replicas of pod A at the moment of request. Or maybe it is an ES server or a SQL DB (does not matter). Question. What kubernetes objects do I need to define to achieve this (apart from HPA)? What

Kubernetes AWS Cloudwatch adapter not fetching custom metric value for EKS HPA autoscaling

你。 提交于 2021-01-27 14:22:58
问题 I'm trying to enable AWS EKS autoscaling based on a custom Cloudwatch metric via the Kubernetes Cloudwatch adapter. I have pushed custom metrics to AWS Cloudwatch, and validated they appear in Cloudwatch console as well as are retrievable using the boto3 client get_metric_data. This is the code I use to publish my custom metric to Cloudwatch: import boto3 from datetime import datetime client = boto3.client('cloudwatch') cloudwatch_response = client.put_metric_data( Namespace='TestMetricNS',

Kubernetes HPA doesn't scale down after decreasing the loads

风格不统一 提交于 2021-01-07 03:55:11
问题 the Kubernetes HPA works correctly when load of the pod increased but after the load decreased, the scale of deployment doesn't change. This is my HPA file: apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: baseinformationmanagement namespace: default spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: baseinformationmanagement minReplicas: 1 maxReplicas: 3 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80 -

Kubernetes HPA doesn't scale down after decreasing the loads

走远了吗. 提交于 2021-01-07 03:54:51
问题 the Kubernetes HPA works correctly when load of the pod increased but after the load decreased, the scale of deployment doesn't change. This is my HPA file: apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: baseinformationmanagement namespace: default spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: baseinformationmanagement minReplicas: 1 maxReplicas: 3 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80 -

Kubernetes without pod metrics

旧城冷巷雨未停 提交于 2020-12-08 04:44:26
问题 I´m trying to deploy metrics to kubernetes and something really strange is happening, I have one worker and one master. I have the following pods list: NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES default php-apache-774ff9d754-d7vp9 1/1 Running 0 2m43s 192.168.77.172 master-node <none> <none> kube-system calico-kube-controllers-6b9d4c8765-x7pql 1/1 Running 2 4h11m 192.168.77.130 master-node <none> <none> kube-system calico-node-d4rnh 0/1 Running 1 4h11m 10