2.6. IBM Power Virtual Server 上でのコンピュートマシンセットの作成
IBM Power® Virtual Server 上の OpenShift Container Platform クラスターに、特定のタスクを実行するためのコンピュートマシンセットを作成します。たとえば、インフラストラクチャーマシンセットおよび関連マシンを作成して、サポートするワークロードを新しいマシンに移動できます。サポートワークロードを専用マシンに移行することで、クラスターリソースが効率的に割り当てられることが保証されます。
高度なマシン管理およびスケーリング機能は、Machine API が動作しているクラスターでのみ使用できます。user-provisioned infrastructure を持つクラスターでは、Machine API を使用するために追加の検証と設定が必要です。
インフラストラクチャープラットフォームタイプが none のクラスターでは、Machine API を使用できません。この制限は、クラスターに接続されている計算マシンが、この機能をサポートするプラットフォームにインストールされている場合でも適用されます。このパラメーターは、インストール後に変更することはできません。
クラスターのプラットフォームタイプを表示するには、以下のコマンドを実行します。
$ oc get infrastructure cluster -o jsonpath='{.status.platform}'
2.6.1. IBM Power Virtual Server 上のコンピュートマシンセットカスタムリソースのサンプル YAML リンクのコピーリンクがクリップボードにコピーされました!
サンプル YAML ファイルを使用すると、プロビジョニングの自動化や、必要に応じてスケーリングとスケジューリング作業を確実に実行できます。サンプル YAML ファイルは、リージョン内の指定された IBM Power® Virtual Server ゾーンで実行されるコンピュートマシンセットを定義し、node-role.kubernetes.io/<role>: "" というラベルの付いたノードを作成します。
サンプルでは、<infrastructure_id> はクラスターをプロビジョニングしたときに設定したクラスター ID に基づくインフラストラクチャー ID ラベルであり、<role> は追加するノードラベルです。
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
machine.openshift.io/cluster-api-machine-role: <role>
machine.openshift.io/cluster-api-machine-type: <role>
name: <infrastructure_id>-<role>-<region>
namespace: openshift-machine-api
spec:
replicas: 1
selector:
matchLabels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<region>
template:
metadata:
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
machine.openshift.io/cluster-api-machine-role: <role>
machine.openshift.io/cluster-api-machine-type: <role>
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<region>
spec:
metadata:
labels:
node-role.kubernetes.io/<role>: ""
providerSpec:
value:
apiVersion: machine.openshift.io/v1
credentialsSecret:
name: powervs-credentials
image:
name: rhcos-<infrastructure_id>
type: Name
keyPairName: <infrastructure_id>-key
kind: PowerVSMachineProviderConfig
memoryGiB: 32
network:
regex: ^DHCPSERVER[0-9a-z]{32}_Private$
type: RegEx
processorType: Shared
processors: "0.5"
serviceInstance:
id: <ibm_power_vs_service_instance_id>
type: ID
systemType: s922
userDataSecret:
name: <role>-user-data
ここでは、以下のようになります。
<infrastructure_id>クラスターのプロビジョニング時に設定したクラスター ID を基にするインフラストラクチャー ID を指定します。OpenShift CLI がインストールされている場合は、以下のコマンドを実行してインフラストラクチャー ID を取得できます。
$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster<role>- 追加するノードラベルを指定します。
<infrastructure_id>-<role>-<region>- インフラストラクチャー ID、ノードラベル、およびリージョンを指定します。
rhcos-<infrastructure_id>- クラスターのインストールに使用されたカスタムの Red Hat Enterprise Linux CoreOS(RHCOS) イメージを指定します。
<ibm_power_vs_service_instance_id>- マシンを配置するリージョン内のインフラストラクチャー ID を指定します。