When using Istio with Kubernetes, a number of different manifests require the same environment-specific values. For example, the host address is required by both the Gateway (under spec/servers/hosts
) and VirtualService (under spec/hosts)
. The typical approach to changing the address for different environments is to apply Kustomize patches. Is it possible to use a single patch to transform/insert the value into each manifest that needs it, or somehow maintain just one copy of the address that gets inserted where needed? The alternative is having to maintain multiple patch files with the same host address, and I would like to avoid duplication.
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: foo
spec:
selector:
istio: bar
servers:
- port:
number: 443
name: https
protocol: HTTPS
tls:
mode: SIMPLE
credentialName: secret
hosts:
- test.acme.com
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bazz
spec:
hosts:
- test.acme.com
gateways:
- foo
http:
- match:
- uri:
prefix: /api/v1
route:
- destination:
host: blarg
port:
number: 80