Skip to content

Commit

Permalink
Merge pull request #10 from AxonIQ/SPIKE_autocluster_console
Browse files Browse the repository at this point in the history
Removed autocluster from the properties file
  • Loading branch information
checco committed Jul 8, 2024
2 parents 825b10e + 106c82f commit 4903d10
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

```terraform
module "as_demo" {
source = "[email protected]:AxonIQ/terraform-axonserver-gke.git?ref=v1.1"
source = "[email protected]:AxonIQ/terraform-axonserver-gke.git?ref=v1.4"
nodes_number = 3
cluster_name = "axonserver"
Expand Down
4 changes: 2 additions & 2 deletions conf/axonserver.properties.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

axoniq.axonserver.autocluster.first=${first_name}.${namespace}.svc.cluster.local
axoniq.axonserver.autocluster.contexts=_admin,default
#axoniq.axonserver.autocluster.first=${first_name}.${namespace}.svc.cluster.local
#axoniq.axonserver.autocluster.contexts=_admin,default

axoniq.axonserver.enterprise.licenseDirectory=./license

Expand Down
1 change: 1 addition & 0 deletions secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resource "kubernetes_secret" "axonserver_token" {
}

resource "kubernetes_secret" "axoniq_license" {
count = length(var.console_authentication) > 0 ? 0 : 1
metadata {
name = "axoniq.license"
namespace = kubernetes_namespace.as_demo.id
Expand Down
33 changes: 21 additions & 12 deletions statefulset.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "kubernetes_stateful_set" "axonserver" {
count = var.nodes_number
count = var.nodes_number

metadata {
name = "${var.cluster_name}-${count.index + 1}"
Expand Down Expand Up @@ -82,9 +82,12 @@ resource "kubernetes_stateful_set" "axonserver" {
value = "${var.cluster_name}-${count.index + 1}"
}

env {
name = "AXONIQ_CONSOLE_AUTHENTICATION"
value = var.console_authentication
dynamic "env" {
for_each = length(var.console_authentication) > 0 ? [1] : []
content {
name = "AXONIQ_CONSOLE_AUTHENTICATION"
value = var.console_authentication
}
}

volume_mount {
Expand Down Expand Up @@ -119,10 +122,13 @@ resource "kubernetes_stateful_set" "axonserver" {
read_only = true
}

volume_mount {
name = "license"
mount_path = "/axonserver/license"
read_only = true
dynamic "volume_mount" {
for_each = length(var.console_authentication) > 0 ? [] : [1]
content {
name = "license"
mount_path = "/axonserver/license"
read_only = true
}
}

startup_probe {
Expand Down Expand Up @@ -181,11 +187,14 @@ resource "kubernetes_stateful_set" "axonserver" {
}
}

volume {
name = "license"
dynamic "volume" {
for_each = length(var.console_authentication) > 0 ? [] : [1]
content {
name = "license"

secret {
secret_name = kubernetes_secret.axoniq_license.metadata[0].name
secret {
secret_name = kubernetes_secret.axoniq_license[0].metadata[0].name
}
}
}

Expand Down

0 comments on commit 4903d10

Please sign in to comment.