From 6b4a91a4d0381b3138168a7ab5e02e7bfa17510c Mon Sep 17 00:00:00 2001 From: Francesco Latini Date: Mon, 12 Aug 2024 18:25:58 +0200 Subject: [PATCH 1/2] Pass a axonserver.properties file as a variable --- README.md | 10 ++++++---- configmap.tf | 6 +++++- variables.tf | 6 ++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cd12861..81b4154 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ ```terraform module "as_demo" { - source = "git@github.com:AxonIQ/terraform-axonserver-k8s.git?ref=v1.8" + source = "git@github.com:AxonIQ/terraform-axonserver-k8s.git?ref=v1.9" - axonserver_release = "2024.0.4" - java_version = "11" + axonserver_release = "2024.1.0" + java_version = "17" nodes_number = 3 cluster_name = "axonserver" @@ -30,6 +30,7 @@ module "as_demo" { namespace = "axonserver" axonserver_license_path = file("${path.module}/axoniq.license") + axonserver_properties = file("${path.module}/axonserver.properties") } ``` @@ -43,7 +44,8 @@ module "as_demo" { | [cluster\_name](#input\_cluster\_name) | Axon Server cluster name. | `string` | `""` | yes | | [nodes\_number](#input\_nodes\_number) | The number of nodes deployed inside the cluster. | `number` | `1` | yes | | [public\_domain](#input\_public\_domain) | The domain that is added to the hostname when returning hostnames to client applications. | `string` | `""` | yes | -| [axonserver\_license\_path](#input\_axonserver\_license\_path) | The path to the Axon Server license | `string` | `""` | yes | +| [axonserver\_license\_path](#input\_axonserver\_license\_path) | The path to the Axon Server license | `string` | `""` | yes | +| [axonserver\_properties](#input\_axonserver\_properties) | The path to the Axon Server properties file | `string` | `""` | no | | [console\_authentication](#input\_console\_authentication) | Console authentication token | `string` | `""` | no | | [java\_version](#input\_java\_version) | Java runtime | `number` | `"11"` | no | | [resources\_limits\_cpu](#input\_resources\_limits\_cpu) | spec.container.resources.limits.cpu | `number` | `"1"` | no | diff --git a/configmap.tf b/configmap.tf index a0d38a8..132a66f 100755 --- a/configmap.tf +++ b/configmap.tf @@ -1,3 +1,7 @@ +locals { + axonserver_properties = var.axonserver_properties == "" ? data.template_file.axonserver_properties.rendered : var.axonserver_properties +} + data "template_file" "axonserver_properties" { template = file("${path.module}/conf/axonserver.properties.tmpl") @@ -17,6 +21,6 @@ resource "kubernetes_config_map" "axonserver_properties" { } data = { - "axonserver.properties" = data.template_file.axonserver_properties.rendered + "axonserver.properties" = local.axonserver_properties } } diff --git a/variables.tf b/variables.tf index a4b3a2c..adb6652 100755 --- a/variables.tf +++ b/variables.tf @@ -94,6 +94,12 @@ variable "plugins_storage" { default = "1Gi" } +variable "axonserver_properties" { + description = "Path to axonserver.properties file" + type = string + default = "" +} + variable "devmode_enabled" { description = "Axon Server devmode" type = bool From 7a86276c9754fa039405241701fba3985ff9b8fd Mon Sep 17 00:00:00 2001 From: Francesco Latini Date: Mon, 12 Aug 2024 18:27:17 +0200 Subject: [PATCH 2/2] Changed the default release to 2024.1.0 --- README.md | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 81b4154..a5caf74 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ module "as_demo" { | Name | Description | Type | Default | Required | |-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|----------------------------------|:--------:| -| [axonserver\_release](#input\_axonserver\_release) | Axon Server Release namespace. | `string` | `"2024.0.4"` | no | +| [axonserver\_release](#input\_axonserver\_release) | Axon Server Release namespace. | `string` | `"2024.1.0"` | no | | [namespace](#input\_namespace) | Kubernetes cluster namespace. | `string` | `"axonserver"` | yes | | [cluster\_name](#input\_cluster\_name) | Axon Server cluster name. | `string` | `""` | yes | | [nodes\_number](#input\_nodes\_number) | The number of nodes deployed inside the cluster. | `number` | `1` | yes | diff --git a/variables.tf b/variables.tf index adb6652..adcdb25 100755 --- a/variables.tf +++ b/variables.tf @@ -1,7 +1,7 @@ variable "axonserver_release" { description = "Axonserver Release" type = string - default = "2024.0.4" + default = "2024.1.0" } variable "namespace" {