Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Apache Superset addon added #30

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -145,6 +146,7 @@ module "eks_data_addons" {
| <a name="input_enable_spark_history_server"></a> [enable\_spark\_history\_server](#input\_enable\_spark\_history\_server) | Enable Spark History Server add-on | `bool` | `false` | no |
| <a name="input_enable_spark_operator"></a> [enable\_spark\_operator](#input\_enable\_spark\_operator) | Enable Spark on K8s Operator add-on | `bool` | `false` | no |
| <a name="input_enable_strimzi_kafka_operator"></a> [enable\_strimzi\_kafka\_operator](#input\_enable\_strimzi\_kafka\_operator) | Enable the Strimzi Kafka Operator | `bool` | `false` | no |
| <a name="input_enable_superset"></a> [enable\_superset](#input\_enable\_superset) | Enable Apache Supeset add-on | `bool` | `false` | no |
| <a name="input_enable_trino"></a> [enable\_trino](#input\_enable\_trino) | Enable Trino add-on | `bool` | `false` | no |
| <a name="input_enable_volcano"></a> [enable\_volcano](#input\_enable\_volcano) | Enable volcano scheduler add-on | `bool` | `false` | no |
| <a name="input_enable_yunikorn"></a> [enable\_yunikorn](#input\_enable\_yunikorn) | Enable Apache YuniKorn K8s scheduler add-on | `bool` | `false` | no |
Expand All @@ -161,6 +163,7 @@ module "eks_data_addons" {
| <a name="input_spark_history_server_helm_config"></a> [spark\_history\_server\_helm\_config](#input\_spark\_history\_server\_helm\_config) | Helm configuration for Spark History Server | `any` | `{}` | no |
| <a name="input_spark_operator_helm_config"></a> [spark\_operator\_helm\_config](#input\_spark\_operator\_helm\_config) | Helm configuration for Spark K8s Operator | `any` | `{}` | no |
| <a name="input_strimzi_kafka_operator_helm_config"></a> [strimzi\_kafka\_operator\_helm\_config](#input\_strimzi\_kafka\_operator\_helm\_config) | Helm configuration for Strimzi Kafka Operator | `any` | `{}` | no |
| <a name="input_superset_helm_config"></a> [superset\_helm\_config](#input\_superset\_helm\_config) | Apache Supeset Helm Chart config | `any` | `{}` | no |
| <a name="input_trino_helm_config"></a> [trino\_helm\_config](#input\_trino\_helm\_config) | Trino Helm Chart config | `any` | `{}` | no |
| <a name="input_volcano_helm_config"></a> [volcano\_helm\_config](#input\_volcano\_helm\_config) | Volcano scheduler add-on configurations | `any` | `{}` | no |
| <a name="input_yunikorn_helm_config"></a> [yunikorn\_helm\_config](#input\_yunikorn\_helm\_config) | Helm configuration for Apache YuniKorn | `any` | `{}` | no |
Expand Down
68 changes: 68 additions & 0 deletions superset.tf
Original file line number Diff line number Diff line change
@@ -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)
}
}

}
15 changes: 15 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}
Loading