Hi,
I created a gateway and virtual service to access a postgres server. It works very well.
But it works only for one instance.
This is my configuration:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: postgres-gateway
namespace: test
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- hosts:
- ‘hostname1’
port:
number: 5432
name: tcp-postgres
protocol: TCP
- ‘hostname1’
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: postgres-vs
namespace: test
spec:
hosts:
- “hostname1”
gateways: - postgres-gateway
hosts: - ‘hostname1’
tcp: - match:
- port: 5432
route: - destination:
host: postgres-test-postgresql-ha-pgpool.test.svc.cluster.local
port:
number: 5432
- port: 5432
But now I have a second database running also on port 5432 and a different namespace.
How can I make it accessible with an ingress too ?
When I check the listener , I have:
istioctl pc listener -n istio-system istio-ingressgateway-56b8d79bfc-qc82n
ADDRESS PORT MATCH DESTINATION
0.0.0.0 5432 ALL Cluster: outbound|5432||postgres-test-postgresql-ha-pgpool.test.svc.cluster.local
If apply a gw, vs with different hostname and of course difference destination, the new listener is not visible.
Have you got any idea how I can configure it ?
Thank you