华为云UCS-联邦管理面创建HPA后分发到成员集群失败怎么办?:解决方案
解决方案
您可以在分发HPA前,将成员集群版本升级至v1.23及以上的版本,该版本默认支持autoscaling/v2的HPA。
若您仍想分发autoscaling/v1版本的HPA到成员集群,您的PropagationPolicy对象中的resourceSelectors[i].apiVersion字段应配置为autoscaling/v2,如示例YAML所示。分发成功后,您可以在成员集群中查询到autoscaling/v1版本的HPA。
apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: test-hpa spec: maxReplicas: 5 minReplicas: 1 scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: nginx targetCPUUtilizationPercentage: 10 --- apiVersion: policy.karmada.io/v1alpha1 kind: PropagationPolicy metadata: name: test-hpa-pp spec: placement: clusterAffinity: clusterNames: - member1 resourceSelectors: - apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler name: test-hpa namespace: default