I had an existing instance of IstioOperator installed from Istio v1.5:
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
This worked fine.
I added the following section in the k8s section (under 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
So that I could add kafka to list of ports.
This did not work, even though the docs show I should be able to specify something like [name:kafka] to add an element to a list:
K8sObjectOverlay.PathValue
Field - Path of the form
a.[key1:value1].b.[:value2]Where[key1:value1]is a selector for a key-value pair to identify a list element and[:value]is a value selector to identify a list element in a leaf list. All path intermediate nodes must exist.
I believe this is not due to a typo, because I am able to replace an existing element in the list with the kafka patch by specifying a path like spec.ports[1]. I am not able to specify an existing port to overwrite it with any [key:value] pair, and spec.ports[-] does not work for appending to the end of the list.
This does not match my expectations. Does anyone have any ideas where I'm going wrong?
Thanks in advance!