<p>I am new to Kubernetes, and trying to set up Rundeck (3.3.5) on it.
The image has been installed correctly.
However when I added a Postrges database on AWS RDS, it's unable to connect to it.
I am able to connect to the database by using the same URL and port number with DBeaver though.
Below is the detailed information of the Error and the yaml.
Any help in this regard is highly appreciated.</p>
<p>Error:</p>
<pre><code>[2020-10-29T19:02:47,013] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLException: Driver:org.postgresql.Driver@18918d70 returned null for URL:jdbc:postgres://xxx.amazonaws.com:5432/RUNDECK
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:338) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:744) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:676) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:483) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.&lt;init&gt;(ConnectionPool.java:154) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131) ~[tomcat-jdbc-9.0.31.jar!/:?]
        at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:412) ~[spring-jdbc-5.1.18.RELEASE.jar!/:5.1.18.RELEASE]
</code></pre>
<p>Yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: rundeck
  name: test-rundeck
  namespace: testops
spec:
  replicas: 1
  strategy: {}
  selector:
    matchLabels:
      app: rundeck
  template:
    metadata:     
      labels:
        app: rundeck
    spec:
      containers:
      - env:        
        - name: JVM_MAX_RAM_PERCENTAGE
          value: &quot;75&quot;
        - name: RUNDECK_GRAILS_URL
          value: http://xxx.us-east-1.elb.amazonaws.com:4440/rundeck
        - name: RUNDECK_SERVER_CONTEXTPATH
          value: /rundeck
        - name: RUNDECK_DATABASE_URL
          value: jdbc:postgres://xxx.us-east-1.rds.amazonaws.com:5432/RUNDECK
        - name: RUNDECK_DATABASE_DRIVER
          value: org.postgresql.Driver
        - name: RUNDECK_DATABASE_USERNAME
          value: postgres
        - name: RUNDECK_DATABASE_PASSWORD
          value: postgres123
        image: rundeck/rundeck:3.3.5-20201019
        imagePullPolicy: Always
        name: rundeck
        resources:
          limits:
            memory: 1Gi    
        volumeMounts:
        - mountPath: &quot;/opt/test/mnt&quot;
          name: testops-pv
      volumes:
        - name: testops-pv
          persistentVolumeClaim:
            claimName: testops-pvc    
      restartPolicy: Always
status: {}
</code></pre>

<h2>Issue</h2>
<p>The <code>jdbc:postgres</code> url is incorrect.</p>
<h2>Solution</h2>
<p>As mentioned <a href="https://stackoverflow.com/a/42721150/11977760">here</a> and mentioned by @MegaDrive68k in the comments you should use <code>jdbc:postgresql</code> instead of <code>jdbc:postgres</code>.</p>
<p>There is rundeck <a href="https://docs.rundeck.com/docs/administration/configuration/database/postgres.html#configure-rundeck" rel="nofollow noreferrer">documentation</a> about that.</p>
