<p>I am facing this error from kubernetes cluster. Though it works perfectly from my local server. Here is my application.yml of SpringBoot App</p>
<h1>spring:</h1>
<pre><code>datasource:
    dataSourceClassName: org.postgresql.ds.PGPoolingDataSource
    url: jdbc:postgresql://${POSTGRES_HOST}:5432/test_db
    databaseName: test_db
    poolName: SpringBootHikariCP
    username: ${POSTGRES_USER}
    password: ${POSTGRES_PASSWORD}
    testWhileIdle: true
    validationQuery: SELECT 1
jpa:
    database-platform: org.hibernate.dialect.PostgreSQL82Dialect
    openInView: false
    show_sql: true
    generate-ddl: true
    hibernate:
        ddl-auto: update
        naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
        use-new-id-generator-mappings: true
    properties:
        hibernate.cache.use_second_levelt_cache: false
        hibernate.cache.use_query_cache: false
        hibernate.generate_statistics: true
        hibernate.hbm2ddl.auto: validate
</code></pre>
<p>Here is my Hikari configuration.</p>
<pre class="lang-java prettyprint-override"><code>            HikariConfig config = new HikariConfig();
            config.setDataSourceClassName(dataSourceClassName);
            config.addDataSourceProperty(&quot;url&quot;, url);
            config.addDataSourceProperty(&quot;user&quot;, user);
            config.addDataSourceProperty(&quot;password&quot;, password);

            return new HikariDataSource(config);
</code></pre>
<p>I have checked DB connectivity of kubernetes without Hikari and it works perfectly. So there is no issue with connectivity.
Please help me regarding the issue. I am stuck with this for couple of days.
Thank you</p>

shawon
<p><code>${POSTGRES_HOST}</code> is expecting a <a href="https://stackoverflow.com/questions/35531661/using-env-variable-in-spring-boots-application-properties">system environment variable</a> that you probably missing in the specific machine, add it for example:</p>

<pre><code>export POSTGRES_HOST="1.1.1.1"
</code></pre>
