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.

About this task

It contains information, such as the user name and password to access the database, MongoDB host name and more.

Procedure

  1. 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 the Configuring MongoDB for Sametime topic, rs0 is the replica set value used in the topic.
  2. 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.
  3. Change to the helm/templates directory where the templates are located.
  4. Open the sametime-secrets.yaml file for editing.
  5. Locate the MongoConnectionUrl: setting in the file. Replace the existing setting value with the updated base64 encoded value.
  6. Save and close the sametime-secrets.yaml file.
  7. 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.
  8. Press i to edit the secret.
  9. Locate the MongoConnectionUrl: setting. Replace the existing value with the updated base64 encoded value.
  10. Press wq! to save the secret.
  11. 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.
    1. 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
      
    2. Run the following command to scale the pod to one.
      
      kubectl scale deploy pod_deployment_name --replicas=1

What to do next

For more information on Secrets see the topic: https://help.hcltechsw.com/sametime/1201/admin/managing_secrets_kubernetes.html