TimesTenオペレータのアップグレード

TimesTenオペレータのアップグレードでは、operator.yaml YAMLマニフェスト・ファイルを変更する必要があります。

アップグレード・プロセスには次のステップが含まれています:
  • TimesTenオペレータに関連付けられたサービス・アカウント、ロールおよびロール・バインディング・オブジェクトをアップグレードします。これを実行するには、service_account.yamlファイルを置き換えます。この例では、このファイルの場所は開発ホストのnew_kube_files/deployディレクトリにあります。

  • operator.yamlファイルを変更し、TimesTenの新しいリリースを含むイメージにimageを置き換えます。この例では、container-registry.oracle.com/timesten/timesten:22.1.1.28.0を使用します。

  • Kubernetesネームスペースで変更されたoperator.yamlファイルを置き換えます。

  1. 新しいリリースのservice_account.yamlファイルを含むディレクトリに移動します。
    cd new_kube_files/deploy
  2. TimesTenオペレータのサービス・アカウントを置き換えます。
    kubectl replace -f service_account.yaml
    出力は次のようになります。
    role.rbac.authorization.k8s.io/timesten-operator replaced
    serviceaccount/timesten-operator replaced
    rolebinding.rbac.authorization.k8s.io/timesten-operator replaced
  3. (オプション): TimesTenオペレータが実行中であることを確認します。
    kubectl get pods

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

    NAME                                 READY   STATUS    RESTARTS   AGE
    ...
    norepsample-0                        3/3     Running   0          3d1h
    norepsample-1                        3/3     Running   0          3d1h
    norepsample-2                        2/3     Running   0          3d1h
    repsample-0                          3/3     Running   0          5d6h
    repsample-1                          2/3     Running   0          5d6h
    timesten-operator-66d89ff54b-fjkpj   1/1     Running   0          3d4h
    

    TimesTenオペレータが、TimesTenClassicオブジェクトに関連付けられたTimesTenポッドとともにネームスペースで実行されています。

  4. 開発ホストで、new_kube_files/deployにあるoperator.yamlファイルを変更します。imageを、アップグレードに使用するTimesTenイメージの名前に置き換えます。たとえば、container-registry.oracle.com/timesten/timesten:22.1.1.28.0です。
    vi operator.yaml
    # Copyright (c) 2019 - 2024, Oracle and/or its affiliates.
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: timesten-operator
    spec:
      replicas: 1
      selector:
        matchLabels:
          name: timesten-operator
      template:
        metadata:
          labels:
            name: timesten-operator
        spec:
          serviceAccountName: timesten-operator
          imagePullSecrets:
          - name: sekret
          containers:
            - name: timesten-operator
              image: container-registry.oracle.com/timesten/timesten:22.1.1.28.0
              command:
              - /timesten/operator/operator/timesten-operator
    ...
  5. TimesTenオペレータのアップグレード
    kubectl replace -f operator.yaml
    出力は次のようになります。
    deployment.apps/timesten-operator replaced
  6. 新しいオペレータが実行されていることを確認します。
    kubectl get pods

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

    NAME                                 READY   STATUS    RESTARTS   AGE
    ...
    norepsample-0                        3/3     Running   0          3d1h
    norepsample-1                        3/3     Running   0          3d1h
    norepsample-2                        2/3     Running   0          3d1h
    repsample-0                          3/3     Running   0          5d6h
    repsample-1                          2/3     Running   0          5d6h
    timesten-operator-595bd8786d-c6pg5   1/1     Running   0          63s

    ネームスペース内で新しいTimesTenオペレータが実行されています。

  7. (オプション) TimesTenオペレータが新しいイメージを実行していることを確認します。
    kubectl describe deployment timesten-operator | grep Image

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

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

おめでとうございます。TimesTenオペレータが正常にアップグレードされました。新しいオペレータによってcontainer-registry.oracle.com/timesten/timesten:22.1.1.28.0イメージが使用されており、ネームスペース内の既存のTimesTenClassicオブジェクトが自動的に管理されています。