1.8.14. ユーザーによってプロビジョニングされるインフラストラクチャーでの AWS でのブートストラップノードの初期化
Amazon Web Services (AWS) ですべての必要なインフラストラクチャーを作成した後に、クラスターをインストールできます。
前提条件
- AWS アカウントを設定します。
- クラスターの Ignition 設定ファイルを生成します。
- AWS で VPC および関連するサブネットを作成し、設定します。
- AWS で DNS、ロードバランサー、およびリスナーを作成し、設定します。
- コントロールプレーンおよびコンピュートロールを作成します。
- ブートストラップマシンを作成します。
- コントロールプレーンマシンを作成します。
- ワーカーマシンを手動で管理する予定の場合には、ワーカーマシンを作成します。
手順
インストールプログラムが含まれるディレクトリーに切り替え、以下のコマンドを実行します。
$ ./openshift-install wait-for bootstrap-complete --dir=<installation_directory> \ 1 --log-level=info 2
コマンドが
FATAL警告を出さずに終了する場合、実稼働用のコントロールプレーンは初期化されています。
1.8.14.1. AWS でのワーカーノードの作成
クラスターで使用するワーカーノードを Amazon Web Services (AWS) で作成できます。これらのノードを手動で作成するための最も簡単な方法として、提供される CloudFormation テンプレートを変更することができます。
CloudFormation テンプレートは、1 つのワーカーマシンを表すスタックを作成します。それぞれのワーカーマシンにスタックを作成する必要があります。
提供される CloudFormation テンプレートを使用してワーカーノードを作成しない場合、提供される情報を確認し、インフラストラクチャーを手動で作成する必要があります。クラスターが適切に初期化されない場合、インストールログを用意して Red Hat サポートに問い合わせする必要がある可能性があります。
前提条件
- AWS アカウントを設定します。
- クラスターの Ignition 設定ファイルを生成します。
- AWS で VPC および関連するサブネットを作成し、設定します。
- AWS で DNS、ロードバランサー、およびリスナーを作成し、設定します。
- コントロールプレーンおよびコンピュートロールを作成します。
- ブートストラップマシンを作成します。
- コントロールプレーンマシンを作成します。
手順
CloudFormation テンプレートが必要とするパラメーター値が含まれる JSON ファイルを作成します。
[ { "ParameterKey": "InfrastructureName", 1 "ParameterValue": "mycluster-<random_string>" 2 }, { "ParameterKey": "RhcosAmi", 3 "ParameterValue": "ami-<random_string>" 4 }, { "ParameterKey": "Subnet", 5 "ParameterValue": "subnet-<random_string>" 6 }, { "ParameterKey": "WorkerSecurityGroupId", 7 "ParameterValue": "sg-<random_string>" 8 }, { "ParameterKey": "IgnitionLocation", 9 "ParameterValue": "https://api-int.<cluster_name>.<domain_name>:22623/config/worker" 10 }, { "ParameterKey": "CertificateAuthorities", 11 "ParameterValue": "" 12 }, { "ParameterKey": "WorkerInstanceProfileName", 13 "ParameterValue": "" 14 }, { "ParameterKey": "WorkerInstanceType", 15 "ParameterValue": "m4.large" 16 } ]- 1
- クラスターの Ingition 設定ファイルでエンコードされるクラスターインフラストラクチャーの名前。
- 2
- 形式が
<cluster-name>-<random-string>の Ignition 設定ファイルから抽出したインフラストラクチャー名を指定します。 - 3
- ワーカーノードに使用する最新の Red Hat Enterprise Linux CoreOS(RHCOS)AMI。
- 4
AWS::EC2::Image::Id値を指定します。- 5
- ワーカーノードを起動するサブネット (プライベートが望ましい)。
- 6
- DNS および負荷分散の CloudFormation テンプレートの出力から
PrivateSubnets値のサブネットを指定します。 - 7
- ワーカーノードに関連付けるワーカーセキュリティーグループ ID。
- 8
- セキュリティーグループおよびロールの CloudFormation テンプレートの出力から
WorkerSecurityGroupId値を指定します。 - 9
- ブートストラップの Ignition 設定ファイルをフェッチする場所。
- 10
- 生成される Ignition 設定の場所を指定します。
https://api-int.<cluster_name>.<domain_name>:22623/config/worker - 11
- 使用する base64 でエンコードされた認証局の文字列。
- 12
- インストールディレクトリーにある
worker.ignファイルから値を指定します。この値は、data:text/plain;charset=utf-8;base64,ABC…xYz==形式の長い文字列です。 - 13
- ワーカーロールに関連付ける IAM プロファイル。
- 14
- セキュリティーグループおよびロールの CloudFormation テンプレートの出力から
WokerInstanceProfileパラメーターの値を指定します。 - 15
- コントロールプレーンマシンに使用する AWS インスタンスのタイプ。
- 16
- 許可される値:
-
m4.large -
m4.xlarge -
m4.2xlarge -
m4.4xlarge -
m4.8xlarge -
m4.10xlarge -
m4.16xlarge -
c4.large -
c4.xlarge -
c4.2xlarge -
c4.4xlarge -
c4.8xlarge -
r4.large -
r4.xlarge -
r4.2xlarge -
r4.4xlarge -
r4.8xlarge r4.16xlarge重要m4インスタンスがeu-west-3などのリージョンで利用可能ではない場合、m5タイプを代わりに使用します。
-
- このトピックのワーカーマシンの CloudFormation テンプレートセクションからテンプレートをコピーし、これをコンピューター上に YAML ファイルとして保存します。このテンプレートは、クラスターに必要なネットワークオブジェクトおよびロードバランサーについて記述しています。
-
m5インスタンスタイプをWorkerInstanceTypeの値として指定している場合、そのインスタンスタイプを CloudFormation テンプレートのWorkerInstanceType.AllowedValuesパラメーターに追加します。 ワーカースタックを作成します。
テンプレートを起動します。
重要単一行にコマンドを入力してください。
$ aws cloudformation create-stack --stack-name <name> 1 --template-body file://<template>.yaml \ 2 --parameters file://<parameters>.json 3
テンプレートのコンポーネントが存在することを確認します。
$ aws cloudformation describe-stacks --stack-name <name>
クラスターに作成するワーカーマシンが十分な数に達するまでワーカースタックの作成を継続します。
重要2 つ以上のワーカーマシンを作成する必要があるため、この CloudFormation テンプレートを使用する 2 つ以上のスタックを作成する必要があります。
1.8.14.1.1. ワーカーマシンの CloudFormation テンプレート
以下の CloudFormation テンプレートを使用し、OpenShift Container Platform クラスターに必要なワーカーマシンをデプロイすることができます。
例1.42 ワーカーマシンの CloudFormation テンプレート
AWSTemplateFormatVersion: 2010-09-09
Description: Template for OpenShift Cluster Node Launch (EC2 worker instance)
Parameters:
InfrastructureName:
AllowedPattern: ^([a-zA-Z][a-zA-Z0-9\-]{0,26})$
MaxLength: 27
MinLength: 1
ConstraintDescription: Infrastructure name must be alphanumeric, start with a letter, and have a maximum of 27 characters.
Description: A short, unique cluster ID used to tag nodes for the kubelet cloud provider.
Type: String
RhcosAmi:
Description: Current Red Hat Enterprise Linux CoreOS AMI to use for bootstrap.
Type: AWS::EC2::Image::Id
Subnet:
Description: The subnets, recommend private, to launch the master nodes into.
Type: AWS::EC2::Subnet::Id
WorkerSecurityGroupId:
Description: The master security group ID to associate with master nodes.
Type: AWS::EC2::SecurityGroup::Id
IgnitionLocation:
Default: https://api-int.$CLUSTER_NAME.$DOMAIN:22623/config/worker
Description: Ignition config file location.
Type: String
CertificateAuthorities:
Default: data:text/plain;charset=utf-8;base64,ABC...xYz==
Description: Base64 encoded certificate authority string to use.
Type: String
WorkerInstanceProfileName:
Description: IAM profile to associate with master nodes.
Type: String
WorkerInstanceType:
Default: m4.large
Type: String
AllowedValues:
- "m4.large"
- "m4.xlarge"
- "m4.2xlarge"
- "m4.4xlarge"
- "m4.8xlarge"
- "m4.10xlarge"
- "m4.16xlarge"
- "c4.large"
- "c4.xlarge"
- "c4.2xlarge"
- "c4.4xlarge"
- "c4.8xlarge"
- "r4.large"
- "r4.xlarge"
- "r4.2xlarge"
- "r4.4xlarge"
- "r4.8xlarge"
- "r4.16xlarge"
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "Cluster Information"
Parameters:
- InfrastructureName
- Label:
default: "Host Information"
Parameters:
- WorkerInstanceType
- RhcosAmi
- IgnitionLocation
- CertificateAuthorities
- WorkerSecurityGroupId
- WorkerInstanceProfileName
- Label:
default: "Network Configuration"
Parameters:
- Subnet
ParameterLabels:
Subnet:
default: "Subnet"
InfrastructureName:
default: "Infrastructure Name"
WorkerInstanceType:
default: "Worker Instance Type"
WorkerInstanceProfileName:
default: "Worker Instance Profile Name"
RhcosAmi:
default: "Red Hat Enterprise Linux CoreOS AMI ID"
IgnitionLocation:
default: "Worker Ignition Source"
CertificateAuthorities:
default: "Ignition CA String"
WorkerSecurityGroupId:
default: "Worker Security Group ID"
Resources:
Worker0:
Type: AWS::EC2::Instance
Properties:
ImageId: !Ref RhcosAmi
BlockDeviceMappings:
- DeviceName: /dev/xvda
Ebs:
VolumeSize: "120"
VolumeType: "gp2"
IamInstanceProfile: !Ref WorkerInstanceProfileName
InstanceType: !Ref WorkerInstanceType
NetworkInterfaces:
- AssociatePublicIpAddress: "false"
DeviceIndex: "0"
GroupSet:
- !Ref "WorkerSecurityGroupId"
SubnetId: !Ref "Subnet"
UserData:
Fn::Base64: !Sub
- '{"ignition":{"config":{"append":[{"source":"${SOURCE}","verification":{}}]},"security":{"tls":{"certificateAuthorities":[{"source":"${CA_BUNDLE}","verification":{}}]}},"timeouts":{},"version":"2.2.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{}}'
- {
SOURCE: !Ref IgnitionLocation,
CA_BUNDLE: !Ref CertificateAuthorities,
}
Tags:
- Key: !Join ["", ["kubernetes.io/cluster/", !Ref InfrastructureName]]
Value: "shared"
Outputs:
PrivateIP:
Description: The compute node private IP address.
Value: !GetAtt Worker0.PrivateIp