I'm hoping someone here might have an idea what's causing this. I've got an AKS cluster with a number of microservices accessing resources in an Azure Postgres database server. I have firewall rules defined for the Postgres server for both the POD subnet as well as the Kubernetes service subnet. All accesses to databases in this Postgres server are from within these subnets. There is no access to this server from an external source. However, when my services start up, I always get hit by this exception:
2018-12-02 19:23:57.540 INFO [venus,,,] 1 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-12-02 19:23:57.543 INFO [venus,,,] 1 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet complexGraphQLServlet mapped to [/graphql/*]
2018-12-02 19:23:57.545 INFO [venus,,,] 1 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet zuulServlet mapped to [/zuul/*]
2018-12-02 19:23:58.037 INFO [venus,,,] 1 --- [ main] o.f.core.internal.util.VersionPrinter : Flyway Community Edition 5.0.7 by Boxfuse
2018-12-02 19:23:58.052 INFO [venus,,,] 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-12-02 19:23:58.577 WARN [venus,,,] 1 --- [ main] unknown.jul.logger : SQLException occurred while connecting to mydbserver.postgres.database.azure.com:5432
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "40.12.13.14", user "postgres", database "mydb", SSL on
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:473)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:205)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:452)
at org.postgresql.Driver.connect(Driver.java:254)
I don't know where this external IP reference is coming from. I do have a couple of public IPs defined for my cluster but neither one match this 40.12.13.14 address. If I create a firewall rule in my server settings, thisexception goes away and my microservices have no trouble accessing their databases.
If this rule is needed I can obviously add it. The problem is the cluster is created via a Python deployment script and it can't create a firewall for this IP address since it doesn't know what this address is going to be until an exception occurs. Each time I run my deplyoyment script to create a new cluster, the IP address reported in this exception changes.
Does anyone know what this IP address is associated with and how I can determine what it's going to be so I can create the required firewall rule?
Peter