ネームスペース2へのインストール
ネームスペーススコープのKubernetesクラスタ内の
mynamespace2というネームスペースにTimesTenオペレータをインストールします。
- ネームスペースを確認します。
kubectl get namespaces出力は、次のようになります。NAME STATUS AGE mynamespace Active 16d ... mynamespace2 Active 19h - ネームスペース2に切り替えます(この例では
mynamespace2)。kubectl config set-context --current --namespace=mynamespace2出力は、次のようになります。
Context "default" modified. - YAMLマニフェスト・ファイルを含むディレクトリに移動します。この例では、
kube_files/deployにファイルが含まれています。cd kube_files/deploy - 必要なサービス・アカウント、ロールおよびロール・バインディングをインストールします。
kubectl create -f service_account.yaml出力は、次のようになります。
role.rbac.authorization.k8s.io/timesten-operator created serviceaccount/timesten-operator created rolebinding.rbac.authorization.k8s.io/timesten-operator created - 2番目のネームスペース(この例では
service_account_cluster_n2.yaml)のservice_account_cluster.yamlファイルのコピーを作成します。cp service_account_cluster.yaml service_account_cluster_n2.yaml - 次の手順を実行して、
service_account_cluster_n2.yamlYAMLファイルをインストールします:- (オプション):
service_account_cluster_n2.yamlファイルの内容を表示します。cat service_account_cluster_n2.yaml出力は、次のようになります。# Copyright (c) 2025, Oracle and/or its affiliates. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: timesten-operator # If running multiple operators on the same cluster: #name: timesten-operator-<NAMESPACE> rules: - apiGroups: - "" resources: - nodes verbs: - get - list - watch - apiGroups: - "" resources: - persistentvolumeclaims verbs: - get - list - watch - delete --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: timesten-operator # If running multiple operators on the same cluster: #name: timesten-operator-<NAMESPACE> subjects: - kind: ServiceAccount name: timesten-operator #namespace: <NAMESPACE> roleRef: kind: ClusterRole name: timesten-operator # If running multiple operators on the same cluster: #name: timesten-operator-<NAMESPACE> apiGroup: rbac.authorization.k8s.io - テキスト・エディタを使用して、
service_account_cluster_n2.yamlファイルを変更します。必要な変更を加えます:-
#namespaceを見つけ、#を削除し、<NAMESPACE>を実際のネームスペースの名前(この例ではmynamespace2)に置き換えます。 -
#nameの3つの出現箇所を見つけて#を削除し、<NAMESPACE>を実際のネームスペースの名前(この例ではmynamespace2)に置き換えます。
vi service_account_cluster_n2.yaml # Copyright (c) 2025, Oracle and/or its affiliates. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: timesten-operator # If running multiple operators on the same cluster: name: timesten-operator-mynamespace2 rules: - apiGroups: - "" resources: - nodes verbs: - get - list - watch - apiGroups: - "" resources: - persistentvolumeclaims verbs: - get - list - watch - delete --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: timesten-operator # If running multiple operators on the same cluster: name: timesten-operator-mynamespace2 subjects: - kind: ServiceAccount name: timesten-operator namespace: mynamespace2 roleRef: kind: ClusterRole name: timesten-operator # If running multiple operators on the same cluster: name: timesten-operator-mynamespace2 apiGroup: rbac.authorization.k8s.io -
service_account_cluster_n2.yamlファイルを保存して閉じます。service_account_cluster_n2.yamlファイルをインストールします。kubectl create -f service_account_cluster_n2.yaml出力は、次のようになります。clusterrole.rbac.authorization.k8s.io/timesten-operator created clusterrolebinding.rbac.authorization.k8s.io/timesten-operator created
- (オプション):
operator.yamlファイルを変更します。この例では、変更はネームスペース1のoperator.yamlファイルと同じです。この変更はネームスペース1と同じである必要はありません。たとえば、別のコンテナ・イメージを使用できます:- テキスト・エディタを使用して、
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 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"] -
operator.yamlファイルを保存し、閉じます。
- テキスト・エディタを使用して、
- TimesTenオペレータのインストール
kubectl create -f operator.yaml出力は次のようになります。deployment.apps/timesten-operator created - TimesTenオペレータが実行されていることを確認します。
kubectl get pods出力は、次のようになります。NAME READY STATUS RESTARTS AGE timesten-operator-577f7fbc6f-h8hj8 1/1 Running 0 61s
おめでとうございます。TimesTenオペレータを、ネームスペーススコープのKubernetesクラスタ内のネームスペース(
mynamespace2)にインストールしました。