How to create a RabbitmqCluster with an existing username and password stored in a Kubernetes secret? #1875
-
This way can create a cluster with default credential: apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: hello-world But I want to use my own username and password: apiVersion: v1
kind: Secret
metadata:
name: rabbitmq-user-secret
type: Opaque
stringData:
default_user: myuser
default_pass: mypassword How to set them in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you create the secret first (using the same name and structure of a secret that the Operator would generate), it will be used. So the easiest option is to simply create the secret before you create RabbitmqCluster. You can also tell the Operator explicitly that you will generate the secret yourself: https://github.com/rabbitmq/cluster-operator/tree/main/docs/examples/external-admin-secret-credentials Other options include: Or import definitions, over HTTPS or from a file (Secret): https://www.rabbitmq.com/docs/definitions#import-on-boot. |
Beta Was this translation helpful? Give feedback.
If you create the secret first (using the same name and structure of a secret that the Operator would generate), it will be used. So the easiest option is to simply create the secret before you create RabbitmqCluster.
You can also tell the Operator explicitly that you will generate the secret yourself: https://github.com/rabbitmq/cluster-operator/tree/main/docs/examples/external-admin-secret-credentials
This way you can create it after the cluster is created.
Other options include:
Use https://github.com/rabbitmq/messaging-topology-operator to define a user. The default user with random credentials will still exist, but you can have an additional one with your credentials.
Or import defin…