簡體   English   中英

Flink Kubernetes 部署 - HPA 控制器無法獲取目標的當前規模:

[英]Flink Kubernetes deployment - the HPA controller was unable to get the target's current scale:

我正在使用下面提到的 YAML 文件部署 flink 有狀態應用程序。

apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
  name: operational-reporting-15gb
spec:
  image:.azurecr.io/stateful-app-v2
  flinkVersion: v1_15
  flinkConfiguration:
    taskmanager.numberOfTaskSlots: "2"
    state.savepoints.dir: abfs://flinktest@.dfs.core.windows.net/savepoints.v2
    state.checkpoints.dir: abfs://flinktest@.dfs.core.windows.net/checkpoints.v2
    high-availability: org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory
    high-availability.storageDir: abfs://flinktest@.dfs.core.windows.net/ha.v2
  serviceAccount: flink
  jobManager:
    resource:
      memory: "15360m"
      cpu: 2
  taskManager:
    resource:
      memory: "15360m"
      cpu: 3
  podTemplate:
    spec:
      containers:
        - name: flink-main-container
          volumeMounts:
            - mountPath: /flink-data
              name: flink-volume
      volumes:
        - name: flink-volume
          emptyDir: {}
  job:
    jarURI: local:///opt/operationalReporting.jar
    parallelism: 1
    upgradeMode: savepoint
    state: running

Flink 作業運行良好。 對於自動縮放,我使用以下代碼創建了 HPA。

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: basic-hpa
  namespace: default
spec:
  minReplicas: 1
  maxReplicas: 15
  metrics:
  - type: Resource
    resource:
      name: memory
      target:
        type: Utilization
        averageValue: 100m
  scaleTargetRef:
    apiVersion: flink.apache.org/v1beta1
    kind: FlinkDeployment
    name: operational-reporting-15gb

在描述自動縮放時,我得到了下面提到的錯誤。

類型 狀態 原因 消息


AbleToScale False FailedGetScale HPA 控制器無法獲取目標的當前比例:flinkdeployments.flink.apache.org "operational-reporting-15gb" not found Events: Type Reason Age From Message


警告 FailedGetScale 4m4s (x121 over 34m) Horizo​​ntal-pod-autoscaler flinkdeployments.flink.apache.org "operational-reporting-15gb" not found

對於 HPA 目標顯示 UNKNOW。 請幫助

我假設您正在關注 Kubernetes Operator 的HPA 示例 感謝您試一試,它是文檔中概述的實驗性功能,目前我們對它的經驗有限。

那就是說檢查你的FlinkDeployment命名為operational-reporting-15gbdefault命名空間中運行? 否則,請相應地調整 HPA 的命名空間。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM