Skip to content

Commit d4d4263

Browse files
authored
Make Verrazzano components configurable (#17)
* feat: added configuration of various Verrazzano components Signed-off-by: Ali Mukadam <ali.mukadam@oracle.com> * feat: made additional components configurable Signed-off-by: Ali Mukadam <ali.mukadam@oracle.com> --------- Signed-off-by: Ali Mukadam <ali.mukadam@oracle.com>
1 parent 748ce4e commit d4d4263

35 files changed

+753
-382
lines changed

docs/src/multi/pub-ep.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Only uncomment the admin region in outputs if you happen to also run a managed c
169169
6. Configure the following input variables:
170170

171171
```terraform,editable
172-
configure_clusters = false
172+
get_kubeconfigs = false
173173
install_verrazzano = false
174174
```
175175

@@ -198,7 +198,7 @@ You will now generate the installation script.
198198
1. Configure the following input variables:
199199

200200
```terraform,editable
201-
configure_clusters = true
201+
get_kubeconfigs = true
202202
install_verrazzano = true
203203
```
204204

docs/src/single/dev.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ admin_region = {
4646
6. Configure the following input variables:
4747

4848
```
49-
configure_clusters = false
49+
get_kubeconfigs = false
5050
install_verrazzano = false
5151
```
5252
```admonish important
@@ -70,7 +70,7 @@ You will now generate the installation script.
7070
1. Configure the following input variables:
7171

7272
```
73-
configure_clusters = true
73+
get_kubeconfigs = true
7474
install_verrazzano = true
7575
```
7676

docs/src/single/production.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ admin_region = {
4545
6. Configure the following input variables:
4646

4747
```
48-
configure_clusters = false
48+
get_kubeconfigs = false
4949
install_verrazzano = false
5050
```
5151
```admonish important
@@ -69,7 +69,7 @@ You will now generate the installation script.
6969
1. Configure the following input variables:
7070

7171
```
72-
configure_clusters = true
72+
get_kubeconfigs = true
7373
install_verrazzano = true
7474
```
7575

docs/src/terraformoptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
| Parameter | Description | Type | Default |
3333
| --------- | ----------- | ----------- | ------- |
3434
| admin_region | The region parameters of the Admin cluster. In case a single cluster is created, the Admin region is used for the single cluster. | map(any)| |
35-
| configure_clusters | Whether to set up access to the clusters. Set to false on cluster creation. | bool | false |
35+
| get_kubeconfigs | Whether to set up access to the clusters. Set to false on cluster creation. | bool | false |
3636
| kubernetes_version | The version of Kubernetes to use. | string | v1.24.1 |
3737
| oke_control_plane | Whether to keep all OKE control planes public or private | public/private | public |
3838
| managed_clusters | A map of OCI regions where managed clusters will be created | map(bool) | |

main.tf

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -79,43 +79,54 @@ module "verrazzano" {
7979

8080
ssh_private_key_path = var.ssh_private_key_path
8181

82-
oke_control_plane = var.oke_control_plane
83-
84-
verrazzano_version = var.verrazzano_version
85-
82+
# verrazzano
8683
install_verrazzano = var.install_verrazzano
84+
verrazzano_version = var.verrazzano_version
8785

88-
admin_region = var.admin_region
89-
90-
verrazzano_profile = var.verrazzano_profile
91-
86+
# verrazzano infrastructure
87+
admin_region = var.admin_region
88+
oke_control_plane = var.oke_control_plane
89+
verrazzano_profile = var.verrazzano_profile
9290
verrazzano_control_plane = var.verrazzano_control_plane
93-
94-
verrazzano_data_plane = var.verrazzano_data_plane
95-
96-
verrazzano_data_plane_id = var.verrazzano_data_plane_id
97-
91+
verrazzano_data_plane = var.verrazzano_data_plane
9892
verrazzano_load_balancer = var.verrazzano_load_balancer
99-
100-
cluster_ids = merge({ "admin" = module.admin.cluster_id }, module.clusters.cluster_ids)
101-
102-
int_nsg_ids = merge({ "admin" = lookup(module.admin.nsg_ids, "int_lb") }, module.clusters.int_nsg_ids)
103-
104-
pub_nsg_ids = merge({ "admin" = lookup(module.admin.nsg_ids, "pub_lb") }, module.clusters.pub_nsg_ids)
105-
106-
configure_dns = var.configure_dns
107-
108-
secret_id = var.secret_id
109-
110-
dns_zone_id = var.dns_zone_id
111-
93+
cluster_ids = merge({ "admin" = module.admin.cluster_id }, module.clusters.cluster_ids)
94+
int_nsg_ids = merge({ "admin" = lookup(module.admin.nsg_ids, "int_lb") }, module.clusters.int_nsg_ids)
95+
pub_nsg_ids = merge({ "admin" = lookup(module.admin.nsg_ids, "pub_lb") }, module.clusters.pub_nsg_ids)
96+
97+
# verrazzano components
98+
argocd = var.argocd
99+
coherence = var.coherence
100+
configure_dns = var.configure_dns
101+
console = var.console
102+
fluentd = var.fluentd
103+
grafana = var.grafana
104+
jaeger = var.jaeger
105+
kiali = var.kiali
106+
kube_state_metrics = var.kube_state_metrics
107+
opensearch = var.opensearch
108+
opensearch_dashboards = var.opensearch_dashboards
109+
prometheus = var.prometheus
110+
prometheus_operator = var.prometheus_operator
111+
rancher = var.rancher
112+
velero = var.velero
113+
weblogic_operator = var.weblogic_operator
114+
115+
# dns
116+
secret_id = var.secret_id
117+
dns_zone_id = var.dns_zone_id
112118
dns_compartment_id = var.dns_compartment_id
119+
dns_zone_name = var.dns_zone_name
120+
121+
# istio
122+
mesh_id = var.mesh_id
123+
istio_model = var.istio_model
113124

114-
dns_zone_name = var.dns_zone_name
115125

116126
depends_on = [
117127
module.clusters
118128
]
119129

120-
count = var.configure_clusters == true ? 1 : 0
130+
count = tobool(var.get_kubeconfigs) ? 1 : 0
121131
}
132+

modules/clusters/africa.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@
8282
# oci.home = oci.home
8383
# }
8484

85-
# count = lookup(var.clusters, "johannesburg") == true ? 1 : 0
85+
# count = tobool(lookup(var.clusters, "johannesburg")) ? 1 : 0
8686

8787
# }

modules/clusters/australia.tf

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -82,94 +82,94 @@ module "melbourne" {
8282
oci.home = oci.home
8383
}
8484

85-
count = lookup(var.clusters, "melbourne") == true ? 1 : 0
85+
count = tobool(lookup(var.clusters, "melbourne")) ? 1 : 0
8686

8787
}
8888

89-
module "sydney" {
90-
source = "oracle-terraform-modules/oke/oci"
91-
version = "4.5.9"
92-
93-
home_region = var.home_region
94-
region = local.regions["sydney"]
95-
96-
tenancy_id = var.tenancy_id
97-
98-
# general oci parameters
99-
compartment_id = var.compartment_id
100-
label_prefix = var.label_prefix
101-
102-
# ssh keys
103-
ssh_private_key_path = "~/.ssh/id_rsa"
104-
ssh_public_key_path = "~/.ssh/id_rsa.pub"
105-
106-
# networking
107-
create_drg = true
108-
drg_display_name = "sydney"
109-
110-
remote_peering_connections = var.connectivity_mode == "mesh" ? { for k, v in merge({ "admin" = true }, var.clusters) : "rpc-to-${k}" => {} if tobool(v) && k != "sydney" } : { "rpc-to-admin" : {} }
111-
112-
nat_gateway_route_rules = concat([
113-
{
114-
destination = lookup(var.admin_region, "vcn_cidr")
115-
destination_type = "CIDR_BLOCK"
116-
network_entity_id = "drg"
117-
description = "To Admin"
118-
}], var.connectivity_mode == "mesh" ?
119-
[for c in keys(var.clusters) :
120-
{
121-
destination = lookup(lookup(var.cidrs, c), "vcn")
122-
destination_type = "CIDR_BLOCK"
123-
network_entity_id = "drg"
124-
description = "Routing to allow connectivity to ${title(c)} cluster"
125-
} if tobool(lookup(var.clusters, c) && c != "sydney")] : []
126-
)
127-
128-
vcn_cidrs = [lookup(lookup(var.cidrs, lower("sydney")), "vcn")]
129-
vcn_dns_label = "sydney"
130-
vcn_name = "sydney"
131-
132-
# bastion host
133-
create_bastion_host = false
134-
upgrade_bastion = false
135-
136-
# operator host
137-
create_operator = false
138-
upgrade_operator = false
139-
enable_operator_instance_principal = false
140-
141-
142-
# oke cluster options
143-
allow_worker_ssh_access = false
144-
cluster_name = "sydney"
145-
control_plane_type = var.oke_control_plane
146-
control_plane_allowed_cidrs = ["0.0.0.0/0"]
147-
kubernetes_version = var.kubernetes_version
148-
pods_cidr = lookup(lookup(var.cidrs, lower("sydney")), "pods")
149-
services_cidr = lookup(lookup(var.cidrs, lower("sydney")), "services")
150-
151-
152-
# node pools
153-
kubeproxy_mode = "ipvs"
154-
node_pools = local.managed_nodepools
155-
cloudinit_nodepool_common = var.cloudinit_nodepool_common
156-
157-
node_pool_image_type = "oke"
158-
159-
# oke load balancers
160-
load_balancers = "both"
161-
preferred_load_balancer = "public"
162-
internal_lb_allowed_cidrs = [lookup(var.admin_region, "vcn_cidr")]
163-
internal_lb_allowed_ports = var.connectivity_mode == "mesh" ? [80, 443, 15012, 15017, 15021, 15443] : [80, 443]
164-
public_lb_allowed_cidrs = ["0.0.0.0/0"]
165-
public_lb_allowed_ports = [80, 443]
166-
167-
providers = {
168-
oci = oci.sydney
169-
oci.home = oci.home
170-
}
171-
172-
count = lookup(var.clusters, "sydney") == true ? 1 : 0
173-
174-
}
89+
# module "sydney" {
90+
# source = "oracle-terraform-modules/oke/oci"
91+
# version = "4.5.9"
92+
93+
# home_region = var.home_region
94+
# region = local.regions["sydney"]
95+
96+
# tenancy_id = var.tenancy_id
97+
98+
# # general oci parameters
99+
# compartment_id = var.compartment_id
100+
# label_prefix = var.label_prefix
101+
102+
# # ssh keys
103+
# ssh_private_key_path = "~/.ssh/id_rsa"
104+
# ssh_public_key_path = "~/.ssh/id_rsa.pub"
105+
106+
# # networking
107+
# create_drg = true
108+
# drg_display_name = "sydney"
109+
110+
# remote_peering_connections = var.connectivity_mode == "mesh" ? { for k, v in merge({ "admin" = true }, var.clusters) : "rpc-to-${k}" => {} if tobool(v) && k != "sydney" } : { "rpc-to-admin" : {} }
111+
112+
# nat_gateway_route_rules = concat([
113+
# {
114+
# destination = lookup(var.admin_region, "vcn_cidr")
115+
# destination_type = "CIDR_BLOCK"
116+
# network_entity_id = "drg"
117+
# description = "To Admin"
118+
# }], var.connectivity_mode == "mesh" ?
119+
# [for c in keys(var.clusters) :
120+
# {
121+
# destination = lookup(lookup(var.cidrs, c), "vcn")
122+
# destination_type = "CIDR_BLOCK"
123+
# network_entity_id = "drg"
124+
# description = "Routing to allow connectivity to ${title(c)} cluster"
125+
# } if tobool(lookup(var.clusters, c) && c != "sydney")] : []
126+
# )
127+
128+
# vcn_cidrs = [lookup(lookup(var.cidrs, lower("sydney")), "vcn")]
129+
# vcn_dns_label = "sydney"
130+
# vcn_name = "sydney"
131+
132+
# # bastion host
133+
# create_bastion_host = false
134+
# upgrade_bastion = false
135+
136+
# # operator host
137+
# create_operator = false
138+
# upgrade_operator = false
139+
# enable_operator_instance_principal = false
140+
141+
142+
# # oke cluster options
143+
# allow_worker_ssh_access = false
144+
# cluster_name = "sydney"
145+
# control_plane_type = var.oke_control_plane
146+
# control_plane_allowed_cidrs = ["0.0.0.0/0"]
147+
# kubernetes_version = var.kubernetes_version
148+
# pods_cidr = lookup(lookup(var.cidrs, lower("sydney")), "pods")
149+
# services_cidr = lookup(lookup(var.cidrs, lower("sydney")), "services")
150+
151+
152+
# # node pools
153+
# kubeproxy_mode = "ipvs"
154+
# node_pools = local.managed_nodepools
155+
# cloudinit_nodepool_common = var.cloudinit_nodepool_common
156+
157+
# node_pool_image_type = "oke"
158+
159+
# # oke load balancers
160+
# load_balancers = "both"
161+
# preferred_load_balancer = "public"
162+
# internal_lb_allowed_cidrs = [lookup(var.admin_region, "vcn_cidr")]
163+
# internal_lb_allowed_ports = var.connectivity_mode == "mesh" ? [80, 443, 15012, 15017, 15021, 15443] : [80, 443]
164+
# public_lb_allowed_cidrs = ["0.0.0.0/0"]
165+
# public_lb_allowed_ports = [80, 443]
166+
167+
# providers = {
168+
# oci = oci.sydney
169+
# oci.home = oci.home
170+
# }
171+
172+
# count = tobool(lookup(var.clusters, "sydney")) ? 1 : 0
173+
174+
# }
175175

modules/clusters/brazil.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
# oci.home = oci.home
8383
# }
8484

85-
# count = lookup(var.clusters, "saupaulo") == true ? 1 : 0
85+
# count = tobool(lookup(var.clusters, "saupaulo")) ? 1 : 0
8686

8787
# }
8888

@@ -167,7 +167,6 @@
167167
# oci.home = oci.home
168168
# }
169169

170-
# count = lookup(var.clusters, "vinhedo") == true ? 1 : 0
171-
172-
# }
170+
# count = tobool(lookup(var.clusters, "vinhedo")) ? 1 : 0
173171

172+
# }

modules/clusters/canada.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
# oci.home = oci.home
8383
# }
8484

85-
# count = lookup(var.clusters, "toronto") == true ? 1 : 0
85+
# count = tobool(lookup(var.clusters, "toronto")) ? 1 : 0
8686

8787
# }
8888

@@ -167,7 +167,7 @@
167167
# oci.home = oci.home
168168
# }
169169

170-
# count = lookup(var.clusters, "montreal") == true ? 1 : 0
170+
# count = tobool(lookup(var.clusters, "montreal")) ? 1 : 0
171171

172172
# }
173173

0 commit comments

Comments
 (0)