operator.yamlファイルについて

TimesTenは、コンテナ・イメージにoperator.yaml YAMLマニフェスト・ファイルを提供します。operator.yaml YAMLマニフェスト・ファイルを使用して、TimesTenオペレータをネームスペースにインストールします。このファイルには、KubernetesデプロイメントのYAML指定が含まれています。デプロイメントによって、Kubernetesは1つ以上のポッドを作成し、それぞれがTimesTenオペレータを実行します。

TimesTenは、TimesTenオペレータ・ポッドのコンテナで実行されます。TimesTenオペレータに使用しているTimesTenコンテナ・イメージ、コンテナ・レジストリおよびイメージ・プル・シークレットを指定する必要があります。operator.yamlファイルには、次の設定が用意されています。環境に適合するように変更します:

  • image: container-registry.oracle.com/timesten/timesten:latest

    imageの値は、container-registry.oracle.comの最新の公式のTimesTenコンテナ・イメージです。

    TimesTenコンテナ・イメージの取得およびコンテナ・レジストリの選択の詳細は、「TimesTen Kubernetesオペレータを使用する準備」を参照してください。

  • imagePullSecrets: sekret

    operator.yamlファイルのイメージ・プル・シークレットは、Kubernetesがコンテナ・レジストリからTimesTenコンテナ・イメージをプルするために使用するKubernetes Secretです。イメージ・プル・シークレットの作成の詳細は、「TimesTen Kubernetesオペレータを使用する準備」を参照してください。

operator.yamlファイルの属性を確認し、その一部を環境にあわせてカスタマイズできます。

operator.yamlファイルは次のとおりです。このファイルは、リリースごとに異なる可能性があります。
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:latest
          command:
          - /timesten/operator/operator/timesten-operator
          ports:
          - name: probes
            containerPort: 8081
            protocol: TCP
          - name: metrics
            containerPort: 8080
            protocol: TCP
          readinessProbe:
            httpGet:
              scheme: HTTP
              path: /healthz
              port: probes
            initialDelaySeconds: 10
            periodSeconds: 10
            timeoutSeconds: 10
            successThreshold: 1
            failureThreshold: 1
          livenessProbe:
            httpGet:
              scheme: HTTP
              path: /healthz
              port: probes
            initialDelaySeconds: 10
            periodSeconds: 30
            timeoutSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "timesten-operator"
            - name: TT_MAX_RECONCILES
              value: "2"
            - name: EXPOSE_METRICS
              value: "1"
            - name: METRICS_SCHEME
              value: "https"
            - name: EXPOSE_PROBES
              value: "1"
            - name: CREATE_SERVICEMONITOR
              value: "1"
          resources:
            requests:
                cpu: "250m"
                memory: "1G"
            limits:
                cpu: "250m"
                memory: "1G"
          securityContext:
              runAsNonRoot: true
              privileged: false
              readOnlyRootFilesystem: true
              allowPrivilegeEscalation: false
              capabilities:
                  drop:
                    - all
          volumeMounts:
            - name: tmp
              mountPath: /tmp
      volumes:
        - name: tmp
          emptyDir: {}

# 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"]
これらの属性の詳細を確認します:
  • Deployment: operator.yamlファイルは、TimesTenオペレータをデプロイメントとしてインストールするようにKubernetesに指示します。この設定は変更できません。

  • timesten-operator: TimesTenオペレータの名前はtimesten-operatorです。この設定は変更できません。

  • replicas: 1

    replicas属性は、TimesTenオペレータのコピー数を示します。TimesTenオペレータのコピーは複数使用できます。デフォルト値の1は、1つのTimesTenオペレータがあることを示します。開発およびテストの場合は、値1を使用できます。ただし、高可用性を確保する目的で、複数のレプリカを指定できます。

    ノート:

    TimesTenオペレータ・メトリックは、TimesTenオペレータ・デプロイメントに1つのTimesTenオペレータが定義されている場合、正確です。TimesTenオペレータ・メトリックの公開の詳細は、「TimesTen Kubernetesオペレータからのメトリックの公開」を参照してください。
  • imagePullSecrets: sekret

    前述のように、sekretを、Kubernetesがコンテナ・レジストリからTimesTenコンテナ・イメージをプルするために使用するイメージ・プル・シークレットの名前に置き換えます。

  • image: container-registry.oracle.com/timesten/timesten:latest

    前述のとおり、container-registry.oracle.com/timesten/timesten:latestをコンテナ・レジストリおよびコンテナ・イメージの名前に置き換えます。

  • readinessProbeおよびlivenessProbe: 準備および有効性プローブにより、KubernetesはTimesTenオペレータの正常性を判断できます。「準備状況および有効性プローブについて」を参照してください。

  • TimesTenオペレータは、独自の機能およびTimesTenClassicオブジェクトのステータスに関するメトリックをPrometheusまたはその他のスクレイプ・メカニズムに自動的に公開します。次の環境変数は、TimesTenオペレータ・メトリックに固有です:
    • EXPOSE_METRICS

    • METRICS_SCHEME
    • EXPOSE_PROBES

    • CREATE_SERVICEMONITOR

    「TimesTenオペレータ・メトリックの公開について」を参照してください。

  • resources: TimesTenオペレータには、デフォルトのCPUおよびメモリー・リクエストおよび制限があります。これらの設定を変更する必要はありません。

  • affinity: affinity定義は、マルチアーキテクチャKubernetes環境へのTimesTenオペレータのデプロイに固有です。amd64ノードとarm64ノードの両方を含むKubernetesクラスタにTimesTenオペレータをインストールする場合は、このセクションのコメントを解除する必要があります。「マルチアーキテクチャKubernetesクラスタでのデプロイについて」を参照してください。