メインコンテンツまでスキップ
バージョン: User Guides (BYOC)

EKS IAM ロールの作成

このページでは、Zilliz Cloud プロジェクト用に EKS クラスターをデプロイするための IAM ロールを作成し、設定する方法について説明します。

📘Notes

Zilliz BYOC は現在一般提供中です。アクセスおよび実装の詳細については、Zilliz Cloud の営業担当者にお問い合わせください。

手順

AWS コンソールを使用して EKS ロールを作成できます。代替方法として、Zilliz Cloud が提供する Terraform スクリプトを使用して、AWS 上の Zilliz Cloud プロジェクトのインフラストラクチャをブートストラップすることもできます。詳細については、Terraform Provider を参照してください。

ステップ 1: IAM ロールの作成

このステップでは、Zilliz Cloud に代わって EKS クラスターを管理できるよう、AWS 上に IAM ロールを作成し、そのロールの ARN を Zilliz Cloud コンソールに貼り付けます。

1

管理者権限を持つユーザーとして AWS コンソールにログインし、IAM ダッシュボードへ移動します。

2

アカウント情報を展開し、AWS アカウント ID の先頭にあるコピーボタンをクリックします。

3

左側のサイドバーでロールsタブをクリックし、次にCreate ロールをクリックします。

4

Select trusted entityで、カスタム信頼ポリシータイルをクリックします。共通信頼ポリシーセクションのエディターに、以下の信頼 JSON を貼り付け、{accountId} をご自身のAWS アカウント IDに置き換えます。

{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Principal" : {
"Service" : "eks-nodegroup.amazonaws.com"
},
"Action" : "sts:AssumeRole"
},
{
"Sid" : "EKSClusterAssumeRole",
"Effect" : "Allow",
"Principal" : {
"Service" : "eks.amazonaws.com"
},
"Action" : "sts:AssumeRole"
},
{
"Sid" : "EKSNodeAssumeRole",
"Effect" : "Allow",
"Principal" : {
"Service" : "ec2.amazonaws.com"
},
"Action" : "sts:AssumeRole"
},
{
"Effect" : "Allow",
"Principal" : {
"Federated" : "arn:aws:iam::{accountId}:oidc-provider/eks_oidc_url"
},
"Action" : "sts:AssumeRoleWithWebIdentity",
"Condition" : {
"StringEquals" : {
"eks_oidc_url:aud" : "sts.amazonaws.com",
"eks_oidc_url:sub" : "system:serviceaccount:kube-system:aws-load-balancer-controller"
}
}
},
{
"Effect" : "Allow",
"Principal" : {
"Federated" : "arn:aws:iam::{accountId}:oidc-provider/eks_oidc_url"
},
"Action" : "sts:AssumeRoleWithWebIdentity",
"Condition" : {
"StringEquals" : {
"eks_oidc_url:sub" : "system:serviceaccount:kube-system:ebs-csi-controller-sa",
"eks_oidc_url:aud" : "sts.amazonaws.com"
}
}
},
{
"Effect" : "Allow",
"Principal" : {
"Federated" : "arn:aws:iam::{accountId}:oidc-provider/eks_oidc_url"
},
"Action" : "sts:AssumeRoleWithWebIdentity",
"Condition" : {
"StringEquals" : {
"eks_oidc_url:sub" : "system:serviceaccount:kube-system:cluster-autoscaler",
"eks_oidc_url:aud" : "sts.amazonaws.com"
}
}
}
]
}
5

Next をクリックし、権限の追加をスキップします。

6

名前を付けて確認し、作成 ステップで、ロールに名前を付け、信頼されたエンティティを確認して、Create role をクリックします。

7

ロールが作成されたら、緑色のバーにある View role をクリックしてロールの詳細ページへ移動します。

8

ロールの ARN の前にあるコピーアイコンをクリックします。

9

Zilliz Cloud コンソールに戻り、EKS 設定 の下の IAM ロール ARN にロールの ARN を貼り付けます。

Step 2: Add permissions

このステップでは、EKS ロールにいくつかの権限を追加します。ロールの詳細ページで、Permissions タブをクリックします。権限ポリシー セクションで、Add permissions をクリックします。このステップでは、ポリシーのアタッチ を選択し、次に Create inline policy を選択して、異なるソースから複数のポリシーを追加する必要があります。

Attach AWS-managed policies

以下の表は、アタッチ済みポリシーとして追加する権限の一覧です。必要な権限を表示するには、表の Permissions 列の項目をクリックしてください。

Permissions

Managed by

Description

AmazonEC2ContainerRegistryReadOnly

AWS

Provides read-only access to Amazon EC2 Container Registry repositories.

AmazonEKS_CNI_Policy

AWS

Provides the Amazon VPC CNI Plugin (amazon-vpc-cni-k8s) the permissions it requires to modify the IPアドレス configuration on your EKS worker nodes.

AmazonEKSWorkerNodePolicy

AWS

Allows Amazon EKS worker nodes to connect to Amazon EKS Clusters.

AmazonEKSClusterPolicy

AWS

Provides Kubernetes the permissions it requires to manage resources on your behalf.

AmazonEKSVPCResourceController

AWS

Allows VPC Resource Controller to manage ENI and IPs for worker nodes.

ポリシーのアタッチ を選択した後、表示されるページの その他の権限ポリシー セクションで、上記に記載されている各 AWS マネージドポリシーの名前を検索ボックスに入力し、その前のラジオボタンを選択します。必要なすべてのポリシーを選択したら、Add permissions をクリックします。

これらのポリシーが Permissions ポリシーリストに表示されていることを確認できます。

📘Notes

EKS クラスターの作成時に、クラスターと共に 2 つの service-linked roles も自動的に作成されます。それらは AmazonEKSServiceロールPolicyAWSServiceロールForAmazonEKSNodegroup です。これら 2 つのロールは、Amazon EKS がお客様に代わって他の AWS サービスを呼び出すために必要です。

Create inline policies

以下の表は、カスタマーインラインポリシーとして追加する必要があるポリシーの一覧です。必要な権限を表示するには、表の Permissions 列の項目をクリックしてください。

Permissions

Managed by

Description

AWS Load Balancer Controller

Kubernetes SIGs

AWS Load Balancer Controller is a controller to help manage Elastic Load Balancers for a Kubernetes cluster.

For details on the AWS Load Balancer Controller repository, refer to the README file.

Amazon EBS CSI driver

Kubernetes SIGs

The Amazon Elastic Block Store Container Storage Interface (CSI) Driver provides a CSI interface used by Container Orchestrators to manage the lifecycle of Amazon EBS volumes.

For details on the Amazon EBS CSI driver, refer to the README file.

Cluster AutoScaler

Kubernetes SIGs

The Cluster AutoScaler is a component that automatically adjusts the size of a Kubernetes Cluster so that all pods have a place to run and there are no unneeded nodes.

For details on the Cluster AutoScaler on AWS, refer to the README file.

Create inline policy を選択した後、権限の指定 ページで、ポリシーエディター セクションの JSON をクリックしてポリシーエディターを開きます。次に、上記の権限のいずれかをコピーしてポリシーエディターに貼り付けます。

Next をクリックし、ポリシーの詳細ポリシー名 を設定します。記載されているすべてのインラインポリシーを追加したら、Create policy をクリックします。これらのポリシーが Permissions ポリシーリストに表示されていることを確認できます。