From 0db48830a551b55658940bbcdfb87a78bbb3b1cc Mon Sep 17 00:00:00 2001 From: Vara Bonthu Date: Fri, 5 Apr 2024 12:58:35 -0700 Subject: [PATCH] Apache Superset addon added --- README.md | 3 +++ superset.tf | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ variables.tf | 15 ++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 superset.tf diff --git a/README.md b/README.md index a375b3d..73388f2 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ module "eks_data_addons" { | [helm_release.spark_history_server](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.spark_operator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.strimzi_kafka_operator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | +| [helm_release.superset](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.trino](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.volcano](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.yunikorn](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | @@ -145,6 +146,7 @@ module "eks_data_addons" { | [enable\_spark\_history\_server](#input\_enable\_spark\_history\_server) | Enable Spark History Server add-on | `bool` | `false` | no | | [enable\_spark\_operator](#input\_enable\_spark\_operator) | Enable Spark on K8s Operator add-on | `bool` | `false` | no | | [enable\_strimzi\_kafka\_operator](#input\_enable\_strimzi\_kafka\_operator) | Enable the Strimzi Kafka Operator | `bool` | `false` | no | +| [enable\_superset](#input\_enable\_superset) | Enable Apache Supeset add-on | `bool` | `false` | no | | [enable\_trino](#input\_enable\_trino) | Enable Trino add-on | `bool` | `false` | no | | [enable\_volcano](#input\_enable\_volcano) | Enable volcano scheduler add-on | `bool` | `false` | no | | [enable\_yunikorn](#input\_enable\_yunikorn) | Enable Apache YuniKorn K8s scheduler add-on | `bool` | `false` | no | @@ -161,6 +163,7 @@ module "eks_data_addons" { | [spark\_history\_server\_helm\_config](#input\_spark\_history\_server\_helm\_config) | Helm configuration for Spark History Server | `any` | `{}` | no | | [spark\_operator\_helm\_config](#input\_spark\_operator\_helm\_config) | Helm configuration for Spark K8s Operator | `any` | `{}` | no | | [strimzi\_kafka\_operator\_helm\_config](#input\_strimzi\_kafka\_operator\_helm\_config) | Helm configuration for Strimzi Kafka Operator | `any` | `{}` | no | +| [superset\_helm\_config](#input\_superset\_helm\_config) | Apache Supeset Helm Chart config | `any` | `{}` | no | | [trino\_helm\_config](#input\_trino\_helm\_config) | Trino Helm Chart config | `any` | `{}` | no | | [volcano\_helm\_config](#input\_volcano\_helm\_config) | Volcano scheduler add-on configurations | `any` | `{}` | no | | [yunikorn\_helm\_config](#input\_yunikorn\_helm\_config) | Helm configuration for Apache YuniKorn | `any` | `{}` | no | diff --git a/superset.tf b/superset.tf new file mode 100644 index 0000000..d51de2b --- /dev/null +++ b/superset.tf @@ -0,0 +1,68 @@ +locals { + superset_name = "superset" + superset_repo = "https://apache.github.io/superset" + superset_version = "0.12.8" +} + +resource "helm_release" "superset" { + count = var.enable_superset ? 1 : 0 + + name = try(var.superset_helm_config["name"], local.superset_name) + repository = try(var.superset_helm_config["repository"], local.superset_repo) + chart = try(var.superset_helm_config["chart"], local.superset_name) + version = try(var.superset_helm_config["version"], local.superset_version) + timeout = try(var.superset_helm_config["timeout"], 300) + values = try(var.superset_helm_config["values"], null) + create_namespace = try(var.superset_helm_config["create_namespace"], true) + namespace = try(var.superset_helm_config["namespace"], local.superset_name) + lint = try(var.superset_helm_config["lint"], false) + description = try(var.superset_helm_config["description"], "") + repository_key_file = try(var.superset_helm_config["repository_key_file"], "") + repository_cert_file = try(var.superset_helm_config["repository_cert_file"], "") + repository_username = try(var.superset_helm_config["repository_username"], "") + repository_password = try(var.superset_helm_config["repository_password"], "") + verify = try(var.superset_helm_config["verify"], false) + keyring = try(var.superset_helm_config["keyring"], "") + disable_webhooks = try(var.superset_helm_config["disable_webhooks"], false) + reuse_values = try(var.superset_helm_config["reuse_values"], false) + reset_values = try(var.superset_helm_config["reset_values"], false) + force_update = try(var.superset_helm_config["force_update"], false) + recreate_pods = try(var.superset_helm_config["recreate_pods"], false) + cleanup_on_fail = try(var.superset_helm_config["cleanup_on_fail"], false) + max_history = try(var.superset_helm_config["max_history"], 0) + atomic = try(var.superset_helm_config["atomic"], false) + skip_crds = try(var.superset_helm_config["skip_crds"], false) + render_subchart_notes = try(var.superset_helm_config["render_subchart_notes"], true) + disable_openapi_validation = try(var.superset_helm_config["disable_openapi_validation"], false) + wait = try(var.airflow_helm_config["wait"], false) # This is critical setting. Check this issue -> https://github.com/hashicorp/terraform-provider-helm/issues/683 + wait_for_jobs = try(var.superset_helm_config["wait_for_jobs"], false) + dependency_update = try(var.superset_helm_config["dependency_update"], false) + replace = try(var.superset_helm_config["replace"], false) + + postrender { + binary_path = try(var.superset_helm_config["postrender"], "") + } + + dynamic "set" { + iterator = each_item + for_each = try(var.superset_helm_config["set"], []) + + content { + name = each_item.value.name + value = each_item.value.value + type = try(each_item.value.type, null) + } + } + + dynamic "set_sensitive" { + iterator = each_item + for_each = try(var.superset_helm_config["set_sensitive"], []) + + content { + name = each_item.value.name + value = each_item.value.value + type = try(each_item.value.type, null) + } + } + +} diff --git a/variables.tf b/variables.tf index 626df00..3e8d0d4 100644 --- a/variables.tf +++ b/variables.tf @@ -349,3 +349,18 @@ variable "trino_helm_config" { type = any default = {} } + +#--------------------------------------------------- +# Apache Superset +#--------------------------------------------------- +variable "enable_superset" { + description = "Enable Apache Supeset add-on" + type = bool + default = false +} + +variable "superset_helm_config" { + description = "Apache Supeset Helm Chart config" + type = any + default = {} +}