Skip to content

Commit 07fb85a

Browse files
Add documentation for using instance principals (#50)
1 parent b29ceff commit 07fb85a

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

docs/src/gs/install-cluster-api.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,48 @@
2323
```
2424
2525
## Configure authentication
26+
Before installing Cluster API Provider for OCI (CAPOCI), you must first set up your preferred
27+
authentication mechanism using specific environment variables.
2628
27-
Before installing Cluster API Provider for OCI (CAPOCI), you must first set up your preferred authentication mechanism using specific environment variables:
29+
### User Principal
30+
If the management cluster is hosted outside OCI, for example a Kind cluster, please configure
31+
user principal using the following parameters. Please refer to the [doc][api-signing-key] to generate the required
32+
credentials.
2833
2934
```bash
30-
export OCI_TENANCY_ID=<tenancy-id>
31-
export OCI_USER_ID=<user-id>
32-
export OCI_CREDENTIALS_FINGERPRINT=<fingerprint>
33-
export OCI_REGION=<region>
35+
export OCI_TENANCY_ID=<insert-tenancy-id-here>
36+
export OCI_USER_ID=<insert-user-ocid-here>
37+
export OCI_CREDENTIALS_FINGERPRINT=<insert-fingerprint-here>
38+
export OCI_REGION=<insert-region-here>
3439
# if Passphrase is present
35-
export OCI_CREDENTIALS_PASSPHRASE=<passphrase>
3640
export OCI_TENANCY_ID_B64="$(echo -n "$OCI_TENANCY_ID" | base64 | tr -d '\n')"
3741
export OCI_CREDENTIALS_FINGERPRINT_B64="$(echo -n "$OCI_CREDENTIALS_FINGERPRINT" | base64 | tr -d '\n')"
3842
export OCI_USER_ID_B64="$(echo -n "$OCI_USER_ID" | base64 | tr -d '\n')"
3943
export OCI_REGION_B64="$(echo -n "$OCI_REGION" | base64 | tr -d '\n')"
40-
export OCI_CREDENTIALS_KEY_B64=$(base64 < <path-to-api-private-key-file> | tr -d '\n')
44+
export OCI_CREDENTIALS_KEY_B64=$(base64 < <insert-path-to-api-private-key-file-here> | tr -d '\n')
4145
# if Passphrase is present
46+
export OCI_CREDENTIALS_PASSPHRASE=<insert-passphrase-here>
4247
export OCI_CREDENTIALS_PASSPHRASE_B64="$(echo -n "$OCI_CREDENTIALS_PASSPHRASE" | base64 | tr -d '\n')"
4348
```
4449

50+
### Instance Principal
51+
52+
If the management cluster is hosted in Oracle Cloud Infrastructure, [Instance principals][instance-principals] authentication
53+
is recommended. Export the following parameters to use Instance Principals. If Instance Principals are used, the user principal
54+
parameters explained in above section will not be used.
55+
56+
```bash
57+
export USE_INSTANCE_PRINCIPAL="true"
58+
export USE_INSTANCE_PRINCIPAL_B64="$(echo -n "$USE_INSTANCE_PRINCIPAL" | base64 | tr -d '\n')"
59+
```
60+
Please ensure the following policies in the dynamic group for CAPOCI to be able to talk to various OCI Services.
61+
62+
```
63+
allow dynamic-group [your dynamic group name] to read instance-family in compartment [your compartment name]
64+
allow dynamic-group [your dynamic group name] to use virtual-network-family in compartment [your compartment name]
65+
allow dynamic-group [your dynamic group name] to manage load-balancers in compartment [your compartment name]
66+
```
67+
4568
## Initialize management cluster
4669

4770
Initialize management cluster and install CAPOCI
@@ -63,3 +86,5 @@ When installing CAPOCI, the following components will be installed in the manage
6386
Please inspect the `infrastructure-components.yaml` present in the release artifacts to know more.
6487

6588
[kind]: https://kind.sigs.k8s.io/
89+
[api-signing-key]: https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm
90+
[instance-principals]: https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm

docs/src/gs/install-oci-ccm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ allow dynamic-group [your dynamic group name] to manage load-balancers in compar
6969
[ccm]: https://kubernetes.io/docs/concepts/architecture/cloud-controller/
7070
[oci-ccm]: https://github.com/oracle/oci-cloud-controller-manager
7171
[oci-ccm-release-page]: https://github.com/oracle/oci-cloud-controller-manager/releases
72+
[instance-principals]: https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm

0 commit comments

Comments
 (0)