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: Adding trino helm as add-on #23

Merged
merged 1 commit into from
Mar 16, 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.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 |
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
Expand Down Expand Up @@ -144,6 +145,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_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 |
| <a name="input_flink_operator_helm_config"></a> [flink\_operator\_helm\_config](#input\_flink\_operator\_helm\_config) | Flink Operator Helm Chart config | `any` | `{}` | no |
Expand All @@ -159,6 +161,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_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 trino.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
locals {
trino_name = "trino"
trino_repo = "https://trinodb.github.io/charts"
trino_version = "0.18.0"
}

resource "helm_release" "trino" {
count = var.enable_trino ? 1 : 0

name = try(var.trino_helm_config["name"], local.trino_name)
repository = try(var.trino_helm_config["repository"], local.trino_repo)
chart = try(var.trino_helm_config["chart"], "trino")
version = try(var.trino_helm_config["version"], local.trino_version)
timeout = try(var.trino_helm_config["timeout"], 300)
values = try(var.trino_helm_config["values"], null)
create_namespace = try(var.trino_helm_config["create_namespace"], true)
namespace = try(var.trino_helm_config["namespace"], local.trino_name)
lint = try(var.trino_helm_config["lint"], false)
description = try(var.trino_helm_config["description"], "")
repository_key_file = try(var.trino_helm_config["repository_key_file"], "")
repository_cert_file = try(var.trino_helm_config["repository_cert_file"], "")
repository_username = try(var.trino_helm_config["repository_username"], "")
repository_password = try(var.trino_helm_config["repository_password"], "")
verify = try(var.trino_helm_config["verify"], false)
keyring = try(var.trino_helm_config["keyring"], "")
disable_webhooks = try(var.trino_helm_config["disable_webhooks"], false)
reuse_values = try(var.trino_helm_config["reuse_values"], false)
reset_values = try(var.trino_helm_config["reset_values"], false)
force_update = try(var.trino_helm_config["force_update"], false)
recreate_pods = try(var.trino_helm_config["recreate_pods"], false)
cleanup_on_fail = try(var.trino_helm_config["cleanup_on_fail"], false)
max_history = try(var.trino_helm_config["max_history"], 0)
atomic = try(var.trino_helm_config["atomic"], false)
skip_crds = try(var.trino_helm_config["skip_crds"], false)
render_subchart_notes = try(var.trino_helm_config["render_subchart_notes"], true)
disable_openapi_validation = try(var.trino_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.trino_helm_config["wait_for_jobs"], false)
dependency_update = try(var.trino_helm_config["dependency_update"], false)
replace = try(var.trino_helm_config["replace"], false)

postrender {
binary_path = try(var.trino_helm_config["postrender"], "")
}

dynamic "set" {
iterator = each_item
for_each = try(var.trino_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.trino_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 @@ -334,3 +334,18 @@ variable "nvidia_device_plugin_helm_config" {
type = any
default = {}
}

#---------------------------------------------------
# Trino
#---------------------------------------------------
variable "enable_trino" {
description = "Enable Trino add-on"
type = bool
default = false
}

variable "trino_helm_config" {
description = "Trino Helm Chart config"
type = any
default = {}
}