13.5. Cluster API マシンの設定オプション
13.5.1. Amazon Web Services の Cluster API 設定オプション
Cluster API を使用したマシン管理は、テクノロジープレビュー機能のみです。テクノロジープレビュー機能は、Red Hat 製品のサービスレベルアグリーメント (SLA) の対象外であり、機能的に完全ではないことがあります。Red Hat は、実稼働環境でこれらを使用することを推奨していません。テクノロジープレビュー機能は、最新の製品機能をいち早く提供して、開発段階で機能のテストを行い、フィードバックを提供していただくことを目的としています。
Red Hat のテクノロジープレビュー機能のサポート範囲に関する詳細は、テクノロジープレビュー機能のサポート範囲 を参照してください。
Cluster API カスタムリソースマニフェストの値を更新することで、Amazon Web Services (AWS) Cluster API マシンの設定を変更できます。
13.5.1.1. Amazon Web Services クラスターを設定するサンプル YAML
次の YAML ファイルの例は、Amazon Web Services クラスターの設定を示しています。
13.5.1.1.1. Amazon Web Services 上の Cluster API インフラストラクチャーリソースのサンプル YAML
インフラストラクチャーリソースはプロバイダー固有であり、リージョンやサブネットなど、クラスター内のすべてのコンピュートマシンセットで共有されるプロパティーを定義します。コンピュートマシンセットは、マシン作成時にこのリソースを参照します。
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: <cluster_name> namespace: openshift-cluster-api spec: controlPlaneEndpoint: host: <control_plane_endpoint_address> port: 6443 region: <region>
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSCluster
metadata:
name: <cluster_name>
namespace: openshift-cluster-api
spec:
controlPlaneEndpoint:
host: <control_plane_endpoint_address>
port: 6443
region: <region>
13.5.1.1.2. Amazon Web Services の Cluster API マシンテンプレートリソースのサンプル YAML
マシンテンプレートリソースはプロバイダー固有であり、コンピュートマシンセットが作成するマシンの基本的なプロパティーを定義します。コンピュートマシンセットは、マシン作成時にこのテンプレートを参照します。
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: <template_name> namespace: openshift-cluster-api spec: template: spec: uncompressedUserData: true iamInstanceProfile: # ... instanceType: m5.large cloudInit: insecureSkipSecretsManager: true ami: id: # ... subnet: filters: - name: tag:Name values: - # ... additionalSecurityGroups: - filters: - name: tag:Name values: - # ...
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSMachineTemplate
metadata:
name: <template_name>
namespace: openshift-cluster-api
spec:
template:
spec:
uncompressedUserData: true
iamInstanceProfile: # ...
instanceType: m5.large
cloudInit:
insecureSkipSecretsManager: true
ami:
id: # ...
subnet:
filters:
- name: tag:Name
values:
- # ...
additionalSecurityGroups:
- filters:
- name: tag:Name
values:
- # ...
13.5.1.1.3. Amazon Web Services の Cluster API コンピューティングマシンセットリソースのサンプル YAML
コンピュートマシンセットリソースは、作成するマシンの追加プロパティーを定義します。コンピュートマシンセットは、マシン作成時にインフラストラクチャーリソースとマシンテンプレートも参照します。
apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineSet metadata: name: <machine_set_name> namespace: openshift-cluster-api spec: clusterName: <cluster_name> replicas: 1 selector: matchLabels: test: example template: metadata: labels: test: example spec: bootstrap: dataSecretName: worker-user-data clusterName: <cluster_name> infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate name: <template_name>
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineSet
metadata:
name: <machine_set_name>
namespace: openshift-cluster-api
spec:
clusterName: <cluster_name>
replicas: 1
selector:
matchLabels:
test: example
template:
metadata:
labels:
test: example
spec:
bootstrap:
dataSecretName: worker-user-data
clusterName: <cluster_name>
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSMachineTemplate
name: <template_name>
13.5.2. Google Cloud Platform の Cluster API 設定オプション
Cluster API を使用したマシン管理は、テクノロジープレビュー機能のみです。テクノロジープレビュー機能は、Red Hat 製品のサービスレベルアグリーメント (SLA) の対象外であり、機能的に完全ではないことがあります。Red Hat は、実稼働環境でこれらを使用することを推奨していません。テクノロジープレビュー機能は、最新の製品機能をいち早く提供して、開発段階で機能のテストを行い、フィードバックを提供していただくことを目的としています。
Red Hat のテクノロジープレビュー機能のサポート範囲に関する詳細は、テクノロジープレビュー機能のサポート範囲 を参照してください。
Cluster API カスタムリソースマニフェストの値を更新することで、Google Cloud Platform (GCP) Cluster API マシンの設定を変更できます。
13.5.2.1. Google Cloud Platform クラスターを設定するためのサンプル YAML
次の YAML ファイルの例は、Google Cloud Platform クラスターの設定を示しています。
13.5.2.1.1. Google Cloud Platform 上の Cluster API インフラストラクチャーリソースのサンプル YAML
インフラストラクチャーリソースはプロバイダー固有であり、リージョンやサブネットなど、クラスター内のすべてのコンピュートマシンセットで共有されるプロパティーを定義します。コンピュートマシンセットは、マシン作成時にこのリソースを参照します。
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: GCPCluster metadata: name: <cluster_name> spec: controlPlaneEndpoint: host: <control_plane_endpoint_address> port: 6443 network: name: <cluster_name>-network project: <project> region: <region>
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPCluster
metadata:
name: <cluster_name>
spec:
controlPlaneEndpoint:
host: <control_plane_endpoint_address>
port: 6443
network:
name: <cluster_name>-network
project: <project>
region: <region>
13.5.2.1.2. Google Cloud Platform 上の Cluster API マシンテンプレートリソースのサンプル YAML
マシンテンプレートリソースはプロバイダー固有であり、コンピュートマシンセットが作成するマシンの基本的なプロパティーを定義します。コンピュートマシンセットは、マシン作成時にこのテンプレートを参照します。
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: GCPMachineTemplate metadata: name: <template_name> namespace: openshift-cluster-api spec: template: spec: rootDeviceType: pd-ssd rootDeviceSize: 128 instanceType: n1-standard-4 image: projects/rhcos-cloud/global/images/rhcos-411-85-202203181601-0-gcp-x86-64 subnet: <cluster_name>-worker-subnet serviceAccounts: email: <service_account_email_address> scopes: - https://www.googleapis.com/auth/cloud-platform additionalLabels: kubernetes-io-cluster-<cluster_name>: owned additionalNetworkTags: - <cluster_name>-worker ipForwarding: Disabled
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPMachineTemplate
metadata:
name: <template_name>
namespace: openshift-cluster-api
spec:
template:
spec:
rootDeviceType: pd-ssd
rootDeviceSize: 128
instanceType: n1-standard-4
image: projects/rhcos-cloud/global/images/rhcos-411-85-202203181601-0-gcp-x86-64
subnet: <cluster_name>-worker-subnet
serviceAccounts:
email: <service_account_email_address>
scopes:
- https://www.googleapis.com/auth/cloud-platform
additionalLabels:
kubernetes-io-cluster-<cluster_name>: owned
additionalNetworkTags:
- <cluster_name>-worker
ipForwarding: Disabled
13.5.2.1.3. Google Cloud Platform 上の Cluster API コンピュートマシンセットリソースのサンプル YAML
コンピュートマシンセットリソースは、作成するマシンの追加プロパティーを定義します。コンピュートマシンセットは、マシン作成時にインフラストラクチャーリソースとマシンテンプレートも参照します。
apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineSet metadata: name: <machine_set_name> namespace: openshift-cluster-api spec: clusterName: <cluster_name> replicas: 1 selector: matchLabels: test: example template: metadata: labels: test: example spec: bootstrap: dataSecretName: worker-user-data clusterName: <cluster_name> infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: GCPMachineTemplate name: <template_name> failureDomain: <failure_domain>
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineSet
metadata:
name: <machine_set_name>
namespace: openshift-cluster-api
spec:
clusterName: <cluster_name>
replicas: 1
selector:
matchLabels:
test: example
template:
metadata:
labels:
test: example
spec:
bootstrap:
dataSecretName: worker-user-data
clusterName: <cluster_name>
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPMachineTemplate
name: <template_name>
failureDomain: <failure_domain>