Skip to content

Commit

Permalink
Enable prometheus monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vipin-dfe committed Dec 2, 2024
1 parent f66de52 commit cbcd3ac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
36 changes: 19 additions & 17 deletions terraform/application/application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ module "web_application" {
service_name = var.service_name
probe_path = "/health"

cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
enable_prometheus_monitoring = var.enable_monitoring

docker_image = var.docker_image
replicas = var.app_replicas
Expand All @@ -53,18 +54,19 @@ module "main_worker" {
source = "./vendor/modules/aks//aks/application"
depends_on = [module.web_application]

namespace = var.namespace
environment = var.environment
service_name = var.service_name
name = "worker"
is_web = false
docker_image = var.docker_image
replicas = var.worker_replicas
max_memory = var.worker_memory_max
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
command = ["/bin/sh", "-c", "bundle exec sidekiq -C config/sidekiq.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
enable_logit = var.enable_logit
namespace = var.namespace
environment = var.environment
service_name = var.service_name
name = "worker"
is_web = false
docker_image = var.docker_image
replicas = var.worker_replicas
max_memory = var.worker_memory_max
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
command = ["/bin/sh", "-c", "bundle exec sidekiq -C config/sidekiq.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
enable_logit = var.enable_logit
enable_prometheus_monitoring = var.enable_monitoring
}
4 changes: 2 additions & 2 deletions terraform/application/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ locals {
allegations_storage_account_name = "${var.azure_resource_prefix}rsmalleg${local.storage_account_environment}sa"

environment_variables = yamldecode(file("${path.module}/config/${var.config}.yml"))
ingress_domain = "${var.service_name}-${var.environment}.${module.cluster_data.ingress_domain}"
external_domain = try(local.environment_variables["EXTERNAL_DOMAIN"], local.ingress_domain)
ingress_domain = "${var.service_name}-${var.environment}.${module.cluster_data.ingress_domain}"
external_domain = try(local.environment_variables["EXTERNAL_DOMAIN"], local.ingress_domain)
}

0 comments on commit cbcd3ac

Please sign in to comment.