Changing MongoDB credentials in Sametime for Kubernetes and Openshift
A connection URL is used to configure the Sametime and MongoDB connection. The connection URL tells Sametime how to connect to your MongoDB.
It contains information, such as the user name and password to access the database, MongoDB host name and more.
-
Locate the MongoDB connection URL.
For information on the connectoin URL, see Connection String URI Format topic in the MongoDB documentation.
The MongoDB details are located in the string in the following format:
mongodb://sametime\_user:mongodb\_password@mongodb\_host:port/?replicaSet=replica\_set
- sametime_user is the MongoDB user.
- mongodb_password is the password used by the MongoDB user.
- mongodb_host is the fully qualified host name of the MongoDB server.
- port is the port number used by MongoDB
- replica_set is the replica set configured by MongoDB. If you followed the steps in Configuring MongoDB for Sametime, rs0 is the replica set value used in the topic.
-
After you have the MongoDB connection URL, run the following command to convert the connection URL to base64 encode value.
echo -n connection\_url | base64
Where connection_url is the MongoDB connection URL.
-
Change to the helm/templates directory where the templates are located.
-
Open the sametime-secrets.yaml file for editing.
-
Locate the
MongoConnectionUrl:
setting in the file. Replace the existing setting value with the updated base64 encoded value. -
Save and close the sametime-secrets.yaml file.
-
Update the URL in the live configuration by editing the
sametime-global-secrets
secret.kubectl edit secret sametime-global-secrets
Note: If you have a namespace dedicated to Sametime, add the -n argument with your namespace to ensure it is created in the correct namespace.
-
Press i to edit the secret.
-
Locate the
MongoConnectionUrl:
setting. Replace the existing value with the updated base64 encoded value. -
Press wq! to save the secret.
-
Restart the pods with the changes. Use the kubectl scale command to scale the pods to zero and then to one that have been changed. You must run the commands for each pod that the change affects.
-
Run the following command to scale the pod to zero.
Scale the pod to zero, where pod_deployment_name is the pod name.
kubectl scale deploy pod\_deployment\_name --replicas=0
-
Run the following command to scale the pod to one.
kubectl scale deploy pod\_deployment\_name --replicas=1
-
For more information, see Managing secrets in Kubernetes.
Parent Topic: MongoDB