Skip to content

PostgreSQL with existing secret broken after update 4.0.0 #445

@archer-321

Description

@archer-321

Describe your Issue

Setting postgresql.global.postgresql.auth.existingSecret and the secret keys in postgresql.global.postgresql.auth.secretKeys doesn't work after update 4.0.0.

Trying to deploy Nextcloud with the configuration below returns PASSWORDS ERROR: The secret "postgres-creds" does not contain the key "password" instead.

Steps to reproduce:

  1. Create values.yml and secret.yml with the below content.
  2. Create a new namespace: kubectl create namespace nextcloud
  3. Create the secret: kubectl apply -f secret.yml
  4. Try to deploy any version >=4.0.0: helm install -n nextcloud -f values.yml albacore nextcloud/nextcloud --version=4.0.0

Version 3.5.22 works as expected.

Logs and Errors

> helm install -n nextcloud -f values.yml albacore nextcloud/nextcloud --version=4.0.0

Error: INSTALLATION FAILED: execution error at (nextcloud/charts/postgresql/templates/secrets.yaml:23:16):
PASSWORDS ERROR: The secret "postgres-creds" does not contain the key "password"

Describe your Environment

  • Kubernetes distribution:
    Tested with a fresh multi-node minikube cluster and a production cluster maintained with kubeadm

  • Helm Version (or App that manages helm): 3.12.0

  • Helm Chart Version: 4.0.0 and above

  • values.yml:

ingress:
  enabled: true
externalDatabase:
  enabled: true
  type: postgresql
  host: albacore-postgresql-0:5432
  user: nextcloud
  database: nextcloud
  existingSecret:
    # Both, `true` and `false` for this value don't work.
    enabled: false
    secretName: postgres-creds
    passwordKey: user
internalDatabase:
  enabled: false
postgresql:
  enabled: true
  global:
    postgresql:
      auth:
        existingSecret: postgres-creds
        secretKeys:
          adminPasswordKey: admin
          userPasswordKey: user
          replicationPasswordKey: replication
  • secret.yml (for testing purposes):
apiVersion: v1
data:
  admin: Zm9v
  replication: YmF6
  user: YmF6
kind: Secret
metadata:
  name: postgres-creds
  namespace: nextcloud
type: Opaque

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalDatabaseTopics related to external databases, such as mariaDB or PostgreSQL

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions