クラスタスコープでのTimesTenオペレータのアップグレード

この項の例では、アップグレード用のYAMLマニフェスト・ファイルを取得していることを前提としています。「アップグレード用のコンテナ・イメージの取得について」を参照してください。アップグレードにHelmチャートを使用する場合は、「HelmおよびTimesTen Helmチャートの概要」を参照してください。

クラスタスコープでTimesTenオペレータをアップグレードするステップについて説明します。

  1. クラスタスコープでTimesTenオペレータが実行中であることを確認します。
    1. timesten-operatorネームスペースでTimesTenオペレータが実行されていることを確認します。
      kubectl get pods -l name=timesten-operator -A

      出力は、次のようになります。

      NAMESPACE           NAME                                 READY   STATUS    RESTARTS   AGE
      timesten-operator   timesten-operator-6bf76dd84b-c8j59   1/1     Running   0          2d4h

      timesten-operatorネームスペースで実行中のTimesTenオペレータがあります。

    2. TimesTenオペレータ・デプロイメントで、TT_OPERATOR_SCOPE環境変数がclusterに設定されていることを確認します。
      kubectl describe deployment timesten-operator -n timesten-operator | grep TT_OPERATOR_SCOPE
      出力は次のようになります。
            TT_OPERATOR_SCOPE:               cluster
  2. アップグレード用のYAMLマニフェスト・ファイルを含むディレクトリに移動します。この例では、new_kube_files/deployディレクトリにこのファイルが含まれています。
    cd new_kube_files/deploy
  3. サービス・アカウント、クラスタ・ロールおよびクラスタ・ロール・バインディング・オブジェクトをアップグレードします。
     kubectl replace -f cluster_config.yaml
    出力は、次のようになります。
    namespace/timesten-operator replaced
    clusterrole.rbac.authorization.k8s.io/timesten-operator replaced
    serviceaccount/timesten-operator replaced
    clusterrolebinding.rbac.authorization.k8s.io/timesten-operator replaced
  4. 次の手順を実行して、cluster_operator.yamlファイルを変更します:
    1. テキスト・エディタを使用して、cluster_operator.yamlファイルを変更します。

      次のように置き換えます:

      • image: container-registry.oracle.com/timesten/timesten:latestをアップグレード用のイメージの名前に置き換えます。この例では、アップグレード用のイメージの名前はcontainer-registry.oracle.com/timesten/timesten:22.1.1.35.0です。

      • マルチアーキテクチャ環境で実行している場合は、インストール時に使用した設定を使用して、affinityセクションを変更します。この例では、amd64を使用します。

      vi cluster_operator.yaml
      
      # Copyright (c) 2019 - 2025, Oracle and/or its affiliates.
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: timesten-operator
      spec:
        replicas: 1
      ...
          spec:
            serviceAccountName: timesten-operator
            imagePullSecrets:
            - name: sekret
            containers:
              - name: timesten-operator
                image: container-registry.oracle.com/timesten/timesten:22.1.1.35.0
      ...
      # An example affinity definition; this pod will only be assigned to a node
      # running on amd64 (the default)
      #
            affinity:
              nodeAffinity:
                requiredDuringSchedulingIgnoredDuringExecution:
                  nodeSelectorTerms:
                    - matchExpressions:
                      - key: "kubernetes.io/arch"
                        operator: In
                        values: ["amd64"]
    2. cluster_operator.yamlファイルを保存し、閉じます。
  5. TimesTenオペレータのアップグレード
    kubectl replace -f cluster_operator.yaml
    出力は次のようになります。
    deployment.apps/timesten-operator replaced
  6. timesten-operatorネームスペースでTimesTenオペレータが実行されていることを確認します。
    kubectl get pods -n timesten-operator

    出力は、次のようになります。

    NAME                                 READY   STATUS    RESTARTS   AGE
    timesten-operator-5cf4b68d58-5cn6t   1/1     Running   0          54s
  7. (オプション) TimesTenオペレータが新しいイメージを実行していることを確認します。
    kubectl describe deployment timesten-operator -n timesten-operator| grep Image

    出力は次のようになります。

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

おめでとうございます。TimesTenオペレータが正常にアップグレードされました。クラスタスコープのKubernetesクラスタのtimesten-operatorネームスペースでオペレータが実行されています。オペレータはcontainer-registry.oracle.com/timesten/timesten:22.1.1.35.0イメージを使用しています。

TimesTenClassicオブジェクトをアップグレードする準備ができている場合は、「TimesTen Classicデータベースのアップグレードについて」に進みます。