You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -143,7 +144,7 @@ If you need to change the default VCN's CIDR, note the following:
143
144
144
145
The bastion host parameters concern whether you want to enable the bastion. 1 parameter to keep in mind here is the enable_instance_principal. Be aware that if this is enabled, it gives API access to the bastion host without authentication.
145
146
146
-
Read more about {uri-oci-instance-principal}[instance_principal].
147
+
Read {uri-instructions}#enabling-instance_principal-on-the-bastion-host[more] about {uri-oci-instance-principal}[instance_principal].
147
148
148
149
{uri-terraform-options}#bastion-host[Reference]
149
150
@@ -213,3 +214,16 @@ The calico parameters control the installation of {uri-calico}[Calico] for {uri-
213
214
The Kubernetes Metrics Server parameter controls the installation of {uri-metrics-server}[Kubernetes Metrics Server]. *Required* for {uri-kubernetes-hpa}[Horizontal Pod Autoscaling].
The KMS integration parameters control whether {uri-oci-kms}[OCI Key Management Service] will be used for encrypting Kubernetes secrets. Additionally, the bastion host must be enabled as well as instance_principal on the bastion.
. link:#creating-the-oke-cluster[Creating the OKE Cluster]
44
47
. link:#adding-the-bastion-host[Adding the bastion host]
45
48
. link:#using-the-bastion-host[Using the bastion host]
49
+
.. link:#enabling-instance_principal-on-the-bastion-host[Enabling instance_principal on the bastion host]
50
+
.. link:#disabling-instance_principal-on-the-bastion-host[Disabling instance_principal on the bastion host]
51
+
.. link:#recommendations-for-using-instance_principal[Recommendations for using instance_principal]
46
52
. link:#interacting-with-the-oke-cluster-locally[Interacting with the OKE Cluster locally]
47
53
. link:#creating-an-auth-token-for-ocir[Creating an auth token for OCIR]
48
54
. link:#installing-helm[Installing helm]
@@ -60,6 +66,18 @@ This section assumes you have completed the following:
60
66
. all the {uri-prereqs}[pre-requisites]
61
67
. all the required {uri-configuration}[configuration]
62
68
69
+
=== KMS Integration
70
+
71
+
If you wish to use {uri-oci-kms}[OCI KMS] to encrypt Kubernetes secrets, the following is required:
72
+
73
+
* the Terraform user must have the following rights
74
+
** manage dynamic groups
75
+
** manage policies in root tenancy
76
+
* link:#adding-the-bastion-host[bastion must be enabled]
77
+
* link:#enabling-instance_principal-on-the-bastion-host[bastion instance_principal must be enabled]
78
+
* use_encryption must be set to _true_
79
+
* existing_key_id must be provided
80
+
63
81
=== Creating the OKE Cluster
64
82
65
83
Initialize a working directory containing Terraform configuration files:
@@ -116,6 +134,51 @@ A utility script is also generated that contains the command to ssh to the basti
116
134
scripts/tesseract.sh
117
135
----
118
136
137
+
==== Enabling instance_principal on the bastion host
138
+
{uri-oci-instance-principal}[instance_principal] is an IAM service feature that enables instances to be authorized actors (or principals) to perform actions on service resources. Each compute instance has its own identity, and it authenticates using the certificates that are added to it. These certificates are automatically created, assigned to instances and rotated, preventing the need for you to distribute credentials to your hosts and rotate them.
139
+
140
+
Any user who has access to the instance (who can SSH to the instance), automatically inherits the privileges granted to the instance. Before you enable this feature, ensure that you know who can access it, and that they should be authorized with the permissions you are granting to the instance.
141
+
142
+
By default, this feature is *_disabled_*. However, it is *_required_* at the time of cluster creation *_if_* you wish to enable link:#kms-integration[KMS Integration].
143
+
144
+
When you enable this feature, by default, the bastion has privileges to all resources in the compartment. If you are enabling it for link:#kms-integration[KMS Integration], the bastion host will also have rights to create policies in the root tenancy.
145
+
146
+
You can also turn on and off the feature at any time without impact on the bastion or the cluster.
147
+
148
+
To enable, set enable_instance_principal to true:
149
+
150
+
----
151
+
enable_instance_principal = "true"
152
+
----
153
+
154
+
and verify:
155
+
156
+
----
157
+
oci network vcn list --compartment-id <compartment-ocid>
158
+
----
159
+
160
+
==== Disabling instance_principal on the bastion host
161
+
162
+
. Set enable_instance_principal to false in terraform.tfvars
163
+
164
+
+
165
+
----
166
+
enable_instance_principal = false
167
+
----
168
+
169
+
. Run terraform apply again:
170
+
171
+
+
172
+
----
173
+
terraform apply
174
+
----
175
+
176
+
==== Recommendations for using instance_principal
177
+
178
+
. Do not enable instance_principal if you are not using link:#kms-integration[KMS Integration]
179
+
. Enable instance_principal *_if and only if_* you are using link:#kms-integration[KMS Integration]
180
+
. Disable instance_principal once the cluster is created
181
+
119
182
=== Interacting with the OKE Cluster locally
120
183
121
184
kubectl installed in bastion host by default and the kubeconfig file is set in the default location (~/.kube/config) so you don't need to set the KUBECONFIG environment variable every time you log in to the bastion. An alias "*k*" will be created for kubectl on the bastion host.
@@ -28,13 +31,21 @@ This section will guide you through the pre-requisites before you can use this p
28
31
29
32
You can proceed to {uri-instructions}[creating the cluster] if you have already done these.
30
33
34
+
. link:#identity-and-access-management-rights[Identity and Access Management Rights]
31
35
. link:#install-terraform[Install Terraform]
32
36
. link:#generate-api-keys[Generate API Keys]
33
37
. link:#upload-your-api-keys[Upload API Keys]
34
38
. link:#create-an-oci-compartment[Create an OCI Compartment]
35
39
. link:#obtain-the-necessary-ocids[Obtain the necessary OCIDs]
36
40
. link:#configure-oci-policy-for-oke[Configure OCI Policy for OKE]
37
41
42
+
== Identity and Access Management Rights
43
+
44
+
The Terraform user must have the rights to:
45
+
46
+
. manage dynamic groups
47
+
. manage policies in root tenancy
48
+
38
49
== Install Terraform
39
50
40
51
Start by installing Terraform and configuring your path.
@@ -108,6 +119,8 @@ To obtain the compartment OCID:
108
119
2. Click on your Compartment
109
120
3. Locate OCID on the page and click on 'Copy'
110
121
122
+
If you wish to encrypt Kubernetes secrets with a key from {uri-oci-kms}[OCI KMS], you also need to create {uri-oci-managing-vaults}[a vault] and {uri-oci-managing-keys}[a key] and obtain the key id.
123
+
111
124
== Configure OCI Policy for OKE
112
125
113
126
Follow the documentation for {uri-oci-oke-policy}[to create the necessary OKE policy].
statements=["Allow dynamic-group ${oci_identity_dynamic_group.instance_principal[0].name} to manage all-resources in compartment ${data.oci_identity_compartments.compartments_name.compartments.0.name}"]
37
+
description="policy to allow bastion host to call services"
statements=["Allow dynamic-group ${oci_identity_dynamic_group.bastion_instance_principal[0].name} to manage all-resources in compartment ${data.oci_identity_compartments.compartments_name.compartments.0.name}"]
0 commit comments