0

我正在尝试通过 IstioOperator manifest 和 k8s.overlays 为 istio ingressgateway 修补 podAntiAffinity 但总是得到类似的东西:

podAffinityTerm 不是有效的键:值路径元素这是我的配置:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  profile: default
  values:
    gateways:
      istio-ingressgateway:
        podAntiAffinityTermLabelSelector:
        - key: app
          operator: In
          values: istio-ingressgateway
          topologyKey: topology.kubernetes.io/zone
  components:
    ingressGateways:
      - name: istio-ingressgateway
        enabled: true
      - name: istio-ingressgateway-private
        enabled: true
        k8s:
          overlays:
            - kind: Deployment
              name: istio-ingressgateway-private
              patches:
                - path: metadata.labels.app
                  value: istio-ingressgateway-private
                - path: spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.[podAffinityTerm.topologyKey:topology.kubernetes.io/zone].labelSelector.matchExpressions[0].values[0]
                  value: istio-ingressgateway-private

确切的错误:

错误:路径 spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.[podAffinityTerm.topologyKey:"topology.kubernetes.io/zone"].labelSelector.matchExpressions.[0].values.[0]: [podAffinityTerm 不是有效的 key:value 路径元素,路径 spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.[podAffinityTerm.topologyKey:"topology.kubernetes.io/zone"].labelSelector.matchExpressions.[0].values.[0]: [podAffinityTerm 不是有效的键:值路径元素

此外,如果我使用索引而不是键/值对,它也可以正常工作。
感谢您的任何建议。
PS Istio 版本为 1.10.3

4

0 回答 0