仮想ノードの使用に必要なIAMポリシー

Kubernetes Engine (OKE)で仮想ノードを使用するために作成するIAMポリシーについて学習します。

仮想ノードを使用する前に、常に少なくとも1つのIAMポリシーを設定する必要があります。これは、テナンシ管理者と非管理者ユーザーの両方がすべての状況で必要になります。管理者以外のユーザーが仮想ノードを使用できるようにするには、追加のポリシーも設定する必要があります。

  • すべての状況で、テナンシ管理者と非管理者ユーザーの両方に必要です:仮想ノードおよび仮想ノード・プールでクラスタを作成および使用するには、次が必要ですKubernetesエンジン・サービスを承認して、仮想ノードがテナンシ内のVCNのサブネットに接続されたVNICを使用してKubernetesエンジン・サービス・テナンシにコンテナ・インスタンスを作成できるようにします。次に示すとおり、次のポリシー・ステートメントを使用して、ルート・コンパートメントにポリシーを作成します:

    define tenancy ske as ocid1.tenancy.oc1..aaaaaaaacrvwsphodcje6wfbc3xsixhzcan5zihki6bvc7xkwqds4tqhzbaq
     
    define compartment ske_compartment as ocid1.compartment.oc1..aaaaaaaa2bou6r766wmrh5zt3vhu2rwdya7ahn4dfdtwzowb662cmtdc5fea
     
    endorse any-user to associate compute-container-instances in compartment ske_compartment of tenancy ske with subnets in tenancy where ALL {request.principal.type='virtualnode',request.operation='CreateContainerInstance',request.principal.subnet=2.subnet.id}
     
    endorse any-user to associate compute-container-instances in compartment ske_compartment of tenancy ske with vnics in tenancy where ALL {request.principal.type='virtualnode',request.operation='CreateContainerInstance',request.principal.subnet=2.subnet.id}
     
    endorse any-user to associate compute-container-instances in compartment ske_compartment of tenancy ske with network-security-group in tenancy where ALL {request.principal.type='virtualnode',request.operation='CreateContainerInstance'}
  • 管理者以外のユーザーにも必要:仮想ノードおよび仮想ノード・プールを含むクラスタを作成して使用するには、ユーザーに必要な権限を付与する必要があります。これらの権限を付与するには、次のポリシー・ステートメントを使用してIAMポリシーを作成します:

    allow group <group-name> to manage cluster-virtualnode-pools in compartment <compartment-name>
    allow group <group-name> to read virtual-network-family in compartment <compartment-name>
    allow group <group-name> to manage vnics in compartment <compartment-name>

    グループがデフォルトのアイデンティティ・ドメインにない場合は、group '<identity-domain-name>'/'group-name'の形式で、グループ名の前にアイデンティティ・ドメイン名を追加します。group id <group-ocid>の形式で、そのOCIDを使用してグループを指定することもできます。