title: Google Kubernetes Engine Spring Boot App Cant Connect To Database Within Same Network
body: <p>I have a spring boot app deployed to GKE in the us-central1 region. There is a postgres database that runs on a compute engine VM instance. Both are a part of the 'default' VPC network. I can ping this database by its hostname from within one of the GKE pods. However when the spring boot app launches and attempts connection to the database using the same hostname like so in the properties file, I get a connection timeout error and the app fails to startup:</p>
  <p><code>spring.datasource.url=jdbc:postgresql://database01:5432/primary</code></p>
  <p>We have similar connections to this database from other VM instances that work fine. There is aalso a similar setup with Kafka and the app is also unable to resolve the broker hostnames. What am I missing?</p>