diff --git a/modules/nxiq-ha-cluster/config.yml b/modules/nxiq-ha-cluster/config.yml index 4301cdc..1753713 100644 --- a/modules/nxiq-ha-cluster/config.yml +++ b/modules/nxiq-ha-cluster/config.yml @@ -15,4 +15,8 @@ server: applicationContextPath: / applicationConnectors: - type: http - port: 8070 \ No newline at end of file + port: 8070 + adminContextPath: / + adminConnectors: + - type: http + port: 8071 \ No newline at end of file diff --git a/modules/nxiq-ha-cluster/main.tf b/modules/nxiq-ha-cluster/main.tf index f1622a8..323561a 100644 --- a/modules/nxiq-ha-cluster/main.tf +++ b/modules/nxiq-ha-cluster/main.tf @@ -169,9 +169,15 @@ resource "kubernetes_deployment" "nxiq" { } port { + name = "app" container_port = 8070 } + port { + name = "admin" + container_port = 8071 + } + security_context { run_as_user = 1000 } @@ -224,7 +230,7 @@ resource "kubernetes_deployment" "nxiq" { # -------------------------------------------------------------------------- # Create k8s Service # -------------------------------------------------------------------------- -resource "kubernetes_service" "nxiq" { +resource "kubernetes_service" "nxiq-app" { metadata { name = "nxiq-ha-${var.nxiq_name}-svc" namespace = local.namespace @@ -247,3 +253,27 @@ resource "kubernetes_service" "nxiq" { type = "NodePort" } } + +resource "kubernetes_service" "nxiq-admin" { + metadata { + name = "nxiq-ha-${var.nxiq_name}-admin-svc" + namespace = local.namespace + labels = { + app = "nxiq-ha" + } + } + spec { + selector = { + app = kubernetes_deployment.nxiq.metadata.0.labels.app + } + + port { + name = "http" + port = 8071 + target_port = 8071 + protocol = "TCP" + } + + type = "NodePort" + } +} diff --git a/modules/nxiq-ha-cluster/outputs.tf b/modules/nxiq-ha-cluster/outputs.tf index 3422bcc..44e0d44 100644 --- a/modules/nxiq-ha-cluster/outputs.tf +++ b/modules/nxiq-ha-cluster/outputs.tf @@ -21,9 +21,17 @@ output "nxiq_ha_k8s_namespace" { } output "nxiq_ha_k8s_service_id" { - value = kubernetes_service.nxiq.id + value = kubernetes_service.nxiq-app.id } output "nxiq_ha_k8s_service_name" { value = "nxiq-ha-${var.nxiq_name}-svc" } + +output "nxiq_ha_k8s_admin_service_id" { + value = kubernetes_service.nxiq-admin.id +} + +output "nxiq_ha_k8s_admin_service_name" { + value = "nxiq-ha-${var.nxiq_name}-admin-svc" +} diff --git a/outputs.tf b/outputs.tf index cd8dd6f..5a56dce 100644 --- a/outputs.tf +++ b/outputs.tf @@ -27,3 +27,11 @@ output "nxiq_ha_k8s_service_id" { output "nxiq_ha_k8s_service_name" { value = module.nxiq_ha_cluster.nxiq_ha_k8s_service_name } + +output "nxiq_ha_k8s_admin_service_id" { + value = module.nxiq_ha_cluster.nxiq_ha_k8s_admin_service_id +} + +output "nxiq_ha_k8s_admin_service_name" { + value = module.nxiq_ha_cluster.nxiq_ha_k8s_admin_service_name +}