File tree Expand file tree Collapse file tree 6 files changed +28
-12
lines changed
Expand file tree Collapse file tree 6 files changed +28
-12
lines changed Original file line number Diff line number Diff line change 1- # Copyright 2017, 2022 Oracle Corporation and/or affiliates.
1+ # Copyright 2017, 2023 Oracle Corporation and/or affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33
44module "vcn" {
@@ -248,10 +248,14 @@ module "oke" {
248248 ssh_public_key_path = var. ssh_public_key_path
249249
250250 # oke cluster parameters
251- cluster_kubernetes_version = var. kubernetes_version
252- control_plane_type = var. control_plane_type
253- control_plane_nsgs = concat (var. control_plane_nsgs , [module . network . control_plane_nsg_id ])
254- cluster_name = var. cluster_name
251+ cluster_kubernetes_version = var. kubernetes_version
252+ control_plane_type = var. control_plane_type
253+ control_plane_nsgs = concat (var. control_plane_nsgs , [module . network . control_plane_nsg_id ])
254+ cluster_name = var. cluster_name
255+ cluster_type = lookup ({
256+ " basic" = " BASIC_CLUSTER" ,
257+ " enhanced" = " ENHANCED_CLUSTER"
258+ }, lower (var. cluster_type ), " BASIC_CLUSTER" )
255259 cluster_options_add_ons_is_kubernetes_dashboard_enabled = var. dashboard_enabled
256260 cluster_options_kubernetes_network_config_pods_cidr = var. pods_cidr
257261 cluster_options_kubernetes_network_config_services_cidr = var. services_cidr
Original file line number Diff line number Diff line change 1- # Copyright 2017, 2022 Oracle Corporation and/or affiliates.
1+ # Copyright 2017, 2023 Oracle Corporation and/or affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33
44# 30s delay to allow policies to take effect globally
@@ -13,7 +13,7 @@ resource "oci_containerengine_cluster" "k8s_cluster" {
1313 kubernetes_version = var. cluster_kubernetes_version
1414 kms_key_id = var. use_cluster_encryption == true ? var. cluster_kms_key_id : null
1515 name = var. label_prefix == " none" ? var. cluster_name : " ${ var . label_prefix } -${ var . cluster_name } "
16-
16+ type = var . cluster_type
1717 depends_on = [time_sleep . wait_30_seconds ]
1818
1919 cluster_pod_network_options {
Original file line number Diff line number Diff line change 1- # Copyright (c) 2017, 2022 Oracle Corporation and/or its affiliates.
1+ # Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33
44# oci provider
@@ -25,6 +25,7 @@ variable "control_plane_nsgs" {
2525}
2626
2727variable "cluster_name" {}
28+ variable "cluster_type" {}
2829
2930variable "cluster_options_add_ons_is_kubernetes_dashboard_enabled" {
3031 type = bool
Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ allow_pod_internet_access = true
168168allow_worker_internet_access = true
169169allow_worker_ssh_access = false
170170cluster_name = "oke"
171+ cluster_type = "basic"
171172cni_type = "flannel"
172173control_plane_type = "private"
173174control_plane_allowed_cidrs = ["0.0.0.0/0"]
Original file line number Diff line number Diff line change 1- # Copyright (c) 2017, 2022 Oracle Corporation and/or its affiliates.
1+ # Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33
44# OCI Provider parameters
@@ -545,6 +545,16 @@ variable "cluster_name" {
545545 type = string
546546}
547547
548+ variable "cluster_type" {
549+ default = " basic"
550+ description = " The cluster type. See <a href=https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengworkingwithenhancedclusters.htm>Working with Enhanced Clusters and Basic Clusters</a> for more information."
551+ type = string
552+ validation {
553+ condition = contains ([" basic" , " enhanced" ], lower (var. cluster_type ))
554+ error_message = " Accepted values are 'basic' or 'enhanced'."
555+ }
556+ }
557+
548558variable "cni_type" {
549559 # Keep flannel as default so users can upgrade without impact. Give a grace period for users to plan and change
550560 default = " flannel"
Original file line number Diff line number Diff line change 1- # Copyright 2017, 2022 Oracle Corporation and/or affiliates.
1+ # Copyright 2017, 2023 Oracle Corporation and/or affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33
44terraform {
55 required_providers {
66 oci = {
77 source = " oracle/oci"
88 configuration_aliases = [oci.home]
9- version = " >= 4.67.3 "
9+ version = " ~> 4.114.0 "
1010 }
1111 }
12- required_version = " >= 1.1 .0"
12+ required_version = " >= 1.2 .0"
1313}
You can’t perform that action at this time.
0 commit comments