Movatterモバイル変換


[0]ホーム

URL:


Oracle Cloud Infrastructure Documentation


Skip to main content

Policy Configuration for Cluster Creation and Deployment

Find out about the IAM policies to create before using Kubernetes Engine (OKE).

When a tenancy is created, an Administrators group is automatically created for the tenancy in OCI Identity and Access Management (IAM). Users that are members of the Administrators group can perform any operation on resources in the tenancy. If all the users that will be working with Kubernetes Engine are already members of the Administrators group, there's no need to create other policies.

However, if you want to enable users that are not members of the Administrators group to use Kubernetes Engine, you must create policies to enable the groups to which those users do belong to perform operations on resources in the tenancy or in individual compartments. Some policies are required, some are optional. SeeCreate Required Policy for Groups andCreate One or More Additional Policies for Groups.

You also have to create additional policies if you want to:

If you want groups of users in one tenancy to access cluster-related resources in other tenancies, you have to create special cross-tenancy policy statements that explicitly state the resources that can be accessed and shared. SeeAccessing Cluster-Related Resources Across Tenancies.

As well as the above policies managed by IAM, you can also use the Kubernetes RBAC Authorizer to enforce additional fine-grained access control for users on specific clusters using Kubernetes RBAC roles and clusterroles (seeAbout Access Control and Kubernetes Engine (OKE). These Kubernetes RBAC rules control what authenticated users and service accounts can do within the cluster, such as deploying workloads or accessing secrets, using the Kubernetes API.

Note that an OCI IAM policy that refers to a network source (such asallow any-user to use clusters in tenancy where request.networkSource.name='corpnet') cannot be used to access the Kubernetes API (for example, when using kubectl). For more information about network sources, seeIntroduction to Network Sources.

Create Required Policy for Groups

To create, update, and delete clusters and node pools, users that are not members of the Administrators group must have permissions to work with cluster-related resources. To give users the necessary access, you must create a policy with a number of required policy statements for the groups to which those users do belong:

  1. Open thenavigation menu  and selectIdentity & Security. UnderIdentity, selectPolicies. A list of the policies in the compartment you're viewing is displayed.
  2. Select the tenancy's root compartment or an individual compartment containing cluster-related resources from theCompartment filter.
  3. SelectCreate Policy.
  4. Enter the following:

  5. SelectCreate.

Create One or More Additional Policies for Groups

To enable users that are not members of the Administrators group to use Kubernetes Engine, create additional policies to enable the groups to which those users do belong to perform operations on cluster-related resources as follows:

  1. Open thenavigation menu  and selectIdentity & Security. UnderIdentity, selectPolicies. A list of the policies in the compartment you're viewing is displayed.
  2. Select the tenancy's root compartment or an individual compartment containing cluster-related resources from theCompartment filter.
  3. SelectCreate Policy.
  4. Enter the following:

  5. SelectCreate.

Create Policy to Set Up and Use Virtual Nodes

Create Policy to Access User-Managed Encryption Keys for Encrypting Boot Volumes, Block Volumes, and/or File Systems

To specify a particular user-managed master encryption key from theVault service to encrypt data in boot volumes, block volumes, and/or file systems, you have to create a policy to allow access to that master encryption key. For more information about specifying user-managed encryption keys:

Note that before you can create the policy, you have to know the master encryption key's OCID (seeManaging Keys).

To create a policy to allow access to a user-managed master encryption key:

  1. Open thenavigation menu  and selectIdentity & Security. UnderIdentity, selectPolicies. A list of the policies in the compartment you're viewing is displayed.
  2. Select the tenancy's root compartment or an individual compartment containing cluster-related resources from theCompartment filter.
  3. SelectCreate Policy, follow the instructions inTo create a policy, and give the policy a name (for example,acme-oke-keys-policy).
  4. For boot volumes: To use a master encryption key from the Vault service to encrypt data in boot volumes, enter the following policy statements to grant access to the master encryption key:

    Allow group <group-name> to read keys in compartment <compartment-name> where target.key.id = '<key_OCID>'
    Allow service oke to use key-delegates in compartment <compartment-name> where target.key.id = '<key_OCID>'
    Allow service blockstorage to use keys in compartment <compartment-name> where target.key.id = '<key_OCID>'
    Allow any-user to use key-delegates in compartment <compartment-name> where ALL {request.principal.type='nodepool', target.key.id = '<key_OCID>'}

    where:

    • <group-name> is a group to which you belong. Note that if a group is not in the default identity domain, prefix the group name with the identity domain name, in the formatgroup '<identity-domain-name>'/'group-name'. You can also specify a group using its OCID, in the formatgroup id <group-ocid>.
    • <compartment-name> is the name of the compartment containing the master encryption key.
    • <key-OCID> is the OCID of the master encryption key in Vault.

    For example:

    Allow group acme-dev-team to read keys in compartment acme-kms-key-compartment where target.key.id = 'ocid1.key.oc1.iad.anntl______usjh'Allow service oke to use key-delegates in compartment acme-kms-key-compartment where target.key.id = 'ocid1.key.oc1.iad.anntl______usjh'Allow service blockstorage to use keys in compartment acme-kms-key-compartment where target.key.id = 'ocid1.key.oc1.iad.anntl______usjh'Allow any-user to use key-delegates in compartment acme-kms-key-compartment where ALL {request.principal.type='nodepool', target.key.id = 'ocid1.key.oc1.iad.anntl______usjh'}
    Note

    After August 15, 2024, create theAllow any-user... policy statement as shown, namely:

    Allow any-user to use key-delegates in <compartment-name> where ALL {request.principal.type='nodepool', target.key.id = '<key_OCID>'}

    Note that before August 15, 2024, you had to define the followingAllow service oke... policy statement:

    Allow service oke to use key-delegates in compartment <compartment-name> where target.key.id = '<key_OCID>'

    If such anAllow service oke... policy statement already exists, keep this existing policy statement, and create the newAllow any-user... policy statement in addition to the existing policy statement.

  5. For block volumes: To use a master encryption key from the Vault service to encrypt data in block volumes, enter policy statements to grant access to the master encryption key in the format:

    Allow service blockstorage to use keys in compartment <compartment-name> where target.key.id = '<key-ocid>'
    Allow any-user to use key-delegates in compartment <compartment-name> where ALL {request.principal.type = 'cluster', target.key.id = '<key-ocid>'}

    where:

    • <compartment-name> is the name of the compartment containing the master encryption key.
    • <key-OCID> is the OCID of the master encryption key in Vault.

    For example:

    Allow service blockstorage to use keys in compartment acme-kms-key-compartment where target.key.id = 'ocid1.key.oc1.iad.anntl______usjh'Allow any-user to use key-delegates in compartment acme-kms-key-compartment where ALL {request.principal.type = 'cluster', target.key.id = 'ocid1.key.oc1.iad.anntl______usjh'}
  6. For file systems: To use a master encryption key from the Vault service to encrypt data in file systems, enter policy statements to grant access to the master encryption key in the format:

    Allow dynamic-group <dynamic-group-name> to use keys in compartment <key-compartment-name>
    Allow any-user to use key-delegates in compartment <compartment-name> where ALL {request.principal.type = 'cluster', target.key.id = '<key_OCID>'}

    where:

    • <dynamic-group-name> is the name of thedynamic group of file systems in the compartment.

      An example rule for the dynamic group follows:

      ALL { resource.type='filesystem', resource.compartment.id = '<file_system_compartment_OCID>' }

      Note that if a dynamic group is not in the default identity domain, prefix the dynamic group name with the identity domain name, in the formatdynamic-group '<identity-domain-name>'/'<dynamic-group-name>'. You can also specify the dynamic group using its OCID, in the formatdynamic-group id <dynamic-group-ocid>.

    • <compartment-name> is the name of the compartment containing the master encryption key.
    • <key_OCID> is the OCID of the master encryption key in Vault.

    For example:

    Allow dynamic-group FssFileSystems to use keys in compartment acme-kms-key-compartmentAllow any-user to use key-delegates in compartment acme-kms-key-compartment where ALL {request.principal.type = 'cluster', target.key.id = 'ocid1.key.oc1.iad.anntl______usjh'}
  7. SelectCreate.

[8]ページ先頭

©2009-2025 Movatter.jp