|
2 | 2 |
|
3 | 3 | ## Oracle Autonomous Database (ADB) Prerequisites
|
4 | 4 |
|
5 |
| -Oracle Database Operator for Kubernetes must have access to OCI services. |
| 5 | +Oracle Database Operator for Kubernetes must have access to OCI services. |
6 | 6 |
|
7 | 7 | To provide access, choose **one of the following approaches**:
|
8 | 8 |
|
9 | 9 | * The provider uses [API Key authentication](#authorized-with-api-key-authentication)
|
10 | 10 |
|
11 | 11 | * The Kubernetes cluster nodes are [granted with Instance Principal](#authorized-with-instance-principal)
|
12 | 12 |
|
13 |
| -### Authorized with API Key Authentication |
| 13 | +## Authorized with API Key Authentication |
14 | 14 |
|
15 |
| -By default, all pods in the Oracle Container Engine for Kubernetes (OKE) are able to access the instance principal certificates, so that the operator calls OCI REST endpoints without any extra step. If you're using OKE, then please proceed to the installation. |
16 |
| -If the operator is deployed in a third-party Kubernetes cluster, then the credentials of the Oracle Cloud Infrastructure (OCI) user are needed. The operator reads these credentials from a ConfigMap and a Secret. |
| 15 | +API keys are supplied by users to authenticate the operator accessing Oracle Cloud Infrastructure (OCI) services. The operator reads the credintials of the OCI user from a ConfigMap and a Secret. If you're using Oracle Container Engine for Kubernetes (OKE), you may alternatively use [Instance Principal](#authorized-with-instance-principal) to avoid the need to configure user credentails or a configuration file. If the operator is deployed in a third-party Kubernetes cluster, then the credentials or a configuration file are needed, since Instance principal authorization applies only to instances that are running in the OCI. |
17 | 16 |
|
18 |
| -Oracle recommends using the helper script `set_ocicredentials.sh` in the root directory of the repository; This script will generate a ConfigMap and a Secret with the OCI credentials. By default, the script parses the **DEFAULT** profile in `~/.oci/config`. The default names of the ConfigMap and the Secret are, respectively: `oci-cred` and `oci-privatekey`. |
| 17 | +Oracle recommends using the helper script `set_ocicredentials.sh` in the root directory of the repository; this script will generate a ConfigMap and a Secret with the OCI credentials. By default, the script parses the **DEFAULT** profile in `~/.oci/config`. The default names of the ConfigMap and the Secret are, respectively: `oci-cred` and `oci-privatekey`. |
19 | 18 |
|
20 | 19 | ```sh
|
21 | 20 | ./set_ocicredentials.sh run
|
@@ -45,56 +44,77 @@ kubectl create secret generic oci-privatekey \
|
45 | 44 |
|
46 | 45 | After creating the ConfigMap and the Secret, use their names as the values of `ociConfigMap` and `ociSecret` attributes in the yaml files for provisioning, binding, and other operations.
|
47 | 46 |
|
48 |
| -### Authorized with Instance Principal |
| 47 | +## Authorized with Instance Principal |
49 | 48 |
|
50 |
| -Instance principal authorization enables the operator to make API calls from an instance (that is, a node) without requiring the `ociConfigMap`, and `ociSecret` attributes in the `.yaml` file. |
| 49 | +Instance principal authorization enables the operator to make API calls from an instance (that is, a node) without requiring the `ociConfigMap`, and `ociSecret` attributes in the `.yaml` file. This approach applies only to instances that are running in the Oracle Cloud Infrastructure (OCI). In general, you will have to: |
51 | 50 |
|
52 |
| -> Note: Instance principal authorization applies only to instances that are running in the Oracle Cloud Infrastructure (OCI). |
| 51 | +* [Define dynamic group that includes the nodes in which the operator runs](#define-dynamic-group) |
| 52 | +* [Define policies that grant to the dynamic group the required permissions for the operator to its OCI interactions](#define-policies) |
53 | 53 |
|
54 |
| -To set up Instance Principle authorization: |
| 54 | +### Define Dynamic Group |
55 | 55 |
|
56 |
| -1. Get the `compartment OCID`: |
| 56 | +1. Go to the **Dynamic Groups** page, and click **Create Dynamic Group**. |
57 | 57 |
|
58 |
| - Log in to the cloud console, and click **Compartment**. |
59 |
| - |
60 |
| -  |
61 |
| - |
62 |
| - Choose the compartment where the cluster creates instances, and **copy** the OCID in the details page. |
| 58 | +  |
63 | 59 |
|
64 |
| -  |
| 60 | +2. In the **Matching Rules** section, write rules the to include the OKE nodes in the dynamic group. |
65 | 61 |
|
66 |
| -2. Create a dynamic group and matching rules: |
| 62 | + Example 1 : enables **all** the resources, including OKE nodes in the compartment, to be members of the dynamic group. |
67 | 63 |
|
68 |
| - Go to the **Dynamic Groups** page, and click **Create Dynamic Group**. |
| 64 | + ```sh |
| 65 | + All {instance.compartment.id = '<compartment-OCID>'} |
| 66 | + ``` |
69 | 67 |
|
70 |
| -  |
| 68 | +  |
71 | 69 |
|
72 |
| - In the **Matching Rules** section, write the following rule. Change `compartment-OCID` to the OCID of your compartment. This rule enables all the resources, including **nodes** in the compartment, to be members of the dynamic group. |
| 70 | + Example 2 : enables the OKE nodes in the compartment, to be members of the dynamic group. |
73 | 71 |
|
74 | 72 | ```sh
|
75 |
| - All {instance.compartment.id = 'compartment-OCID'} |
| 73 | + Any {instance.compartment.id = '<oke-node1-instance-OCID>', instance.compartment.id = '<oke-node2-instance-OCID>', instance.compartment.id = '<oke-node3-instance-OCID>'} |
76 | 74 | ```
|
77 | 75 |
|
78 |
| -  |
| 76 | +  |
| 77 | + |
| 78 | +3. To apply the rules, click **Create**. |
| 79 | + |
| 80 | +### Define Policies |
79 | 81 |
|
80 |
| - To apply the rules, click **Create**. |
| 82 | +1. Get the `compartment name` where the database resides: |
81 | 83 |
|
82 |
| -3. Set up policies for dynamic groups: |
| 84 | + > Note: You may skip this step if the database is in the root compartment. |
| 85 | + |
| 86 | + Go to **Autonomous Database** in the Cloud Console. |
| 87 | + |
| 88 | +  |
| 89 | + |
| 90 | + Copy the name of the compartment in the details page. |
| 91 | + |
| 92 | +  |
| 93 | + |
| 94 | +2. Set up policies for dynamic groups to grant access to its OCI interactions. Use the dynamic group name is from the [Define Dynamic Group](#define-dynamic-group) section, and the compartment name from the previous step: |
83 | 95 |
|
84 | 96 | Go to **Policies**, and click **Create Policy**.
|
85 | 97 |
|
86 |
| -  |
| 98 | +  |
87 | 99 |
|
88 |
| - This example enables the dynamic group to manage all the resources in your tenancy: |
| 100 | + Example 1: enable the dynamic group to manage **all** the resources in a compartment |
89 | 101 |
|
90 | 102 | ```sh
|
91 |
| - Allow dynamic-group <your-dynamic-group> to manage all-resources in tenancy |
| 103 | + Allow dynamic-group <dynamic-group-name> to manage all-resources in compartment <compartment-name> |
92 | 104 | ```
|
93 | 105 |
|
94 |
| - You can also specify a particular resouce access for the dynamic group. This example enables the dynamic group to manage Oracle Autonomous Database in a given compartment: |
| 106 | + Example 2: enable the dynamic group to manage **all** the resources in your tenancy (root compartment). |
95 | 107 |
|
96 | 108 | ```sh
|
97 |
| - Allow dynamic-group <your-dynamic-group> to manage autonomous-database-family in compartment <your-compartment> |
| 109 | + Allow dynamic-group <dynamic-group-name> to manage all-resources in tenancy |
98 | 110 | ```
|
99 | 111 |
|
100 |
| -At this stage, the operator has been granted sufficient permissions to call OCI services. You can now proceed to the installation. |
| 112 | + Example 3: enable a particular resouce access for the dynamic group to manage Oracle Autonomous Database in a given compartment |
| 113 | + |
| 114 | + ```sh |
| 115 | + Allow dynamic-group <dynamic-group-name> to manage autonomous-database-family in compartment <compartment-name> |
| 116 | + ``` |
| 117 | + |
| 118 | +3. To apply the policy, click Create. |
| 119 | + |
| 120 | +At this stage, the instances where the operator deploys have been granted sufficient permissions to call OCI services. You can now proceed to the installation. |
0 commit comments