cluster-operator icon indicating copy to clipboard operation
cluster-operator copied to clipboard

user secret not updated when creating cluster with default_user config

Open heimdull opened this issue 3 years ago • 8 comments

Describe the bug

When using the default_user/default_pass the kubernetes secret is not updated. When using the messaging-topology-operator with a set default_user you will get a 401 because it looks at the secret.

To Reproduce

Steps to reproduce the behavior: deploy cluster with this additionalConfig:

spec: rabbitmq: additionalConfig: | default_user=guest default_pass=guest

Expected behavior secret is used by other operators so it needs to be updated

Version and environment information

latest operator

heimdull avatar Apr 17 '22 16:04 heimdull

@heimdull This is a known limitation with the operator. I could treat this as a feature request and discuss with the rest of the team.

Meanwhile, for a workaround, you could either update the secret manually yourself after the rmq is created. Alternatively, you can create a default user secret first with the expected username and password before you create the rabbitmqcluster. For example, if your rabbitmqcluster name is sample, you can create a secret, in the same namespace called sample-default-user:

apiVersion: v1
kind: Secret
metadata:
  name: sample-default-user
type: Opaque
stringData:
  username: guest-user
  password: guest-pass
  default_user.conf: |
    default_user = guest-user
    default_pass = guest-pass

Then you can create the rabbitmqcluster. There is no need to set the username&password in the rmq manifest with this approach.

ChunyiLyu avatar Apr 26 '22 08:04 ChunyiLyu

Waiting for response from issue creator, was this workaround suitable for them?

ablease avatar May 03 '22 08:05 ablease

This works for us. After discovering your other operator that could create users we used that to generate the users we needed.

heimdull avatar May 03 '22 12:05 heimdull

@heimdull thanks for replying. I will close this issue for now.

ChunyiLyu avatar May 04 '22 09:05 ChunyiLyu

Re-opening so that this feature can be planned at some point.

lukebakken avatar Apr 22 '24 14:04 lukebakken

Re-opening so that this feature can be planned at some point.

It would be nice

piotrlaczykowski avatar Apr 26 '24 10:04 piotrlaczykowski