Services not able to connect to Postgresql when Istio Sidecar is enabled in Kubernetes


Hi Team,
I am trying to enable istio sidecar injection with my containers running on kubernetes. The version on istio init container is proxy_init:1.0.3-gke.0 and of istio proxy is istio/proxyv2:1.0.3.
When i have enabled automatic injection in one of my namespace, my container do not create and got the error- decurtis.dxp.core.common.api.hibernate.config.PersistenceConfig$$EnhancerBySpringCGLIB$$cb4e7fa5.dataSource(<generated>) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke( at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( at java.base/java.lang.reflect.Method.invoke( at … 49 more Caused by: org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl( at org.postgresql.core.ConnectionFactory.openConnection( at org.postgresql.jdbc.PgConnection.<init>( at org.postgresql.Driver.makeConnection( at org.postgresql.Driver.connect( at com.zaxxer.hikari.util.DriverDataSource.getConnection( at com.zaxxer.hikari.util.DriverDataSource.getConnection(

Is something specific needs to be done so that services are able to connect to postgres. My postgres machine is running on AWS and not in same kubernetes cluster and without istio things are working fine.
Any help would be appreciated. Thanks in advance!


I hope you already figured this out, but just in case you didn’t here is what you need to configure.

Hope this helps.
Regards, Pablo