CrunchyData / postgres-operator

Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
https://access.crunchydata.com/documentation/postgres-operator/v5/
Apache License 2.0
3.96k stars 593 forks source link

User is not being created from kubernetes secret #4030

Open batulziiy opened 2 weeks ago

batulziiy commented 2 weeks ago

Overview

I'm experiencing a strange issue that postgres user is not being created from kubernetes secret. It was working fine for the last few months and there are several users created in this way, but when I tried to create another user recently it didn't work. First I thought there should be something wrong with kustomization as it's the approach used for automation. However, found that secret is already created correctly in Kubernetes cluster while the actual db user is not created on the database.

Environment

Please provide the following details:

Steps to Reproduce

REPRO

Provide steps to get to the error condition:

  1. Create a new user via kustomization by adding user: username format in PostgresCluster definition yaml.
  2. Wait for CD tool to reconcile the change from git to kubernetes cluster.
  3. Check if the user is created on the database.

EXPECTED

  1. Expecting the user is created on the database same as kube secret.

ACTUAL

  1. Even though kubernetes secret is created in kubernetes, the actual user doesn't exist on the database.

Logs

Haven't found any logs related to the user creation in both db log, kustomization controller log, kubernetes event and pod log.

Additional Information

Please provide any additional information that may be helpful.