3.6.5 Create a Kubernetes Secret for Oracle Database Credentials

MicroTx Distributed Transactions and MicroTx Workflows support using Oracle Database as a persistent store to keep track of logs, metadata, and other operation details.

You must provide the Oracle Database credentials secret in the values.yaml file. MicroTx uses the credentials secret to establish a connection to the database after the service is installed.
If you are using an Autonomous Database instance, ensure that you have downloaded the wallet and created a configuration map before you begin with the following steps. See Get Autonomous Database Client Credentials.

Create a Kubernetes secret for MicroTx Workflows

To create a Kubernetes secret for MicroTx Workflows with the Oracle Database login details:

  1. Launch a terminal and enter the following commands to base64 encode the client ID and client secret.
    echo -n "database_username" | base64 -w 0 
    echo -n "database_password" | base64 -w 0 

    Replace database_username and database_password with the values in your environment.

    Note:

    For Linux, add -w 0 to the command to remove line breaks.
    The base64 encoded value of the database username and password is returned. Note down these values as you will need it later.
  2. Paste the following code in any text editor.
    apiVersion: v1
    kind: Secret
    metadata:
      name: oracledb-credentials-workflow
    type: Opaque
    data:
      username: base64_encoded_database_username
      password: base64_encoded_database_password

    Where,

    • oracledb-credentials-workflow is the name of the Kubernetes secret that you want to create. Note down this name as you will have to provide it later in the values.yaml file.
    • base64_encoded_database_username and base64_encoded_database_password are the base64 encoded values of database username and password that you have generated in the previous step. Replace these with values specific to your environment.
  3. Save the file as a YAML file. For example, oracledb-secret.yaml.
  4. Run the following command to create a Kubernetes secret in the namespace where you want to install MicroTx.

    Command syntax

    kubectl apply -f <filename> -n <namespace>

    The following sample command creates a Kubernetes secret with the name oracledb-credentials-workflow in the otmm namespace with the details that you have provided in the oracledb-secret.yaml file.

    kubectl apply -f oracledb-secret.yaml -n otmm
  5. Note down the name of the Kubernetes secret, oracledb-credentials-workflow, that you have created. You will need to provide this name in the values.yaml file while deploying MicroTx Workflows.

Create a Kubernetes secret for MicroTx Distributed Transactions

To create a Kubernetes secret for MicroTx Distributed Transactions with the Oracle Database login details:

  1. Create a Kubernetes secret with the Oracle Database login details. Ensure that you create the Kubernetes secret in the namespace where you want to deploy MicroTx Distributed Transactions.

    The following command creates a Kubernetes secret with the name db-secret in the otmm namespace with the password of user acme. When you run this command in your environment, replace these values with values specific to your environment.

    kubectl create secret generic db-secret \
        --from-literal=secret='{"password":"*****", "username":"acme"}' -n otmm
  2. Note down the name of the Kubernetes secret that you have created. You will need to provide this name in the values.yaml file while deploying MicroTx Distributed Transactions.
Update the values.yaml with the name of the Kubernetes secret that you have created to store the Oracle Database credentials and the connection string. Additionally, provide the name of the configuration map if you are using an Autonomous Database instance.