Skip to content

Commit 680403e

Browse files
hyderDjelibeybi
authored andcommitted
- Added admin server in private subnet. use bastion only as jump host. need more testing and update docs
- Added python3 and oci-cli to admin host - Using oci-cli to generate kubeconfig instead of uploading - Sort all variables in alphabetical order - Use standard naming for enabled parameters - Added additional checks to prevent locals in policies module looking up a dynamic group when instance_principal is not created and use_encryption=false and updated terraform.tfvars.example to remove unused bastion parameters - Use compartment id instead of compartment name to write policy statement - Update Kubernetes available versions in Terraform options doc - Updated diagrams with admin host - Kubeconfig v2 on admin host - Updated changelog - Updated topology diagrams and subnet masks - Prevent the bastion/admin from destroying and recreating itself if the image ocid changes - Changed uri of protocol numbers to https - Upgrade to helm v3 (resolves #100) - Removed quotes for references, (resolves #103) - Added enable_instance_principal parameter for admin module Signed-off-by: Ali Mukadam <[email protected]>
1 parent b81174a commit 680403e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1500
-690
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*.tfvars
1010

1111
generated/**
12-
scripts/tesseract.sh
1312

1413
# visual code
1514
**/.vscode/*

CHANGELOG.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ All notable changes to this project are documented in this file.
77

88
The format is based on {uri-changelog}[Keep a Changelog].
99

10+
== v2.0.0-beta.2 (November 21, 2019)
11+
* Helm upgraded to version 3.0.0 #100
12+
* incubator and jetstack helm repos removed as they can now be searched from helm hub #100
13+
* tiller disabled and option to enable it is removed #100
14+
* Fixed bug for empty tuple in data.oci_core_images.oracle_images when use_autonomous=true #103
15+
* Set minimum version of Terraform to 0.12.16
16+
17+
== v2.0.0-beta.1 (November 14, 2019)
18+
* Added admin host for operations instead of using the bastion server #91
19+
* Installed Python3, oci-cli #91
20+
* Switched from kubeconfig v1 to v2, generated by oci-cli instead of uploading #98
21+
* Switched all operations from bastion to admin host #91
22+
* Use compartment id instead of compartment name for policies #86
23+
* Updated available list of Kubernetes versions in Terraform options #90
24+
1025
== v1.0.0 (September 27,2019)
1126

1227
=== Changes

docs/configuration.adoc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
:uri-contribute: {uri-rel-file-base}/CONTRIBUTING.adoc
1818
:uri-contributors: {uri-rel-file-base}/CONTRIBUTORS.adoc
1919
:uri-helm: https://helm.sh/
20-
:uri-helm-incubator: https://kubernetes-charts-incubator.storage.googleapis.com/
21-
:uri-helm-jetstack: https://charts.jetstack.io
2220
:uri-instructions: {uri-docs}/instructions.adoc
2321
:uri-license: {uri-rel-file-base}/LICENSE.txt
2422
:uri-kubernetes: https://kubernetes.io/
@@ -52,6 +50,7 @@
5250
. link:#configure-oci-parameters[Configure OCI parameters]
5351
. link:#configure-oci-networking-parameters[Configure OCI Networking parameters]
5452
. link:#configure-bastion-host-parameters[Configure Bastion Host parameters]
53+
. link:#configure-admin-host-parameters[Configure Admin Host parameters]
5554
. link:#configure-oke-parameters[Configure OKE parameters]
5655
. link:#configure-oke-load-balancer-parameters[Configure OKE Load Balancer parameters]
5756
. link:#configure-ocir-parameters[Configure OCIR parameters]
@@ -143,9 +142,13 @@ If you need to change the default VCN's CIDR, note the following:
143142

144143
=== Configure bastion host parameters
145144

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+
The bastion host parameters concern whether you want to enable the bastion.
147146

148-
Read {uri-instructions}#enabling-instance_principal-on-the-bastion-host[more] about {uri-oci-instance-principal}[instance_principal].
147+
=== Configure admin host parameters
148+
149+
The admin host parameters concern whether you want to enable the bastion. 1 parameter to keep in mind here is the admin_instance_principal. Be aware that if this is enabled, it gives API access to the admin host without authentication.
150+
151+
Read {uri-instructions}#enabling-instance_principal-on-the-admin-host[more] about {uri-oci-instance-principal}[instance_principal].
149152

150153
{uri-terraform-options}#bastion-host[Reference]
151154

@@ -197,10 +200,7 @@ kubectl --namespace=kube-system get secret ocirsecret --export -o yaml | kubectl
197200

198201
=== Configure helm parameters
199202

200-
The {uri-helm}[helm] parameters control the installation and the version of the helm client as well as optional helm repos to add and initialize on the bastion host. Additional helm repos include the following:
201-
202-
. {uri-helm-incubator}[incubator]
203-
. {uri-helm-jetstack}[jetstack]
203+
The {uri-helm}[helm] parameters control the installation and the version of the helm client as well as optional helm repos to add and initialize on the bastion host.
204204

205205
{uri-terraform-options}#helm[Reference]
206206

@@ -221,8 +221,9 @@ The Kubernetes Metrics Server parameter controls the installation of {uri-metric
221221
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.
222222

223223
----
224-
create_bastion = true
225-
enable_instance_principal = true
224+
bastion_enabled = true
225+
admin_enabled = true
226+
admin_instance_principal = true
226227
use_encryption = true
227228
existing_key_id = <existing_key_id>
228229
----

docs/images/bastion.png

-15.3 KB
Loading

docs/images/defaultmad.png

-18.2 KB
Loading

docs/images/defaultsad.png

-20 KB
Loading

docs/images/networking.png

-4.2 KB
Loading

docs/images/privatelbs.png

-13.9 KB
Loading

docs/images/public.png

-24.8 KB
Loading

docs/instructions.adoc

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,15 @@ Use the parameter *cluster_name* to change the name of the cluster as per your n
101101

102102
=== Adding the bastion host
103103

104-
If you want to use bastion host, set the parameter *create_bastion* to *true* in terraform.tfvars. Refer to {uri-terraform-options}#bastion-host[Bastion Host] for other available bastion related parameters.
104+
If you want to use bastion host, set the parameter *bastion_enabled* to *true* in terraform.tfvars. Refer to {uri-terraform-options}#bastion-host[Bastion Host] for other available bastion related parameters.
105105

106-
==== package_update and package_upgrade
106+
==== bastion_package_upgrade
107107

108-
There are 2 additional parameters for the bastion:
108+
There is 1 additional parameter for the bastion:
109109

110-
* bastion_package_update
111110
* bastion_package_upgrade
112111

113-
_bastion_package_update_ will update the apt database *if* you choose Ubuntu as the Linux distribution for the bastion host.
114-
115-
_bastion_package_upgrade_ will upgrade the bastion compute instance on first boot. If you choose Ubuntu for bastion host and you set _bastion_package_upgrade_ to *true*, you should also set the _bastion_package_update_ to *true*.
112+
_bastion_package_upgrade_ will upgrade the bastion compute instance on first boot.
116113

117114
****
118115
N.B. It is good and recommended practice to upgrade your bastion host to the latest packages to minimize the possibility of vulnerabilities. However, it will also take slightly longer before the bastion host is available.
@@ -121,7 +118,7 @@ N.B. It is good and recommended practice to upgrade your bastion host to the lat
121118
=== Using the bastion host
122119

123120
****
124-
*Assumption: you have set the create_bastion parameter to true in terraform.tfvars*
121+
*Assumption: you have set the bastion_enabled parameter to true in terraform.tfvars*
125122
****
126123

127124
Once the terraform apply is successful you will get the bastion_public_ip as output and also a ssh command .You can also run the below command to get the output:
@@ -136,21 +133,51 @@ A utility script is also generated that contains the command to ssh to the basti
136133
scripts/tesseract.sh
137134
----
138135

139-
==== Enabling instance_principal on the bastion host
136+
=== Adding the admin host
137+
138+
The admin host is used to minimize local dependencies such as oci-cli, kubectl and so on.
139+
140+
If you want to use the admin host, set the parameter *admin_enabled* to *true* in terraform.tfvars. Refer to {uri-terraform-options}#admin-host[Admin Host] for other available bastion related parameters.
141+
142+
==== admin_package_upgrade
143+
144+
There is 1 additional parameter for the admin:
145+
146+
* admin_package_upgrade
147+
148+
_admin_package_upgrade_ will upgrade the admin compute packages on first boot.
149+
150+
****
151+
N.B. It is good and recommended practice to upgrade your package host to the latest packages to minimize the possibility of vulnerabilities. However, it will also take slightly longer before the package host is available.
152+
****
153+
154+
=== Using the admin host
155+
156+
****
157+
*Assumption: you have set the admin_enabled parameter to true in terraform.tfvars*
158+
****
159+
160+
Once the terraform apply is successful you will get the admin_private_ip as output and also a ssh command .You can also run the below command to get the output:
161+
162+
----
163+
terraform output
164+
----
165+
166+
==== Enabling instance_principal on the admin host
140167
{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.
141168

142169
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.
143170

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].
171+
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], calico, metricserver, helm or creating the OCIR secret.
145172

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.
173+
When you enable this feature, by default, the admin host will have privileges to all resources in the compartment. If you are enabling it for link:#kms-integration[KMS Integration], the admin host will also have rights to create policies in the root tenancy.
147174

148-
You can also turn on and off the feature at any time without impact on the bastion or the cluster.
175+
You can also turn on and off the feature at any time without impact on the admin or the cluster.
149176

150-
To enable, set enable_instance_principal to true:
177+
To enable, set admin_instance_principal to true:
151178

152179
----
153-
enable_instance_principal = "true"
180+
admin_instance_principal = "true"
154181
----
155182

156183
and verify:
@@ -159,13 +186,13 @@ and verify:
159186
oci network vcn list --compartment-id <compartment-id>
160187
----
161188

162-
==== Disabling instance_principal on the bastion host
189+
==== Disabling instance_principal on the admin host
163190

164-
. Set enable_instance_principal to false in terraform.tfvars
191+
. Set admin_instance_principal to false in terraform.tfvars
165192

166193
+
167194
----
168-
enable_instance_principal = false
195+
admin_instance_principal = false
169196
----
170197

171198
. Run terraform apply again:
@@ -177,8 +204,8 @@ terraform apply
177204

178205
==== Recommendations for using instance_principal
179206

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]
207+
. Do not enable instance_principal if you are not using link:#kms-integration[KMS Integration] or calico
208+
. Enable instance_principal *_if and only if_* you are using link:#kms-integration[KMS Integration], calico, metricserver, helm or creating the OCIR secret.
182209
. Disable instance_principal once the cluster is created
183210

184211
=== Interacting with the OKE Cluster locally

0 commit comments

Comments
 (0)