クラスタスコープでのTimesTenオペレータのインストール

この項の例では、YAMLマニフェスト・ファイルを取得していることを前提としています。「TimesTen YAMLマニフェスト・ファイルおよびHelmチャートの取得」を参照してください。

TimesTenオペレータをクラスタスコープにインストールします。インストールの一部として、timesten-operatorネームスペースが作成されます。TimesTenオペレータは、クラスタスコープのKubernetesクラスタ内のこのネームスペースで実行されます。インストール後、このTimesTenオペレータは、クラスタ内のすべてのネームスペースのTimesTenClassicオブジェクトにサービスを提供します。

  1. YAMLマニフェスト・ファイルを含むディレクトリに移動します。この例では、kube_files/deployにファイルが含まれています。
    cd kube_files/deploy
  2. TimesTenオペレータを実行するために必要な権限を作成します。
    kubectl create -f cluster_config.yaml

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

    namespace/timesten-operator created
    clusterrole.rbac.authorization.k8s.io/timesten-operator created
    serviceaccount/timesten-operator created
    clusterrolebinding.rbac.authorization.k8s.io/timesten-operator created

    このファイルをインストールすると、timesten-operatorネームスペースが作成されます。

  3. timesten-operatorネームスペースにKubernetesシークレットを作成します。このKubernetesシークレットはイメージ・プル・シークレットとして使用され、TimesTenオペレータがイメージ・レジストリからTimesTenコンテナ・イメージをプルするのに必要です。この例では、sekretシークレットを作成します。
    kubectl create secret generic sekret --from-file=.dockerconfigjson=$HOME/.docker/config.json --type=kubernetes.io/dockerconfigjson -n timesten-operator

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

    secret/sekret created

    Kubernetesシークレットの作成の詳細は、Kubernetesドキュメントの「Pulling Images from Registry during Deployment」を参照してください。

  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.34.0です。

      • imagePullSecrets: sekretを前のステップで作成したイメージ・プル・シークレットの名前に置き換えます。この例では、イメージ・プル・シークレットの名前はsekretです。

      • マルチアーキテクチャ環境で実行している場合は、affinityセクションを変更し、amd64またはarm64のいずれかを指定します。この例では、マルチアーキテクチャ環境で実行し、ノードを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.34.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 create -f cluster_operator.yaml

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

    deployment.apps/timesten-operator created
  6. timesten-operatorネームスペースでTimesTenオペレータが実行されていることを確認します。
    kubectl get pods -n timesten-operator

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

    NAME                                 READY   STATUS    RESTARTS   AGE
    timesten-operator-6bf76dd84b-c8j59   1/1     Running   0          51s

おめでとうございます。TimesTenオペレータをインストールしました。クラスタスコープのKubernetesクラスタのtimesten-operatorネームスペースで実行されています。TimesTenオペレータは、Kubernetesクラスタ内のすべてのネームスペースのTimesTenClassicオブジェクトにサービスを提供します。

これで、ネームスペースにTimesTenデータベースを作成する準備ができました。「TimesTen Classicデータベースの作成」を参照してください。