Skip to content

Commit 6ec12e2

Browse files
authored
Multiple issues: 183, 190, 191, 192, 193, 194, 195
* added public ssh_key, cleaned up provider in policies module, and updated base modules so tenancy_id is not passed. Signed-off-by: Ali Mukadam <[email protected]> * issues 186, 190, 191, 192, 193, 194 * wrong issue number for 183 in changelog * additional condition in local to set the nat gateway to true
1 parent f64cd4d commit 6ec12e2

19 files changed

+59
-54
lines changed

CHANGELOG.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ 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+
== 2.3.1 (August 13, 2020)
11+
* Missing security rule when workers are in public mode (#183)
12+
* Updated docs for terraform options and for resetting nodepool_drain (#190)
13+
* Upgraded base module to 1.3.0 (#191)
14+
* Removed nat_gateway_enabled variable. Determination of whether the NAT gateway is needed is now done automatically (#192)
15+
* Removed "LATEST" from acceptable values for kubernetes_version so that upgrade can be performed (#193)
16+
* Internal load balancer subnet uses wrong routing table (#194)
17+
18+
== 2.3.0 (August 5, 2020)
19+
20+
* Added option to enable admission controllers and PodSecurityPolicy (#150)
21+
* Added ability to upgrade OKE cluster and worker nodes using out-of-place method (#178)
22+
* Changed node pools specification from list to map so the specific node pool is deleted when removed from the variable (#179)
23+
* Made minimum worker node pool to 1 to allow experimentation on free tier ( #180 )
24+
* Made label_prefix optional (#181)
25+
* Added trigger for check_worker_node_active (#182)
26+
* Removed disable_auto_retries in quick start guide (#185)
27+
1028
== 2.2.2 (June 10, 2020)
1129
* Upgraded base module to 1.2.3 (#169)
1230

docs/terraformoptions.adoc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ Ensure you review the {uri-terraform-dependencies}[dependencies].
130130
|Values
131131
|Default
132132

133-
|`nat_gateway_enabled`
134-
|Whether to create a NAT gateway. *Required* for private worker mode.
135-
|true/false
136-
|true
137-
138133
|`netnum`
139134
|0-based index of the subnets when the VCN's CIDR is masked with the corresponding newbit value and specified in the form of a map. Used to define the boundaries of the subnets. The values of the map are used as the netnum parameter in the {uri-terraform-cidrsubnet}[cidrsubnet] Terraform function. CIDR blocks for workers and load balancer subnets must not overlap with the CIDR blocks for Kubernetes pods (specified with _pods_cidr_ parameter).
140135
|e.g.
@@ -456,9 +451,9 @@ admission_controller_options = {
456451
|false
457452

458453
|`kubernetes_version`
459-
|The version of Kubernetes to provision. This is based on the available versions in OKE. By default, the available versions will be queries and the latest version selected. To provision a specific version, choose from available versions and override the 'LATEST' value.
460-
|LATEST, v1.14.8,v1.15.7, v1.16.8
461-
|LATEST
454+
|The version of Kubernetes to provision. This is based on the available versions in OKE. By default, the latest version is selected. The use of 'LATEST' is no longer permitted in order to facilitate upgrades.
455+
|v1.14.8,v1.15.7, v1.16.8
456+
|v1.16.8
462457

463458
|`node_pools`
464459
|The number, shape and quantities per subnets of node pools to create. Each key and tuple pair corresponds to 1 node pool. The first parameter in the tuple sets the shape of the worker node and the 2nd parameter sets the size of the node pool. A minimum of 3 worker worker nodes per node pool will be created. Refer to {uri-topology}[topology] for more thorough examples.

docs/upgrade.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,6 @@ node_pools = {
119119
+
120120
----
121121
terraform apply --auto-approve
122-
----
122+
----
123+
124+
. This completes the upgrade process. Now, set ```nodepool_drain = false``` to prevent draining from current nodes.

locals.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
locals {
55

66
oci_base_general = {
7-
compartment_id = var.compartment_id
8-
label_prefix = var.label_prefix
7+
compartment_id = var.compartment_id
8+
label_prefix = var.label_prefix
9+
root_compartment_id = var.tenancy_id
910
}
1011

1112
oci_base_provider = {
@@ -18,7 +19,7 @@ locals {
1819

1920
oci_base_vcn = {
2021
internet_gateway_enabled = true
21-
nat_gateway_enabled = var.nat_gateway_enabled
22+
nat_gateway_enabled = var.worker_mode == "private" || var.operator_enabled == true || (var.lb_subnet_type == "internal" || var.lb_subnet_type == "both") ? true : false
2223
service_gateway_enabled = true
2324
tags = var.tags["vcn"]
2425
vcn_cidr = var.vcn_cidr
@@ -45,6 +46,7 @@ locals {
4546
notification_protocol = var.bastion_notification_protocol
4647
notification_topic = var.bastion_notification_topic
4748
ssh_private_key_path = var.ssh_private_key_path
49+
ssh_public_key = var.ssh_public_key
4850
ssh_public_key_path = var.ssh_public_key_path
4951
tags = var.tags["bastion"]
5052
timezone = var.bastion_timezone
@@ -64,6 +66,7 @@ locals {
6466
notification_protocol = var.operator_notification_protocol
6567
notification_topic = var.operator_notification_topic
6668
ssh_private_key_path = var.ssh_private_key_path
69+
ssh_public_key = var.ssh_public_key
6770
ssh_public_key_path = var.ssh_public_key_path
6871
tags = var.tags["bastion"]
6972
timezone = var.operator_timezone

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terraform {
77

88
module "base" {
99
source = "oracle-terraform-modules/base/oci"
10-
version = "1.2.4"
10+
version = "1.3.0"
1111

1212
# general oci parameters
1313
oci_base_general = local.oci_base_general
@@ -34,8 +34,9 @@ module "policies" {
3434
label_prefix = var.label_prefix
3535

3636
# provider
37-
oci_provider = local.oci_base_provider
38-
37+
region = var.region
38+
tenancy_id = var.tenancy_id
39+
3940
ssh_keys = local.oci_base_ssh_keys
4041

4142
operator = local.oke_operator

modules/oke/cluster.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
resource "oci_containerengine_cluster" "k8s_cluster" {
55
compartment_id = var.compartment_id
6-
kubernetes_version = local.kubernetes_version
6+
kubernetes_version = var.oke_cluster.cluster_kubernetes_version
77
kms_key_id = var.oke_cluster.use_encryption == true ? var.oke_cluster.kms_key_id : null
88
name = var.label_prefix == "none" ? var.oke_cluster.cluster_name : "${var.label_prefix}-${var.oke_cluster.cluster_name}"
99

modules/oke/datasources.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ data "oci_core_images" "latest_images" {
1010
sort_by = "TIMECREATED"
1111
}
1212

13-
data "oci_containerengine_cluster_option" "k8s_cluster_option" {
14-
cluster_option_id = "all"
15-
}
16-
1713
data "oci_containerengine_node_pools" "all_node_pools" {
1814
compartment_id = var.compartment_id
1915
cluster_id = oci_containerengine_cluster.k8s_cluster.id

modules/oke/locals.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ locals {
55
# used by cluster
66
lb_subnet = var.lbs.preferred_lb_subnets == "public" ? "pub_lb" : "int_lb"
77

8-
# used by datasources
9-
available_kubernetes_versions = data.oci_containerengine_cluster_option.k8s_cluster_option.kubernetes_versions
10-
num_kubernetes_versions = length(local.available_kubernetes_versions)
11-
kubernetes_version = var.oke_cluster.cluster_kubernetes_version == "LATEST" ? element(sort(local.available_kubernetes_versions), (local.num_kubernetes_versions - 1)) : var.oke_cluster.cluster_kubernetes_version
12-
138
node_pools_size_list = [
149
for node_pool in data.oci_containerengine_node_pools.all_node_pools.node_pools :
1510
node_pool.node_config_details[0].size

modules/oke/nodepools.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resource "oci_containerengine_node_pool" "nodepools" {
77
compartment_id = var.compartment_id
88
depends_on = [oci_containerengine_cluster.k8s_cluster]
99

10-
kubernetes_version = local.kubernetes_version
10+
kubernetes_version = var.oke_cluster.cluster_kubernetes_version
1111
name = var.label_prefix == "none" ? each.key : "${var.label_prefix}-${each.key}"
1212

1313
node_config_details {

modules/okenetwork/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ locals {
3737

3838
worker_egress = [
3939
{
40-
description = "Allow ingress for all traffic to allow pods to communicate between each other on different worker nodes on the worker subnet",
40+
description = "Allow egress for all traffic to allow pods to communicate between each other on different worker nodes on the worker subnet",
4141
destination = local.worker_subnet,
4242
destination_type = "CIDR_BLOCK",
4343
protocol = local.all_protocols,

0 commit comments

Comments
 (0)