Upgrade the TimesTen Operator

You can upgrade the TimesTen Operator to a new release. You can perform the upgrade while there are TimesTenClassic or TimesTenScaleout objects deployed in your namespace.

To upgrade the TimesTen Operator in your namespace, use the ttoperator chart from the new release.

This example upgrades from TimesTen release 22.1.1.19.0 to 22.1.1.20.0. For more information about TimesTen releases, see Overview of release numbers in the Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

Let's assume you previously created the new_kube_files directory and unpacked the new release of the TimesTen Operator distribution into this directory.

The ttoperator chart contains all the information necessary to upgrade the TimeTen Operator in your namespace. The chart contains a default configuration for deploying a new release of the TimesTen Operator. In addition, if the default container image is not the image you want to upgrade to, you can modify the ttoperator's chart default image variable to reference your new container image. For example, if the default container image for the new release is container-registry.oracle.com/timesten/timesten/22.1.1.20.0 and instead you want to use your newly built phx.ocir.io/youraccount/tt2211200image:2 container image, you modify the image variable as follows:
image: 
  repository: phx.ocir.io/youraccount/tt2211200image
  tag: "2"

Let's walk through an example illustrating how to upgrade the TimesTen Operator to a new release. In the example, let's assume you want to use your phx.ocir.io/youraccount/tt2211200image:2 container image.

The example uses a customized YAML file to define the container image that contains the new release. Let's assume you have previously created a new_kube_files/helm/customyaml directory for your customized YAML files.

  1. Verify the TimesTen Operator that is deployed in your namespace is running the expected image.

    Review Pods.

    kubectl get pods                            NAME                                  READY   STATUS    RESTARTS   AGE
    samplettc-0                           3/3     Running   0          14h
    samplettc-1                           3/3     Running   0          14h
    timesten-operator-65ddf9cfbb-jkqbn    1/1     Running   0          15h
    

    Verify the TimesTen Operator is running the expected image.

    kubectl get pod timesten-operator-65ddf9cfbb-jkqbn -o yaml | grep image

    Output.

        image: phx.ocir.io/youraccount/tt2211190image:1
        imagePullPolicy: Always
    ...

    The TimesTen Operator is running the expected image. See Install the TimesTen Operator.

  2. On your development host, change to the helm directory of the new release.
    cd new_kube_files/helm

    This directory contains the new release of the charts. For more information about the helm directory, see Set Up the Environment.

  3. Create a YAML file that references the new container image.
    vi customyaml/upgradeoperator.yaml
    
    image:
      repository: phx.ocir.io/youraccount/tt2211200image
      tag: "2"
    imagePullSecrets:
      - name: sekret
    The customizations are as follows:
    • Since the container image you built and want to use for the upgrade is phx.ocir.io/youraccount/tt2211200image:2, the value of the repository variable is phx.ocir.io/youraccount/tt2211200image and the value of the tag variable is 2.

    • The image pull Secret is sekret.

  4. Confirm the name of the TimesTen Operator release.
    helm list
    Output.
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    samplettc       mynamespace     1               2023-10-23 23:18:03.740512897 +0000 UTC deployed        ttclassic-2211190.1.0   22.1.1.19.0
    samplettop      mynamespace     1               2023-10-23 23:04:40.492890589 +0000 UTC deployed        ttoperator-2211190.1.0  22.1.1.19.0
    ttcrd           mynamespace     2               2023-10-24 16:00:21.530832896 +0000 UTC deployed        ttcrd-2211200.1.0       22.1.1.20.0

    The helm list command shows the samplettop release exists and is installed in your namespace. For more information about installing the TimesTen Operator, see Install the TimesTen Operator.

  5. Upgrade the TimesTen Operator to the new release. To upgrade the TimesTen Operator, use the ttoperator chart from the new release and use the customized YAML file that references the new image.
    helm get values samplettop --all > prev-values-ttop.yaml && helm upgrade -f prev-values-ttop.yaml -f customyaml/upgradeoperator.yaml  samplettop ./ttoperator 
    Let's look at this helm upgrade command:
    • The get values samplettop Helm command retrieves the values for the current release, including existing customizations. The result of this command is piped into the prev-values-ttop.yaml file. You can choose any name for this file.

    • The helm upgrade command uses the prev-values-ttop.yaml file with the customized upgradeoperator.yaml file to do the upgrade.

    Note:

    We recommend this syntax. This ensures existing customizations are preserved.

    Let's look at the output from the helm upgrade command.

    Release "samplettop" has been upgraded. Happy Helming!
    NAME: samplettop
    LAST DEPLOYED: Tue Oct 24 16:15:21 2023
    NAMESPACE: mynamespace
    STATUS: deployed
    REVISION: 2
    NOTES:
    Version 2211200.1.0 of the ttoperator chart has been installed.
    
    This release is named "samplettop".
    
    To learn more about the release, try:
    
      $ helm status samplettop
      $ helm get all samplettop
      $ helm history samplettop
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback samplettop <REVISION>
        - run 'helm history samplettop' for a list of revisions.
    
    To test the operator, run:
    
      $ helm test samplettop
    Note the following:
    • The samplettop release is upgraded. The release revision is 2.

    • The status of the release is deployed.

    • The ttoperator chart version is 2211200.1.0 corresponding to the 22.1.1.20.0 TimesTen release.

  6. Verify the TimesTen Operator is running in your namespace.
    kubectl get pods
    NAME                                  READY   STATUS    RESTARTS   AGE
    samplettc-0                           3/3     Running   0          17h
    samplettc-1                           3/3     Running   0          17h
    timesten-operator-767b8f9477-l297n    1/1     Running   0          2m53s
  7. Verify the TimesTen Operator is running the new image.
     kubectl get pod timesten-operator-767b8f9477-l297n -o yaml | grep image
    

    Output.

        image: phx.ocir.io/youraccount/tt2211200image:2
        imagePullPolicy: Always
    ...

    The TimesTen Operator is running the new image.

  8. (Optional): Test the ttoperator release.
     helm test samplettop

    Output.

    NAME: samplettop
    LAST DEPLOYED: Tue Oct 24 16:15:21 2023
    NAMESPACE: mynamespace
    STATUS: deployed
    REVISION: 2
    TEST SUITE:     samplettop-ttoperator-test
    Last Started:   Tue Oct 24 16:32:15 2023
    Last Completed: Tue Oct 24 16:32:18 2023
    Phase:          Succeeded
    NOTES:
    Version 2211200.1.0 of the ttoperator chart has been installed.
    
    This release is named "samplettop".
    
    To learn more about the release, try:
    
      $ helm status samplettop
      $ helm get all samplettop
      $ helm history samplettop
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback samplettop <REVISION>
        - run 'helm history samplettop' for a list of revisions.
    
    To test the operator, run:
    
      $ helm test samplettop

    The test succeeded.

Congratulations! You successfully upgraded the ttoperator chart. The TimesTen Operator that is running in your namespace is using the new image.