Skip to content

Commit ae84282

Browse files
Merge pull request #20 from oracle/tinglwan_fix_adb_prerequisites_doc
update ADB_PREREQUISITES.md
2 parents b1c8f34 + e918b3f commit ae84282

File tree

6 files changed

+50
-30
lines changed

6 files changed

+50
-30
lines changed

docs/adb/ADB_PREREQUISITES.md

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
## Oracle Autonomous Database (ADB) Prerequisites
44

5-
Oracle Database Operator for Kubernetes must have access to OCI services.
5+
Oracle Database Operator for Kubernetes must have access to OCI services.
66

77
To provide access, choose **one of the following approaches**:
88

99
* The provider uses [API Key authentication](#authorized-with-api-key-authentication)
1010

1111
* The Kubernetes cluster nodes are [granted with Instance Principal](#authorized-with-instance-principal)
1212

13-
### Authorized with API Key Authentication
13+
## Authorized with API Key Authentication
1414

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.
1716

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`.
1918

2019
```sh
2120
./set_ocicredentials.sh run
@@ -45,56 +44,77 @@ kubectl create secret generic oci-privatekey \
4544
4645
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.
4746

48-
### Authorized with Instance Principal
47+
## Authorized with Instance Principal
4948

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:
5150

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)
5353

54-
To set up Instance Principle authorization:
54+
### Define Dynamic Group
5555

56-
1. Get the `compartment OCID`:
56+
1. Go to the **Dynamic Groups** page, and click **Create Dynamic Group**.
5757

58-
Log in to the cloud console, and click **Compartment**.
59-
60-
![compartment-1](/images/adb/compartment-1.png)
61-
62-
Choose the compartment where the cluster creates instances, and **copy** the OCID in the details page.
58+
![instance-principal-1](/images/adb/instance-principal-1.png)
6359

64-
![compartment-2](/images/adb/compartment-2.png)
60+
2. In the **Matching Rules** section, write rules the to include the OKE nodes in the dynamic group.
6561

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.
6763

68-
Go to the **Dynamic Groups** page, and click **Create Dynamic Group**.
64+
```sh
65+
All {instance.compartment.id = '<compartment-OCID>'}
66+
```
6967

70-
![instance-principal-1](/images/adb/instance-principal-1.png)
68+
![instance-principal-2](/images/adb/instance-principal-2.png)
7169

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.
7371

7472
```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>'}
7674
```
7775

78-
![instance-principal-2](/images/adb/instance-principal-2.png)
76+
![instance-principal-3](/images/adb/instance-principal-3.png)
77+
78+
3. To apply the rules, click **Create**.
79+
80+
### Define Policies
7981

80-
To apply the rules, click **Create**.
82+
1. Get the `compartment name` where the database resides:
8183

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+
![adb-id-1](/images/adb/adb-id-1.png)
89+
90+
Copy the name of the compartment in the details page.
91+
92+
![instance-principal-4](/images/adb/instance-principal-4.png)
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:
8395

8496
Go to **Policies**, and click **Create Policy**.
8597

86-
![instance-principal-3](/images/adb/instance-principal-3.png)
98+
![instance-principal-5](/images/adb/instance-principal-5.png)
8799

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
89101

90102
```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>
92104
```
93105

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).
95107

96108
```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
98110
```
99111

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.

images/adb/adb-id-1.png

-9.85 KB
Loading

images/adb/instance-principal-2.png

-10.4 KB
Loading

images/adb/instance-principal-3.png

-28.5 KB
Loading

images/adb/instance-principal-4.png

19.7 KB
Loading

images/adb/instance-principal-5.png

74.6 KB
Loading

0 commit comments

Comments
 (0)