使用 istioctl 传递 loadBalancerSourceRanges 参数

Pass loadBalancerSourceRanges parameter with istioctl

我想部署 Istio 的演示应用程序并使用以下命令将源范围传递给负载均衡器:

istioctl manifest apply --set profile=demo --set values.gateways.istio-ingressgateway.loadBalancerSourceRanges={"x.x.x.x/x"}

不幸的是,我收到以下错误:

Error: failed to apply manifests: validation errors (use --force to override):
json: cannot unmarshal string into Go value of type []json.RawMessage

如何以正确的格式传递参数(ZSH 为 shell)?

你可以直接指定数组的索引,在ZSH中你必须转义方括号。

工作命令现在看起来像这样:

istioctl manifest apply --set profile=demo --set values.gateways.istio-ingressgateway.loadBalancerSourceRanges\[0\]=x.x.x.x/x