Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes 在pourcent中设置限制CPU水平Pod自动缩放_Kubernetes_Google Kubernetes Engine_Kubernetes Ingress - Fatal编程技术网

Kubernetes 在pourcent中设置限制CPU水平Pod自动缩放

Kubernetes 在pourcent中设置限制CPU水平Pod自动缩放,kubernetes,google-kubernetes-engine,kubernetes-ingress,Kubernetes,Google Kubernetes Engine,Kubernetes Ingress,水鬼 我尝试在HPA上设置PCU目标。默认情况下,它是80%,我想将其设置为30% 在我的hpa pod.yaml中,我添加了值targetCPUUtilizationPercentage,但它不会覆盖我不理解的默认值。我弄错了吗 NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE horizontalpodautos

水鬼

我尝试在HPA上设置PCU目标。默认情况下,它是80%,我想将其设置为30%

在我的hpa pod.yaml中,我添加了值targetCPUUtilizationPercentage,但它不会覆盖我不理解的默认值。我弄错了吗

NAME                                          REFERENCE                TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
horizontalpodautoscaler.autoscaling/hpa-pod   Deployment/cas-dp-ap   0%/80%    1         4         1          5m
-


我的问题的解决方案是从metrics到name中删除所有块

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  labels:
    chart: value-given-by-helm
    release: cas-dp-ap
  name: hpa-pod
  namespace: xxx
spec:
  maxReplicas: 4
  minReplicas: 1
  scaleTargetRef:
    apiVersion: apps/v1beta1
    kind: Deployment
    name: cas-dp-ap
  targetCPUUtilizationPercentage: 30
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  labels:
    chart: value-given-by-helm
    release: cas-dp-ap
  name: hpa-pod
  namespace: xxx
spec:
  maxReplicas: 4
  minReplicas: 1
  scaleTargetRef:
    apiVersion: apps/v1beta1
    kind: Deployment
    name: cas-dp-ap
  targetCPUUtilizationPercentage: 30