Skip to content

Commit f64cd4d

Browse files
authored
added support for out-of-place upgrade (#184)
* added support for out-of-place upgrade * code formatting, updated example var file and docs * added ability to enable PSP, fixed documentation bug
1 parent 12ac32d commit f64cd4d

27 files changed

+501
-133
lines changed

README.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
:uri-terraform-options: {uri-docs}/terraformoptions.adoc
3737
:uri-terraform-hashircorp-examples: https://github.com/hashicorp/terraform-guides/tree/master/infrastructure-as-code/terraform-0.12-examples
3838
:uri-topology: {uri-docs}/topology.adoc
39-
39+
:uri-upgrade: {uri-docs}/upgrade.adoc
4040

4141
{uri-oke}[Oracle Container Engine] (OKE) is {uri-oracle}[Oracle]'s managed {uri-kubernetes}[Kubernetes] service on {uri-oci}[Oracle Cloud Infrastructure (OCI)].
4242
@@ -56,6 +56,8 @@ This {uri-repo}[Terraform OKE Installer] for {uri-oci}[Oracle Cloud Infrastructu
5656
5757
* {uri-terraform-options}[Terraform Options]
5858
59+
* {uri-upgrade}[Upgrading OKE]
60+
5961
* {uri-terraform-dependencies}[Feature Dependencies]
6062
6163
== Related Documentation, Blog

docs/configuration.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ Enter the values for the following parameters in the terraform.tfvars file:
7878

7979
* api_fingerprint
8080
* api_private_key_path
81-
* compartment_name
8281
* compartment_id
8382
* tenancy_id
8483
* user_id
@@ -147,7 +146,7 @@ The bastion host parameters concern whether you want to enable the bastion.
147146

148147
=== Configure operator host parameters
149148

150-
The operator host parameters concern whether you want to enable the bastion. 1 parameter to keep in mind here is the operator_instance_principal. Be aware that if this is enabled, it gives API access to the operator host without authentication.
149+
The operator host parameters concern whether you want to enable the operator host. 1 parameter to keep in mind here is the operator_instance_principal. Be aware that if this is enabled, it gives API access to the operator host without authentication.
151150

152151
Read {uri-instructions}#enabling-instance_principal-on-the-operator-host[more] about {uri-oci-instance-principal}[instance_principal].
153152

docs/dependencies.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ The following table documents the {uri-terraform-options}[Terraform Options] dep
3838
|Installs Kubernetes metrics server for Horizontal Pod Autoscaling
3939
|bastion_enabled = true, admin_enabled = true, admin_instance_principal = true
4040

41+
|node_pools_to_drain
42+
|Drains existing node pools before upgrading
43+
|bastion_enabled = true, admin_enabled = true, admin_instance_principal = true
44+
4145
|ocir secret
4246
|Whether to create an authentication secret for OCIR
4347
|bastion_enabled = true, admin_enabled = true, admin_instance_principal = true, secret_id = secret ocid
4448

4549
|use_encryption
4650
|Uses OCI KMS to encrypt data in OKE's underlying etcd
47-
|bastion_enabled = true, admin_enabled = true, admin_instance_principal = true
51+
|bastion_enabled = true, admin_enabled = true, admin_instance_principal = true

docs/instructions.adoc

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
:uri-helm: https://helm.sh/
5050
:uri-metricserver: https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#metrics-server
5151
:uri-k8s-dashboard: http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
52+
:uri-psp: https://docs.cloud.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengusingpspswithoke.htm#Using_Pod_Security_Polices_with_Container_Engine_for_Kubernetes
5253

5354
. link:#assumptions[Assumptions]
5455
. link:#kms-integration[KMS Integration]
@@ -71,6 +72,7 @@
7172
. link:#destroying-the-cluster[Destroying the cluster]
7273
. link:#creating-a-service-account-for-cicd-tools[Creating a service account for CI/CD tools]
7374
. link:#enabling-waf[Monitor and Protect your application using OCI WAF]
75+
. link:#enabling-podsecuritypolicy[Enabling PodSecurityPolicy Admissions Controller]
7476

7577
=== Assumptions
7678

@@ -87,7 +89,7 @@ If you wish to use {uri-oci-kms}[OCI KMS] to encrypt Kubernetes secrets, the fol
8789
** {uri-oci-manage-dynamic-groups}[manage dynamic groups]
8890
** {uri-oci-manage-policies}[manage policies in root tenancy]
8991
* link:#adding-the-bastion-host[bastion must be enabled]
90-
* link:#enabling-instance_principal-on-the-bastion-host[bastion instance_principal must be enabled]
92+
* link:#enabling-instance_principal-on-the-operator-host[operator instance_principal must be enabled]
9193
* use_encryption must be set to _true_
9294
* existing_key_id must be provided
9395

@@ -301,7 +303,6 @@ service_account_name = "kubeconfigsa"
301303
service_account_namespace = "kube-system"
302304
303305
service_account_cluster_role_binding = ""
304-
````
305306
----
306307

307308
=== Enabling WAF
@@ -325,3 +326,17 @@ N.B.
325326
. It is good and recommended practice to monitor and protect your application using WAF.
326327
. WAF protection currently only works if you use a public load balancer as a front end to your services. This means that services deployed as NodePort services are currently *not protected* by WAF.
327328
****
329+
330+
=== Enabling PodSecurityPolicy
331+
332+
If you would like to enable the PodSecurityPolicy Admission Controller, set
333+
334+
[source]
335+
admission_controller_options = {
336+
PodSecurityPolicy = true
337+
}
338+
339+
Ensure you also read {uri-psp}[the documentation] before enabling it.
340+
341+
****
342+
N.B. This field is updatable. You can set to `true` and `false` and run terraform apply again.

docs/quickstart.adoc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ cp terraform.tfvars.example terraform.tfvars
5454
+
5555
----
5656
provider "oci" {
57-
tenancy_ocid = var.tenancy_id
58-
user_ocid = var.user_id
5957
fingerprint = var.api_fingerprint
6058
private_key_path = var.api_private_key_path
6159
region = var.region
62-
disable_auto_retries = var.disable_auto_retries
60+
tenancy_ocid = var.tenancy_id
61+
user_ocid = var.user_id
6362
}
6463
----
6564

@@ -68,7 +67,6 @@ provider "oci" {
6867
* api_fingerprint
6968
* api_private_key_path
7069
* compartment_id
71-
* compartment_name
7270
* tenancy_id
7371
* user_id
7472

@@ -95,19 +93,18 @@ terraform plan
9593
terraform apply
9694
----
9795

98-
=== Provisioning using the Hashicorp registry module
96+
=== Provisioning using the HashiCorp registry module
9997

10098
. In your project root, create a provider.tf file and add the following:
10199

102100
+
103101
----
104102
provider "oci" {
105-
tenancy_ocid = var.tenancy_id
106-
user_ocid = var.user_id
107103
fingerprint = var.api_fingerprint
108104
private_key_path = var.api_private_key_path
109105
region = var.region
110-
disable_auto_retries = var.disable_auto_retries
106+
tenancy_ocid = var.tenancy_id
107+
user_ocid = var.user_id
111108
}
112109
----
113110

@@ -119,8 +116,8 @@ provider "oci" {
119116
----
120117
module "oke" {
121118
source = "oracle-terraform-modules/oke/oci"
122-
version = "2.1.5"
123-
# insert the 23 required variables here
119+
version = "2.2.2"
120+
# insert the 9 required variables here
124121
}
125122
----
126123

0 commit comments

Comments
 (0)