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 +145,7 @@ If you need to change the default VCN's CIDR, note the following:
143
145
144
146
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
147
146
-
Read more about {uri-oci-instance-principal}[instance_principal].
148
+
Read {uri-instructions}#enabling-instance_principal-on-the-bastion-host[more] about {uri-oci-instance-principal}[instance_principal].
147
149
148
150
{uri-terraform-options}#bastion-host[Reference]
149
151
@@ -213,3 +215,16 @@ The calico parameters control the installation of {uri-calico}[Calico] for {uri-
213
215
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.
** {uri-oci-manage-policies}[manage policies in root tenancy]
78
+
* link:#adding-the-bastion-host[bastion must be enabled]
79
+
* link:#enabling-instance_principal-on-the-bastion-host[bastion instance_principal must be enabled]
80
+
* use_encryption must be set to _true_
81
+
* existing_key_id must be provided
82
+
63
83
=== Creating the OKE Cluster
64
84
65
85
Initialize a working directory containing Terraform configuration files:
@@ -116,6 +136,51 @@ A utility script is also generated that contains the command to ssh to the basti
116
136
scripts/tesseract.sh
117
137
----
118
138
139
+
==== Enabling instance_principal on the bastion host
140
+
{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.
141
+
142
+
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.
143
+
144
+
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].
145
+
146
+
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.
147
+
148
+
You can also turn on and off the feature at any time without impact on the bastion or the cluster.
149
+
150
+
To enable, set enable_instance_principal to true:
151
+
152
+
----
153
+
enable_instance_principal = "true"
154
+
----
155
+
156
+
and verify:
157
+
158
+
----
159
+
oci network vcn list --compartment-id <compartment-ocid>
160
+
----
161
+
162
+
==== Disabling instance_principal on the bastion host
163
+
164
+
. Set enable_instance_principal to false in terraform.tfvars
165
+
166
+
+
167
+
----
168
+
enable_instance_principal = false
169
+
----
170
+
171
+
. Run terraform apply again:
172
+
173
+
+
174
+
----
175
+
terraform apply
176
+
----
177
+
178
+
==== Recommendations for using instance_principal
179
+
180
+
. Do not enable instance_principal if you are not using link:#kms-integration[KMS Integration]
181
+
. Enable instance_principal *_if and only if_* you are using link:#kms-integration[KMS Integration]
182
+
. Disable instance_principal once the cluster is created
183
+
119
184
=== Interacting with the OKE Cluster locally
120
185
121
186
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