3.5.4 Create a Secret with Cookie Encryption Password for OpenShift

The MicroTx console requires the session cookie to be encrypted, so you must provide the cookie encryption password through a Kubernetes secret in OpenShift environments.

To encrypt the MicroTx console session cookie, create a Kubernetes secret with the cookie encryption password:
  1. In the OpenShift environment, switch to project where you want to deploy MicroTx.
    oc project otmm

    Where, otmm is the name of the project that you have created. See Install the Required Software for OpenShift.

  2. Launch a terminal and enter the following commands to base64 encode the cookie encryption password.
    echo -n "cookie-encryption-password" | base64 -w 0 

    Replace cookie-encryption-password with a password of your choice.

    Note:

    For Linux, add -w 0 to the command to remove line breaks.
    The base64 encoded value of the password is returned. Note down this value as you will need it later.
  3. Paste the following code in any text editor.
    apiVersion: v1
        kind: Secret
        metadata:
          name: console-cookie-encryption-password-secret
        type: Opaque
        data:
          secret: base64_encoded_cookieEncryptionPassword

    Where,

    • console-cookie-encryption-password-secret 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_cookieEncryptionPassword is the base64 encoded value of the password that you have generated in the previous step.
  4. Save the file as a YAML file. For example, cookieEncryptionPassword.yaml in the tmm-istio-openshift/resources folder.
  5. Run the following command to create a Kubernetes secret in the project where you want to install MicroTx.

    Command syntax

    oc apply -f <filename>

    The following sample command creates a Kubernetes secret with the name console-cookie-encryption-password-secret with the details that you have provided in the cookieEncryptionPassword.yaml file.

    oc apply -f tmm-istio-openshift/resources/cookie-encryption-secret.yaml
Note down the name of the secret, console-cookie-encryption-password-secret. You'll provide this name as the value for the tmmConfiguration.tmmConsoleConfiguration.cookieEncryptionPasswordSecretName property in the values.yaml file.