3.5.3 Create a Secret with Cookie Encryption Password for Kubernetes

In Kubernetes environment, the MicroTx console requires the session cookie to be encrypted. You must provide a cookie encryption password through a Kubernetes secret.

To encrypt the MicroTx console session cookie, create a Kubernetes secret with the cookie encryption password:
  1. 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.
  2. 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.
  3. Save the file as a YAML file. For example, cookieEncryptionPassword.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 console-cookie-encryption-password-secret in the otmm namespace with the details that you have provided in the cookieEncryptionPassword.yaml file.

    kubectl apply -f cookieEncryptionPassword.yaml -n otmm
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.