From cf8a01460f4d9ff6eb1a44027ed352617d6077fc Mon Sep 17 00:00:00 2001 From: Marek Czajkowski Date: Mon, 23 Jun 2025 08:40:27 +0200 Subject: [PATCH 1/7] Updated helm provider version --- terraform/azure/platform/modules/apisix/versions.tf | 2 +- terraform/azure/platform/providers.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/azure/platform/modules/apisix/versions.tf b/terraform/azure/platform/modules/apisix/versions.tf index 7739f617..6beee365 100644 --- a/terraform/azure/platform/modules/apisix/versions.tf +++ b/terraform/azure/platform/modules/apisix/versions.tf @@ -22,7 +22,7 @@ terraform { } helm = { source = "hashicorp/helm" - version = ">= 2.17.0" + version = ">= 3.0.1" } kubectl = { source = "gavinbunney/kubectl" diff --git a/terraform/azure/platform/providers.tf b/terraform/azure/platform/providers.tf index 8d9b7a57..9fff0d52 100644 --- a/terraform/azure/platform/providers.tf +++ b/terraform/azure/platform/providers.tf @@ -6,7 +6,7 @@ provider "kubernetes" { } provider "helm" { - kubernetes { + kubernetes = { host = module.azure_platform.kubeconfig.host client_certificate = base64decode(module.azure_platform.kubeconfig.client_certificate) client_key = base64decode(module.azure_platform.kubeconfig.client_key) From cefa0c74b46c6903e93cae3ce298cdfa512eaec8 Mon Sep 17 00:00:00 2001 From: Marek Czajkowski Date: Mon, 23 Jun 2025 08:53:10 +0200 Subject: [PATCH 2/7] Updated helm provider version --- terraform/azure/platform/modules/apisix/main.tf | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/terraform/azure/platform/modules/apisix/main.tf b/terraform/azure/platform/modules/apisix/main.tf index 255ba760..06f99de4 100644 --- a/terraform/azure/platform/modules/apisix/main.tf +++ b/terraform/azure/platform/modules/apisix/main.tf @@ -51,13 +51,12 @@ resource "helm_release" "apisix" { version = local.chart_version values = local.values - dynamic "set" { - for_each = local.settings - content { - name = set.key - value = set.value + set = [ + for k, v in local.settings : { + name = k + value = v } - } + ] } resource "kubectl_manifest" "apisix_ingress_patch" { From f73a9ac7b08686fa0fcc857b5607677fa0d14d98 Mon Sep 17 00:00:00 2001 From: Marek Czajkowski Date: Mon, 23 Jun 2025 11:58:19 +0200 Subject: [PATCH 3/7] Updated helm provider version --- terraform/azure/platform/main.tf | 21 ++--- .../azure/platform/modules/apisix/main.tf | 90 ------------------- .../azure/platform/modules/apisix/outputs.tf | 23 ----- .../platform/modules/apisix/variables.tf | 85 ------------------ .../azure/platform/modules/apisix/versions.tf | 32 ------- terraform/azure/platform/outputs.tf | 2 +- 6 files changed, 9 insertions(+), 244 deletions(-) delete mode 100644 terraform/azure/platform/modules/apisix/main.tf delete mode 100644 terraform/azure/platform/modules/apisix/outputs.tf delete mode 100644 terraform/azure/platform/modules/apisix/variables.tf delete mode 100644 terraform/azure/platform/modules/apisix/versions.tf diff --git a/terraform/azure/platform/main.tf b/terraform/azure/platform/main.tf index 080e203e..d0330685 100644 --- a/terraform/azure/platform/main.tf +++ b/terraform/azure/platform/main.tf @@ -26,19 +26,6 @@ module "azure_platform" { public_ip_id = var.public_ip_id } -module "apisix" { - source = "./modules/apisix" - - values = [ - file("${path.module}/config/gateway/values.yaml") - ] - - settings = var.public_ip_address != null && var.public_ip_address != "" ? { - "gateway.annotations.service\\.beta\\.kubernetes\\.io/azure-load-balancer-resource-group" : var.resource_group_name - "gateway.loadBalancerIP" : var.public_ip_address - } : {} -} - module "monitoring_tempo" { source = "./modules/monitoring-tempo" monitoring_storage_container_name = var.monitoring_storage_container_name @@ -82,6 +69,14 @@ module "streamx" { streamx_operator_chart_repository_username = "_json_key_base64" streamx_operator_chart_repository_password = var.streamx_operator_image_pull_secret_registry_password + ingress_controller_apisix_settings = var.public_ip_address != null && var.public_ip_address != "" ? { + "gateway.annotations.service\\.beta\\.kubernetes\\.io/azure-load-balancer-resource-group" : var.resource_group_name + "gateway.loadBalancerIP" : var.public_ip_address + } : {} + ingress_controller_apisix_values= [ + file("${path.module}/config/gateway/values.yaml") + ] + tempo_create_namespace = false tempo_values = [ file("${path.module}/config/monitoring/tempo/values.yaml") diff --git a/terraform/azure/platform/modules/apisix/main.tf b/terraform/azure/platform/modules/apisix/main.tf deleted file mode 100644 index 06f99de4..00000000 --- a/terraform/azure/platform/modules/apisix/main.tf +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -locals { - default_atomic = true - default_chart_name = "apisix-ingress-controller" - default_chart_repository = "https://charts.apiseven.com" - default_chart_version = "0.14.0" - default_cleanup_on_fail = true - default_create_namespace = true - default_namespace = "ingress-apisix" - default_release_name = "apisix" - default_settings = {} - default_timeout = 480 - default_values = [] - - atomic = var.force_defaults_for_null_variables && var.atomic == null ? local.default_atomic : var.atomic - chart_name = var.force_defaults_for_null_variables && var.chart_name == null ? local.default_chart_name : var.chart_name - chart_repository = var.force_defaults_for_null_variables && var.chart_repository == null ? local.default_chart_repository : var.chart_repository - chart_version = var.force_defaults_for_null_variables && var.chart_version == null ? local.default_chart_version : var.chart_version - cleanup_on_fail = var.force_defaults_for_null_variables && var.cleanup_on_fail == null ? local.default_cleanup_on_fail : var.cleanup_on_fail - create_namespace = var.force_defaults_for_null_variables && var.create_namespace == null ? local.default_create_namespace : var.create_namespace - namespace = var.force_defaults_for_null_variables && var.namespace == null ? local.default_namespace : var.namespace - release_name = var.force_defaults_for_null_variables && var.release_name == null ? local.default_release_name : var.release_name - settings = var.force_defaults_for_null_variables && var.settings == null ? local.default_settings : var.settings - timeout = var.force_defaults_for_null_variables && var.timeout == null ? local.default_timeout : var.timeout - values = var.force_defaults_for_null_variables && var.values == null ? local.default_values : var.values -} - -resource "helm_release" "apisix" { - atomic = local.atomic - chart = local.chart_name - cleanup_on_fail = local.cleanup_on_fail - create_namespace = local.create_namespace - name = local.release_name - namespace = local.namespace - repository = local.chart_repository - timeout = local.timeout - version = local.chart_version - values = local.values - - set = [ - for k, v in local.settings : { - name = k - value = v - } - ] -} - -resource "kubectl_manifest" "apisix_ingress_patch" { - yaml_body = < 0 ? local.load_balancer_ingress.0.ip : null -} diff --git a/terraform/azure/platform/modules/apisix/variables.tf b/terraform/azure/platform/modules/apisix/variables.tf deleted file mode 100644 index 1d4c62dc..00000000 --- a/terraform/azure/platform/modules/apisix/variables.tf +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -variable "force_defaults_for_null_variables" { - default = true - description = "Enables forcing default variable values when the variable value passed to the module is null." - type = bool -} - -variable "atomic" { - default = true - description = "Purge the chart on a failed installation. Default's to \"true\"." - type = bool -} - -variable "chart_name" { - default = "apisix-ingress-controller" - description = "The name of the Helm chart to install" - type = string -} - -variable "chart_repository" { - default = "https://charts.apiseven.com" - description = "The repository containing the Helm chart to install" - type = string -} - -variable "chart_version" { - default = "0.14.0" - description = "The version of the Helm chart to install" - type = string -} - -variable "cleanup_on_fail" { - default = true - description = "Allow deletion of new resources created in this upgrade when upgrade fails" - type = bool -} - -variable "create_namespace" { - default = true - description = "Create a namespace for the deployment. Defaults to \"true\"." - type = bool -} - -variable "namespace" { - default = "ingress-apisix" - description = "The namespace used for the deployment" - type = string -} - -variable "release_name" { - default = "apisix" - description = "The name of the helm release" - type = string -} - -variable "settings" { - default = {} - description = "Settings which will be passed to the Helm chart values" - type = map(any) -} - -variable "timeout" { - default = 480 - description = "Time in seconds to wait for any individual kubernetes operation" - type = number -} - -variable "values" { - default = [] - description = "A list of values in raw YAML to be applied to the helm release. Merges with the settings input, can also be used with the `file()` function, i.e. `file(\"my/values.yaml\")`." -} diff --git a/terraform/azure/platform/modules/apisix/versions.tf b/terraform/azure/platform/modules/apisix/versions.tf deleted file mode 100644 index 6beee365..00000000 --- a/terraform/azure/platform/modules/apisix/versions.tf +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -terraform { - required_version = ">= 1.0.0" - required_providers { - kubernetes = { - source = "hashicorp/kubernetes" - version = ">= 2.35.1" - } - helm = { - source = "hashicorp/helm" - version = ">= 3.0.1" - } - kubectl = { - source = "gavinbunney/kubectl" - version = "~> 1.19.0" - } - } -} diff --git a/terraform/azure/platform/outputs.tf b/terraform/azure/platform/outputs.tf index a20b7a35..681b0a18 100644 --- a/terraform/azure/platform/outputs.tf +++ b/terraform/azure/platform/outputs.tf @@ -17,5 +17,5 @@ output "kubeconfig" { output "loadbalancer_ip" { description = "K8s cluster Load Balancer IP" - value = module.apisix.ingress_ip + value = module.streamx.loadbalancer_ip } From 34d1407448813f63d991edf31b2edc8a6c7bd396 Mon Sep 17 00:00:00 2001 From: Marek Czajkowski Date: Mon, 23 Jun 2025 14:34:19 +0200 Subject: [PATCH 4/7] Updated helm provider version --- terraform/azure/platform/providers.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/azure/platform/providers.tf b/terraform/azure/platform/providers.tf index 9fff0d52..8d9b7a57 100644 --- a/terraform/azure/platform/providers.tf +++ b/terraform/azure/platform/providers.tf @@ -6,7 +6,7 @@ provider "kubernetes" { } provider "helm" { - kubernetes = { + kubernetes { host = module.azure_platform.kubeconfig.host client_certificate = base64decode(module.azure_platform.kubeconfig.client_certificate) client_key = base64decode(module.azure_platform.kubeconfig.client_key) From d9f8402a67d1f61036eabb1bd36ef3582f2d35b2 Mon Sep 17 00:00:00 2001 From: Marek Czajkowski Date: Mon, 23 Jun 2025 15:16:45 +0200 Subject: [PATCH 5/7] Updated helm provider version --- terraform/azure/platform/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/azure/platform/main.tf b/terraform/azure/platform/main.tf index d0330685..e484b6fa 100644 --- a/terraform/azure/platform/main.tf +++ b/terraform/azure/platform/main.tf @@ -55,7 +55,7 @@ module "grafana_secret" { module "streamx" { source = "streamx-dev/charts/helm" - version = "0.0.6" + version = "0.0.13" ingress_controller_nginx_enabled = false cert_manager_lets_encrypt_issuer_acme_email = var.cert_manager_lets_encrypt_issuer_acme_email From 90fd5e7688339ae75b6014d2245c8dba612e5bb3 Mon Sep 17 00:00:00 2001 From: Marek Czajkowski Date: Mon, 23 Jun 2025 15:19:17 +0200 Subject: [PATCH 6/7] Updated helm provider version --- terraform/azure/platform/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/azure/platform/main.tf b/terraform/azure/platform/main.tf index e484b6fa..df44edee 100644 --- a/terraform/azure/platform/main.tf +++ b/terraform/azure/platform/main.tf @@ -73,7 +73,7 @@ module "streamx" { "gateway.annotations.service\\.beta\\.kubernetes\\.io/azure-load-balancer-resource-group" : var.resource_group_name "gateway.loadBalancerIP" : var.public_ip_address } : {} - ingress_controller_apisix_values= [ + ingress_controller_apisix_values = [ file("${path.module}/config/gateway/values.yaml") ] From 17cb7e231485dc366e0e43cf62a94f237382e2a2 Mon Sep 17 00:00:00 2001 From: Marek Czajkowski Date: Mon, 23 Jun 2025 15:35:51 +0200 Subject: [PATCH 7/7] Updated helm provider version --- terraform/azure/platform/versions.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terraform/azure/platform/versions.tf b/terraform/azure/platform/versions.tf index 4b291094..f4ce5d2c 100644 --- a/terraform/azure/platform/versions.tf +++ b/terraform/azure/platform/versions.tf @@ -9,5 +9,9 @@ terraform { source = "gavinbunney/kubectl" version = "~> 1.19.0" } + helm = { + source = "hashicorp/helm" + version = ">= 2.17.0, < 3.0.0" + } } }