Skip to content

Commit

Permalink
[Quick Fix] Updates to Dashboard Import Module (#62)
Browse files Browse the repository at this point in the history
* dashboard imports is optional
  • Loading branch information
paliwalparitosh authored Jan 9, 2024
1 parent 1f5fb5f commit fdea39e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ charts/**/charts/

# zip artifacts
releases/

# vscode
.vscode
8 changes: 7 additions & 1 deletion terraform/oke/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ variable "boat_tenancy_ocid" {
}

####
## Dynamic Group and Policies
## Optional Inputs
####

# Option to create Dynamic Group and Policies
Expand All @@ -77,6 +77,12 @@ variable "opt_create_dynamicGroup_and_policies" {
default = false
}

# Option to import dashboards
variable "opt_import_dashboards" {
type = bool
default = true
}

####
## OKE Cluster Information
####
Expand Down
19 changes: 10 additions & 9 deletions terraform/oke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ locals {
## Module dependencies should be included here as well so a module does not run when it's depenedent moudle is disabled

module_controls_enable_livelab_module = alltrue([var.toggle_livelab_module, var.livelab_switch])
module_controls_enable_dashboards_module = alltrue([var.toggle_dashboards_module])
module_controls_enable_dashboards_module = alltrue([var.toggle_dashboards_module, var.opt_import_dashboards])
module_controls_enable_iam_module = alltrue([var.toggle_iam_module, var.opt_create_dynamicGroup_and_policies, !var.livelab_switch])
module_controls_enable_logan_module = alltrue([var.toggle_logan_module])
module_controls_enable_mgmt_agent_module = alltrue([var.toggle_mgmt_agent_module])
Expand All @@ -36,14 +36,6 @@ module "livelab" {
} */
}

// Import Kubernetes Dashboards
module "import_kubernetes_dashbords" {
source = "./modules/dashboards"
compartment_ocid = var.oci_onm_compartment_ocid

count = local.module_controls_enable_dashboards_module ? 1 : 0
}

// Create Required Polcies and Dynamic Group
// Needs to be called with OCI Home Region Provider
module "policy_and_dynamic-group" {
Expand Down Expand Up @@ -103,3 +95,12 @@ module "helm_release" {

count = local.module_controls_enable_helm_module ? 1 : 0
}

// Import Kubernetes Dashboards
module "import_kubernetes_dashbords" {
source = "./modules/dashboards"
compartment_ocid = var.oci_onm_compartment_ocid

count = local.module_controls_enable_dashboards_module ? 1 : 0
depends_on = [ module.helm_release ]
}
19 changes: 14 additions & 5 deletions terraform/oke/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variableGroups:
- stack_deployment_option
visible: false

- title: Select an OKE cluster deployed in this region to start monitoring.
- title: Select an OKE cluster deployed in this region to start monitoring
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"
variables:
- oke_compartment_ocid
Expand All @@ -61,9 +61,10 @@ variableGroups:
- oci_la_logGroup_name
- fluentd_baseDir_path

- title: OCI IAM Policies and Dynamic Groups (Optional)
- title: Advanced Configuration
variables:
- opt_create_dynamicGroup_and_policies
- opt_import_dashboards

variables:

Expand Down Expand Up @@ -189,14 +190,22 @@ variables:
- livelab_switch

####
## Pre-requisites
## Optional Inputs
####

# Option to create Dynamic Group and Policies
opt_create_dynamicGroup_and_policies:
type: boolean
title: Select this check box to create dynamic groups and policies that are required for deploying the monitoring solution.
title: Select this check box to create OCI IAM dynamic groups and policies which are required for the monitoring solution
#description: "Ref: https://github.com/oracle-quickstart/oci-kubernetes-monitoring#pre-requisites"
description: "Note: If node pools and the OKE cluster are in different compartments, then the dynamic group definition must be updated."
default: false
required: true
required: true

# Option to create Dynamic Group and Policies
opt_import_dashboards:
type: boolean
title: Select this check box to import dashboards
description: "Note: You may need to manually clean up the dashboards when you destory the stack as dashboards will not be deleted automatically."
default: true
required: true

0 comments on commit fdea39e

Please sign in to comment.