Skip to content

Commit fdea39e

Browse files
[Quick Fix] Updates to Dashboard Import Module (#62)
* dashboard imports is optional
1 parent 1f5fb5f commit fdea39e

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ charts/**/charts/
6464

6565
# zip artifacts
6666
releases/
67+
68+
# vscode
69+
.vscode

terraform/oke/inputs.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ variable "boat_tenancy_ocid" {
6868
}
6969

7070
####
71-
## Dynamic Group and Policies
71+
## Optional Inputs
7272
####
7373

7474
# Option to create Dynamic Group and Policies
@@ -77,6 +77,12 @@ variable "opt_create_dynamicGroup_and_policies" {
7777
default = false
7878
}
7979

80+
# Option to import dashboards
81+
variable "opt_import_dashboards" {
82+
type = bool
83+
default = true
84+
}
85+
8086
####
8187
## OKE Cluster Information
8288
####

terraform/oke/main.tf

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ locals {
1414
## Module dependencies should be included here as well so a module does not run when it's depenedent moudle is disabled
1515

1616
module_controls_enable_livelab_module = alltrue([var.toggle_livelab_module, var.livelab_switch])
17-
module_controls_enable_dashboards_module = alltrue([var.toggle_dashboards_module])
17+
module_controls_enable_dashboards_module = alltrue([var.toggle_dashboards_module, var.opt_import_dashboards])
1818
module_controls_enable_iam_module = alltrue([var.toggle_iam_module, var.opt_create_dynamicGroup_and_policies, !var.livelab_switch])
1919
module_controls_enable_logan_module = alltrue([var.toggle_logan_module])
2020
module_controls_enable_mgmt_agent_module = alltrue([var.toggle_mgmt_agent_module])
@@ -36,14 +36,6 @@ module "livelab" {
3636
} */
3737
}
3838

39-
// Import Kubernetes Dashboards
40-
module "import_kubernetes_dashbords" {
41-
source = "./modules/dashboards"
42-
compartment_ocid = var.oci_onm_compartment_ocid
43-
44-
count = local.module_controls_enable_dashboards_module ? 1 : 0
45-
}
46-
4739
// Create Required Polcies and Dynamic Group
4840
// Needs to be called with OCI Home Region Provider
4941
module "policy_and_dynamic-group" {
@@ -103,3 +95,12 @@ module "helm_release" {
10395

10496
count = local.module_controls_enable_helm_module ? 1 : 0
10597
}
98+
99+
// Import Kubernetes Dashboards
100+
module "import_kubernetes_dashbords" {
101+
source = "./modules/dashboards"
102+
compartment_ocid = var.oci_onm_compartment_ocid
103+
104+
count = local.module_controls_enable_dashboards_module ? 1 : 0
105+
depends_on = [ module.helm_release ]
106+
}

terraform/oke/schema.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ variableGroups:
4545
- stack_deployment_option
4646
visible: false
4747

48-
- title: Select an OKE cluster deployed in this region to start monitoring.
48+
- title: Select an OKE cluster deployed in this region to start monitoring
4949
description: "Use CLI (Helm) if your cluster does not have a public API endpoint or if it's restricted from accessing container-registry.oracle.com. See: https://github.com/oracle-quickstart/oci-kubernetes-monitoring"
5050
variables:
5151
- oke_compartment_ocid
@@ -61,9 +61,10 @@ variableGroups:
6161
- oci_la_logGroup_name
6262
- fluentd_baseDir_path
6363

64-
- title: OCI IAM Policies and Dynamic Groups (Optional)
64+
- title: Advanced Configuration
6565
variables:
6666
- opt_create_dynamicGroup_and_policies
67+
- opt_import_dashboards
6768

6869
variables:
6970

@@ -189,14 +190,22 @@ variables:
189190
- livelab_switch
190191

191192
####
192-
## Pre-requisites
193+
## Optional Inputs
193194
####
194195

195196
# Option to create Dynamic Group and Policies
196197
opt_create_dynamicGroup_and_policies:
197198
type: boolean
198-
title: Select this check box to create dynamic groups and policies that are required for deploying the monitoring solution.
199+
title: Select this check box to create OCI IAM dynamic groups and policies which are required for the monitoring solution
199200
#description: "Ref: https://github.com/oracle-quickstart/oci-kubernetes-monitoring#pre-requisites"
200201
description: "Note: If node pools and the OKE cluster are in different compartments, then the dynamic group definition must be updated."
201202
default: false
202-
required: true
203+
required: true
204+
205+
# Option to create Dynamic Group and Policies
206+
opt_import_dashboards:
207+
type: boolean
208+
title: Select this check box to import dashboards
209+
description: "Note: You may need to manually clean up the dashboards when you destory the stack as dashboards will not be deleted automatically."
210+
default: true
211+
required: true

0 commit comments

Comments
 (0)