目次

Search

  1. はじめに
  2. 詳細クラスタ
  3. AWSの設定
  4. Google Cloudの設定
  5. Microsoft Azureの設定
  6. セルフサービスクラスタの設定
  7. ローカルクラスタの設定
  8. 詳細設定
  9. トラブルシューティング
  10. 付録 A: コマンドリファレンス

詳細クラスタ

詳細クラスタ

手順8.3. ワーカーポリシーの作成

手順8.3. ワーカーポリシーの作成

ワーカーロールのIAMポリシーを作成します。インラインポリシーまたは管理対象ポリシーとして各ポリシーを定義できます。
次の表で、各IAMポリシーについて説明します。
ポリシー
説明
minimal_worker_policy
必須。ワーカーロールに最小限の権限を提供します。
ebs_autoscaling_worker_policy
EBSボリュームが自動スケールの場合にのみ必要。
staging_log_access_worker_policy
必須。ステージングとログの場所へのアクセスを提供します。
init_script_worker_policy
初期化スクリプトを使用する場合にのみ必要です。初期化スクリプトパスと、初期化スクリプトおよびクラウド初期化ログを保存する場所へのアクセスを提供します。
各権限とそれが必要な理由については、IAMポリシーリファレンスを参照してください。ポリシーの編集の詳細については、マスタおよびワーカーポリシーの制限に関するリファレンスを参照してください。
generate-policies-for-userdefined-roles.sh
コマンドを実行してポリシーコンテンツを生成することもできます。コマンドの詳細については、generate-policies-for-userdefined-roles.shを参照してください。このコマンドは出力ファイル
my-userdefined-master-worker-role-policies.json
を作成します。

minimal_worker_policy

IAMポリシー
minimum_worker_policy
は、ユーザー定義のワーカーロールの最小要件を一覧表示します。
次のJSONドキュメントを
minimal_worker_policy
のテンプレートとして使用できます。
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:DescribeInstances", "ec2:DescribeRegions" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "ec2:CreateTags" ], "Resource": [ "arn:aws:ec2:*:*:volume/*" ] }, { "Effect": "Allow", "Action": [ "autoscaling:DescribeAutoScalingInstances", "autoscaling:DescribeTags" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "s3:Get*" ], "Resource": [ "arn:aws:s3:::<cluster-staging-dir1>/*" ] }, { "Effect": "Allow", "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey" ], "Resource": [ "*" ] } ] }

ebs_autoscaling_worker_policy

IAMポリシー
ebs_autoscaling_worker_policy
は、EBSボリュームを自動スケーリングするために、ワーカーノードで必要になります。
次のJSONドキュメントを
ebs_autoscaling_worker_policy
のテンプレートとして使用できます。
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "ec2:DescribeVolumes", "ec2:CreateVolume", "ec2:ModifyInstanceAttribute" ], "Effect": "Allow", "Resource": [ "*" ] }, { "Action": [ "ec2:CreateTags" ], "Effect": "Allow", "Resource": [ "arn:aws:ec2:*:*:volume/*" ] }, { "Action": [ "ec2:AttachVolume", "ec2:DetachVolume" ], "Condition": { "StringLike": { "ec2:ResourceTag/KubernetesCluster": "*.k8s.local" } }, "Effect": "Allow", "Resource": [ "arn:aws:ec2:*:*:instance/*" ] }, { "Action": [ "ec2:AttachVolume", "ec2:DetachVolume", "ec2:DeleteVolume" ], "Condition": { "StringLike": { "ec2:ResourceTag/CREATED_BY": "infa-storage-scalerd-*" } }, "Effect": "Allow", "Resource": [ "arn:aws:ec2:*:*:volume/*" ] } ] }

staging_log_access_worker_policy

IAMポリシー
taging_log_access_worker_policy
は、クラスタコンピューティングシステムがワーカーノードにステージングディレクトリおよびログディレクトリへのアクセスを許可するために必要になります。
次のJSONドキュメントを
staging_log_access_worker_policy
のテンプレートとして使用できます。
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:GetEncryptionConfiguration", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::<cluster-staging-bucket-name1>", "arn:aws:s3:::<cluster-logging-bucket-name1>" ] }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObjectAcl", "s3:GetObject", "s3:DeleteObject", "s3:PutObjectAcl" ], "Resource": [ "arn:aws:s3:::<cluster-staging-dir1>/*", "arn:aws:s3:::<cluster-logging-dir1>/*" ] }, { "Effect": "Allow", "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey" ], "Resource": [ "*" ] } ] }

init_script_worker_policy

IAMポリシー
staging_log_access_worker_policy
は、クラスタコンピューティングシステムがワーカーノードにクラスタの初期化スクリプトディレクトリおよび初期化スクリプトログディレクトリへのアクセスを許可するために必要になります。
次のJSONドキュメントを
init_script_worker_policy
のテンプレートとして使用できます。
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::<cluster-init-script-bucket-name1>" ] }, { "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::<cluster-init-script-dir1>/*" ] } ] }