Upgrade the TimesTen Operator

You can upgrade the TimesTen Operator while there are TimesTenClassic objects running in your namespace. To upgrade the TimesTen Operator in your namespace, use the new release of the ttoperator chart.

The upgrade process requires you to complete the following steps:
  • Create a new YAML file. In this file, you specify the container image that contains the new release of TimesTen.

  • Use the helm get values command for the upgrade. The example shows you how to do this.

The example assumes you have created a new_kube_files/helm/customyaml directory.

  1. On your development host, change to the helm directory that contains the new Helm charts.
    cd new_kube_files/helm
  2. Create a YAML file and in it specify the name of the TimesTen image you want to use for the upgrade.
    vi customyaml/upgradeoperator.yaml
    
    image:
      repository: container-registry.oracle.com/timesten/timesten
      tag: "22.1.1.28.0"
  3. Before the upgrade, do the following:
    1. Verify that the TimesTen Operator is running.
      kubectl get pods

      The output is the following:

      
      NAME                              READY   STATUS    RESTARTS   AGE
      norepsamplehelm-0                 3/3     Running   0          6h19m
      norepsamplehelm-1                 3/3     Running   0          6h19m
      norepsamplehelm-2                 3/3     Running   0          6h19m
      repsamplehelm-0                   3/3     Running   0          9h
      repsamplehelm-1                   2/3     Running   0          9h
      timesten-operator-55c6f99-zqlct   1/1     Running   0          2d21h
    2. Confirm the image that the TimesTen Operator is running.
      kubectl describe deployment timesten-operator | grep Image

      The output is the following:

      Image:       container-registry.oracle.com/timesten/timesten:22.1.1.27.0
    3. Confirm the state of the TimesTenClassic objects.
      kubectl get ttc

      The output is similar to the following:

      NAME              STATE              ACTIVE            AGE
      norepsamplehelm   AllReplicasReady   N/A               6h28m
      repsamplehelm     Normal             repsamplehelm-0   9h
      

      The TimesTenClassic objects and associated databases are functioning properly.

  4. Confirm the Helm chart release.
    helm list
    The output is similar to the following:
    
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    ...
    ttoper          default         1               2024-08-02 02:54:39.916210368 +0000 UTC deployed        ttoperator-2211270.1.0  22.1.1.27.0
  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.

    Note:

    We recommend this syntax. This ensures existing customizations are preserved.
    helm get values ttoper --all > prev-values-ttop.yaml
    helm upgrade -f prev-values-ttop.yaml -f customyaml/upgradeoperator.yaml  ttoper ./ttoperator
    Let's look at this helm upgrade command:
    • The get values ttoper 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. Specifically, the values in the prev-values-ttop.yaml file are used except when overridden by the values in the customized upgradeoperator.yaml file. The upgradeoperator.yaml file takes precedence over the prev-values-ttop.yaml file since it was listed last on the command line.

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

    Release "ttoper" has been upgraded. Happy Helming!
    NAME: ttoper
    LAST DEPLOYED: Mon Aug  5 00:20:34 2024
    NAMESPACE: default
    STATUS: deployed
    REVISION: 2
    NOTES:
    Version 2211280.1.0 of the ttoperator chart has been installed.
    
    This release is named "ttoper".
    
    To learn more about the release, try:
    
      $ helm status ttoper
      $ helm get all ttoper
      $ helm history ttoper
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback ttoper <REVISION>
        - run 'helm history ttoper' for a list of revisions.
    
    To test the operator, run:
    
    Note the following:
    • The ttoper release is upgraded. The release revision is 2.

    • The status of the release is deployed.

    • The ttoperator chart version is 2211280.1.0 corresponding to TimesTen release 22.1.1.28.0.

  6. Test the TimesTen Operator is running.
    helm test ttoper

    The output is similar to the following:

    NAME: ttoper
    LAST DEPLOYED: Mon Aug  5 00:20:34 2024
    NAMESPACE: default
    STATUS: deployed
    REVISION: 2
    TEST SUITE:     ttoper-ttoperator-test
    Last Started:   Mon Aug  5 00:20:54 2024
    Last Completed: Mon Aug  5 00:20:57 2024
    Phase:          Succeeded
    NOTES:
    Version 2211280.1.0 of the ttoperator chart has been installed.
    
    This release is named "ttoper".
    
    To learn more about the release, try:
    
      $ helm status ttoper
      $ helm get all ttoper
      $ helm history ttoper
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback ttoper <REVISION>
        - run 'helm history ttoper' for a list of revisions.
    
    To test the operator, run:
    
      $ helm test ttoper
  7. After the upgrade, do the following:
    1. Verify that the TimesTen Operator is running.
      kubectl get pods

      The output is the following:

      NAME                                 READY   STATUS    RESTARTS   AGE
      norepsamplehelm-0                    3/3     Running   0          6h38m
      norepsamplehelm-1                    3/3     Running   0          6h38m
      norepsamplehelm-2                    3/3     Running   0          6h38m
      repsamplehelm-0                      3/3     Running   0          9h
      repsamplehelm-1                      2/3     Running   0          9h
      timesten-operator-57b7949f97-xdlwl   1/1     Running   0          31s

      There is a new TimesTen Operator running.

    2. Confirm the TimesTen Operator is running the new image.
      kubectl describe deployment timesten-operator | grep Image

      The output is the following:

      Image:       container-registry.oracle.com/timesten/timesten:22.1.1.28.0

      The TimesTen Operator is running the new release.

    3. Confirm the state of the TimesTenClassic objects.
      kubectl get ttc

      The output is similar to the following:

      NAME              STATE              ACTIVE            AGE
      norepsamplehelm   AllReplicasReady   N/A               6h39m
      repsamplehelm     Normal             repsamplehelm-0   9h

      The TimesTen Operator resumes the management and monitoring of the TimesTenClassic objects. The objects and the associated TimesTen databases are functioning properly.

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