Skip to content

Commit

Permalink
refactor: deploy with repo armonik.infra
Browse files Browse the repository at this point in the history
  • Loading branch information
iadjadj committed Jul 19, 2023
1 parent c88b0bb commit 12451b2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 21 deletions.
3 changes: 0 additions & 3 deletions infrastructure/quick-deploy/localhost/all/armonik.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module "armonik" {
source = "./generated/infra-modules/armonik"
working_dir = "${path.root}/../../.."
namespace = local.namespace
logging_level = var.logging_level
storage_endpoint_url = local.storage_endpoint_url
monitoring = local.monitoring
extra_conf = var.extra_conf

// To avoid the "known after apply" behavior that arises from using depends_on, we are using a ternary expression to impose implicit dependencies on the below secrets.
Expand Down
9 changes: 0 additions & 9 deletions infrastructure/quick-deploy/localhost/all/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module "seq" {
tag = try(coalesce(var.seq.cli_image_tag), local.default_tags[var.seq.cli_image_name])
image_pull_secrets = var.seq.cli_pull_secrets
}
working_dir = "${path.root}/../../.."
authentication = var.seq.authentication
system_ram_target = var.seq.system_ram_target
retention_in_days = var.seq.retention_in_days
Expand Down Expand Up @@ -53,7 +52,6 @@ module "node_exporter" {
tag = try(coalesce(var.node_exporter.image_tag), local.default_tags[var.node_exporter.image_name])
image_pull_secrets = var.node_exporter.pull_secrets
}
working_dir = "${path.root}/../../../.."
}

# Metrics exporter
Expand All @@ -62,14 +60,12 @@ module "metrics_exporter" {
namespace = local.namespace
service_type = var.metrics_exporter.service_type
node_selector = var.metrics_exporter.node_selector
storage_endpoint_url = local.storage_endpoint_url
docker_image = {
image = var.metrics_exporter.image_name
tag = try(coalesce(var.metrics_exporter.image_tag), local.default_tags[var.metrics_exporter.image_name])
image_pull_secrets = var.metrics_exporter.pull_secrets
}
extra_conf = var.metrics_exporter.extra_conf
working_dir = "${path.root}/../../.."
}

resource "kubernetes_secret" "metrics_exporter" {
Expand All @@ -93,15 +89,13 @@ module "partition_metrics_exporter" {
namespace = local.namespace
service_type = var.partition_metrics_exporter.service_type
node_selector = var.partition_metrics_exporter.node_selector
storage_endpoint_url = local.storage_endpoint_url
metrics_exporter_url = "${module.metrics_exporter.host}:${module.metrics_exporter.port}"
docker_image = {
image = var.partition_metrics_exporter.image_name
tag = try(coalesce(var.partition_metrics_exporter.image_tag), local.default_tags[var.partition_metrics_exporter.image_name])
image_pull_secrets = var.partition_metrics_exporter.pull_secrets
}
extra_conf = var.partition_metrics_exporter.extra_conf
working_dir = "${path.root}/../../.."
depends_on = [module.metrics_exporter]
}

Expand Down Expand Up @@ -132,13 +126,11 @@ module "prometheus" {
service_type = var.prometheus.service_type
node_selector = var.prometheus.node_selector
metrics_exporter_url = "${module.metrics_exporter.host}:${module.metrics_exporter.port}"
partition_metrics_exporter_url = length(module.partition_metrics_exporter) == 1 ? "${module.partition_metrics_exporter[0].host}:${module.partition_metrics_exporter[0].port}" : null
docker_image = {
image = var.prometheus.image_name
tag = try(coalesce(var.prometheus.image_tag), local.default_tags[var.prometheus.image_name])
image_pull_secrets = var.prometheus.pull_secrets
}
working_dir = "${path.root}/../../.."
}

resource "kubernetes_secret" "prometheus" {
Expand Down Expand Up @@ -167,7 +159,6 @@ module "grafana" {
tag = try(coalesce(var.grafana.image_tag), local.default_tags[var.grafana.image_name])
image_pull_secrets = var.grafana.pull_secrets
}
working_dir = "${path.root}/../../.."
authentication = var.grafana.authentication
}

Expand Down
7 changes: 2 additions & 5 deletions infrastructure/quick-deploy/localhost/all/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
module "activemq" {
source = "./generated/infra-modules/storage/onpremise/activemq"
namespace = local.namespace
working_dir = "${path.root}/../../.."
activemq = {
activemq = {
image = var.activemq.image_name
tag = try(coalesce(var.activemq.image_tag), local.default_tags[var.activemq.image_name])
node_selector = var.activemq.node_selector
Expand All @@ -15,7 +14,6 @@ module "activemq" {
module "mongodb" {
source = "./generated/infra-modules/storage/onpremise/mongodb"
namespace = local.namespace
working_dir = "${path.root}/../../.."
mongodb = {
image = var.mongodb.image_name
tag = try(coalesce(var.mongodb.image_tag), local.default_tags[var.mongodb.image_name])
Expand All @@ -31,8 +29,7 @@ module "redis" {
count = var.redis != null ? 1 : 0
source = "./generated/infra-modules/storage/onpremise/redis"
namespace = local.namespace
working_dir = "${path.root}/../../.."
redis = {
redis = {
image = var.redis.image_name
tag = try(coalesce(var.redis.image_tag), local.default_tags[var.redis.image_name])
node_selector = var.redis.node_selector
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/quick-deploy/localhost/all/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ terraform {
}
local = {
source = "hashicorp/local"
version = "~> 2.2.0"
version = "~> 2.4.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.4.3"
version = "~> 3.5.1"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13.0"
version = "~> 2.21.1"
}
kubectl = {
source = "gavinbunney/kubectl"
Expand Down
2 changes: 1 addition & 1 deletion versions.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"armonik_versions": {
"armonik": "2.14.0",
"infra": "0.0.2",
"infra": "main",
"core": "0.14.3",
"api": "3.10.0",
"gui": "0.9.2",
Expand Down

0 comments on commit 12451b2

Please sign in to comment.