You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GKE节点缩容被阻:已配置PDB却报no.scale.down.node.pod.not.enough.pdb日志

问题:GKE节点缩容提示被Pod阻塞,但已配置PDB

我的GKE集群显示“Scale down blocked by pod”提示,点击该提示进入日志浏览器后,可看到触发事件的Pod对应的日志条目:no.scale.down.node.pod.not.enough.pdb。但这些出现该日志的Pod已配置了Pod Disruption Budget(PDB),因此怀疑GKE错误报告了节点缩容被阻的原因。以下是其中一个存在该问题的Pod的相关资源清单:

Service清单

apiVersion: v1
kind: Service
metadata:
  labels:
    app: ms-new-api-beta
  name: ms-new-api-beta
  namespace: beta
spec:
  ports:
    - port: 8000
      protocol: TCP
      targetPort: 8000
  selector:
    app: ms-new-api-beta
  type: NodePort

Deployment清单

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ms-new-api-beta
  name: ms-new-api-beta
  namespace: beta
spec:
  selector:
    matchLabels:
      app: ms-new-api-beta
  template:
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: 'true'
      labels:
        app: ms-new-api-beta
    spec:
      containers:
        - command:
            - /deploy/venv/bin/gunicorn
            - '--bind'
            - '0.0.0.0:8000'
            - 'newapi.app:app'
            - '--chdir'
            - /deploy/app
            - '--timeout'
            - '7200'
            - '--workers'
            - '1'
            - '--worker-class'
            - uvicorn.workers.UvicornWorker
            - '--log-level'
            - DEBUG
          env:
            - name: ENV
              value: BETA
            
          image: >-
            gcr.io/.../api:${trigger['tag']}
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 5
            httpGet:
              path: /rest
              port: 8000
              scheme: HTTP
            initialDelaySeconds: 120
            periodSeconds: 20
            timeoutSeconds: 30
          name: ms-new-api-beta
          ports:
            - containerPort: 8000
              name: http
              protocol: TCP
          readinessProbe:
            httpGet:
              path: /rest
              port: 8000
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 2
          resources:
            limits:
              cpu: 150m
            requests:
              cpu: 100m
          startupProbe:
            failureThreshold: 30
            httpGet:
              path: /rest
              port: 8000
            periodSeconds: 120
      imagePullSecrets:
        - name: gcp-docker-registry

Horizontal Pod Autoscaler清单

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: ms-new-api-beta
  namespace: beta
spec:
  maxReplicas: 5
  minReplicas: 2
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: ms-new-api-beta
  targetCPUUtilizationPercentage: 100

Pod Disruption Budget清单

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: ms-new-api-beta
  namespace: beta
spec:
  minAvailable: 0
  selector:
    matchLabels:
      app: ms-new-api-beta

内容的提问来源于stack exchange,提问作者Mauricio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 22:10:31