I am able to run helm, postgresql chart without any dependencies by using the below command
helm install --name my-release \
--set postgresqlPassword=secretpassword,postgresqlDatabase=my-database \
stable/postgresql
But, when i run with a requirements.yaml file i am running out issues. Below is the snippet
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 3.7.1
i have added the env variable in deployment.yaml file
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: POSTGRES_HOST
value: {{ template "postgresql.fullname" . }}
- name: POSTGRES_PORT
value: "5432"
- name: POSTGRES_USERNAME
value: {{ default "" .Values.postgresql.postgresqlUsername | quote }}
- name: POSTGRES_PASSWORD
value: {{ default "" .Values.postgresql.postgresqlPassword | quote }}
- name: POSTGRES_DATABASE
value: {{ default "" .Values.postgresql.postgresqlDatabase | quote }}
ports:
- containerPort: {{ .Values.service.internalPort }}
Added the values according to environmental variables declared in deployment.yaml file
postgresql:
POSTGRES_DATABASE: ******
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: password
When i use helm install command
helm install <chart-name>/ --name *** --set postgresqlDatabase=*****,postgresqlPassword=password
i am getting the following error as
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:473) ~[postgresql-42.2.2.jar!/:42.2.2]
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:205) ~[postgresql-42.2.2.jar!/:42.2.2]
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.2.jar!/:42.2.2]
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) ~[postgresql-42.2.2.jar!/:42.2.2]
at org.postgresql.Driver.makeConnection(Driver.java:452) ~[postgresql-42.2.2.jar!/:42.2.2]
at org.postgresql.Driver.connect(Driver.java:254) ~[postgresql-42.2.2.jar!/:42.2.2]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117) ~[HikariCP-2.7.8.jar!/:na]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:123) ~[HikariCP-2.7.8.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:365) ~[HikariCP-2.7.8.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:194) ~[HikariCP-2.7.8.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:460) ~[HikariCP-2.7.8.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:534) ~[HikariCP-2.7.8.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-2.7.8.jar!/:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-2.7.8.jar!/:na]
at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:51) ~[flyway-core-5.0.7.jar!/:na]
... 91 common frames omitted
I am not sure how to assign the password for dependency postgresql. Is there a way to connect with postgres database.