5.1.2 Upgrade to the Latest Enterprise Edition in Kubernetes Cluster

Run these steps to upgrade to the latest release of Transaction Manager for Microservices Enterprise Edition only if you use Oracle Database to store the transaction logs in the previous release. Run these steps on Kubernetes clusters in Kubernetes and OpenShift platforms.

The MicroTx coordinator runs in the main container. As part of the upgrade process, MicroTx creates a Kubernetes init container. The Kubernetes init container is a specialized container that runs in a pod. The Kubernetes init container starts, completes the prerequisite steps for the upgrade, upgrades the MicroTx coordinator, and then terminates when it finishes the upgrade. It uses the MicroTx image that the main container also uses. See https://kubernetes.io/docs/concepts/workloads/pods/init-containers/.

Do not use the instructions in this section in the following scenarios:

  • if you used etcd or internal memory to store the transaction logs in a previous release of Transaction Manager for Microservices Enterprise Edition.
  • if you want to upgrade to the latest release of MicroTx Free.
  • if you want to upgrade MicroTx in Docker or Docker Swarm. Docker does not support the init container functionality, which is available only in Kubernetes cluster. To upgrade in Docker environments, you must run the init process in an independent container. See Upgrade to the Latest Enterprise Edition in Docker or Upgrade to the Latest Enterprise Edition in Docker Swarm.
To upgrade to Transaction Manager for Microservices 24.2 Enterprise Edition:
  1. Grant privileges to create and run stored procedures to the data store user. Perform this task only if you use Oracle Database as the data store. See Grant Privilege to Run Stored Procedures.
  2. Ensure that you have the following required privileges to perform this task if you are not a database administrator.
    • EXECUTE
    • INSERT
    • SELECT
    • UPDATE
    • DELETE
    • CREATE
    • ALTER

    MicroTx uses these privileges to handle the upgrade.

  3. Download the files to install the latest release of MicroTx. See Download the Installation Bundle.

    Ensure that you do not overwrite the installer files for earlier versions of MicroTx.

    The latest image of the transaction coordinator is available at installation_directory/otmm-24.2/otmm/image/tmm-24.2.tgz. In the next steps, you will use this file to update the existing transaction coordinator image.

  4. Load the transaction coordinator image to the local repository, tag the image, and then push the image. See Push Images to a Remote Docker Repository.
  5. Create a copy of the values.yaml file and name it as values1.yaml. Update the values1.yaml file with the name of the latest transaction coordinator image in the repository. If you want to use the latest features, complete the required tasks to use these features, and then update the YAML file with the property values. See Configure the values.yaml File.
  6. Update the property values for the Kubernetes init container in the tcs.yaml file, which is located at installation_directory/otmm-24.2/otmm/image/tcs.yaml. Use this file as a reference when you create your own Helm Chart to upgrade MicroTx. The following code snippet provides sample values. Provide the values based on your environment.
    {{- if .Values.tmmConfiguration.storage.db }}
          {{- if eq .Values.tmmConfiguration.storage.type "db" }}
          initContainers:
            - name : {{ printf "init-%s" .Values.tmmConfiguration.tmmAppName }}
              image: {{ .Values.tmmImage.image }}
              securityContext:
                runAsUser: 1337
              volumeMounts:
                - name: config-volume
                  mountPath: /etc/config
                {{- if .Values.tmmConfiguration.storage.db.walletConfigMap.configMapName }}
                - name: wallet-volume
                  mountPath: /etc/config/dbwallet
                {{- end }}
              env:
                - name: CONFIG_MAP_PATH
                  value: /etc/config
                - name: INIT_CONTAINER_ENABLED
                  value: "True"
                {{- if .Values.tmmConfiguration.storage.db.credentialSecretName }}
                - name: STORAGE_DB_CREDENTIAL
                  valueFrom:
                    secretKeyRef:
                      key: secret
                      name: {{ .Values.tmmConfiguration.storage.db.credentialSecretName }}
                {{- end }}
          {{- end }}
          {{- end }}
    Parameters Description
    securityContext:
                runAsUser: 1337
    When you use a Kubernetes init container with an Istio service mesh, the Kubernetes init container cannot send any outgoing network calls as Istio does not support it. To enable the Kubernetes init container to send outgoing network calls, you must specify the security context. See https://istio.io/latest/docs/setup/additional-setup/cni/#compatibility-with-application-init-containers.
    INIT_CONTAINER_ENABLED Set this to True to enable the creation of a Kubernetes init container.
  7. Run the following command to complete the upgrade.

    Syntax

    helm upgrade <release name> --namespace <namespace> <chart directory> --values <path_to_updated_values.yaml>

    The following sample command upgrades the MicroTx application named tmm-app in the otmm namespace.

    helm upgrade tmm-app --namespace otmm tmm/ --values tmm/ee/values1.yaml

    Where,

    • tmm-app is the name of the MicroTx application.
    • otmm is the namespace in Kubernetes cluster, where you have installed MicroTx.
    • installation_directory/otmm-24.2/otmm/helmcharts/tmm is the folder that contains the chart.yaml file for MicroTx.
    • installation_directory/otmm-24.2/otmm/helmcharts/tmm/ee/values1.yaml is the location of the values1.yaml file, the application's updated manifest file, in your local machine. This file contains the updated deployment configuration details for MicroTx.