【发布时间】:2020-06-20 14:49:37
【问题描述】:
我从 Istio v1.5 安装了一个现有的 IstioOperator 实例:
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio
spec:
profile: default
components:
ingressGateways:
- namespace: istio-system
name: istio-ingressgateway
enabled: true
k8s:
serviceAnnotations:
"cloud.google.com/load-balancer-type": "Internal"
"service.beta.kubernetes.io/aws-load-balancer-internal": "0.0.0.0/0"
"service.beta.kubernetes.io/azure-load-balancer-internal": "true"
"external-dns.alpha.kubernetes.io/hostname": "*.SedTarget"
addonComponents:
kiali:
enabled: true
prometheus:
enabled: false
这很好用。
我在k8s 部分(spec.components.ingressGateways[0].k8s 下)添加了以下部分:
overlays:
- apiVersion: v1
kind: Service
name: istio-ingressgateway
patches:
- path: spec.ports.[name:kafka]
value:
name: kafka
protocol: TCP
port: 9092
targetPort: 9092
这样我就可以将kafka 添加到端口列表中。
这不起作用,即使the docs show I should be able to specify something like [name:kafka] to add an element to a list:
K8sObjectOverlay.PathValue
Field -
a.[key1:value1].b.[:value2]形式的路径其中[key1:value1]是用于标识列表元素的键值对的选择器,[:value]是用于标识叶列表中的列表元素的值选择器。所有路径中间节点都必须存在。
我相信这不是因为拼写错误,因为我我能够通过指定类似spec.ports[1] 的路径将列表中的现有元素替换为kafka 补丁。我无法指定现有端口以使用任何 [key:value] 对覆盖它,并且 spec.ports[-] 不适用于追加到列表末尾。
这不符合我的期望。有人知道我哪里出错了吗?
提前致谢!
【问题讨论】:
-
补丁操作示例请看以下测试文件:github.com/ostromart/istio/blob/…
标签: kubernetes istio