From 47ecef96e8dff7110d0c54ab081c955e47ac7ca2 Mon Sep 17 00:00:00 2001 From: Abderrahmane DKOUR Date: Thu, 12 Dec 2024 16:54:18 +0100 Subject: [PATCH] Added SQS support to ArmoniK --- infrastructure/quick-deploy/aws/Makefile | 2 +- infrastructure/quick-deploy/aws/armonik.tf | 10 ++- .../quick-deploy/aws/parameters.tfvars | 2 +- infrastructure/quick-deploy/aws/storage.tf | 19 ++++++ infrastructure/quick-deploy/aws/variables.tf | 6 ++ versions.tfvars.json | 66 +++++++++---------- 6 files changed, 67 insertions(+), 38 deletions(-) diff --git a/infrastructure/quick-deploy/aws/Makefile b/infrastructure/quick-deploy/aws/Makefile index e7ffebaf8..9b02079f4 100644 --- a/infrastructure/quick-deploy/aws/Makefile +++ b/infrastructure/quick-deploy/aws/Makefile @@ -109,4 +109,4 @@ clean: rm -rf $(TF_DATA_DIR) .terraform.lock.hcl .terraform docs: - terraform-docs markdown table --output-file parameters.md --output-mode inject $(CURRENT_DIR) + terraform-docs markdown table --output-file parameters.md --output-mode inject $(CURRENT_DIR) \ No newline at end of file diff --git a/infrastructure/quick-deploy/aws/armonik.tf b/infrastructure/quick-deploy/aws/armonik.tf index b77ff7a0b..78427d743 100644 --- a/infrastructure/quick-deploy/aws/armonik.tf +++ b/infrastructure/quick-deploy/aws/armonik.tf @@ -4,7 +4,7 @@ module "armonik" { logging_level = var.logging_level configurations = merge(var.configurations, { - core = [module.mq, module.elasticache, module.mongodb, module.mongodb_sharded, var.configurations.core] + core = [module.sqs, module.mq, module.elasticache, module.mongodb, module.mongodb_sharded, var.configurations.core] }) fluent_bit = module.fluent_bit @@ -26,6 +26,7 @@ module "armonik" { pod_configuration = null } }, v, { + service_account_name = try(coalesce(v.service_account_name, var.sqs_service_account_name), "") polling_agent = merge(v.polling_agent, { image = local.ecr_images["${v.polling_agent.image}:${try(coalesce(v.polling_agent.tag), "")}"].name tag = local.ecr_images["${v.polling_agent.image}:${try(coalesce(v.polling_agent.tag), "")}"].tag @@ -36,8 +37,9 @@ module "armonik" { })] }) } control_plane = merge(var.control_plane, { - image = local.ecr_images["${var.control_plane.image}:${try(coalesce(var.control_plane.tag), "")}"].name - tag = local.ecr_images["${var.control_plane.image}:${try(coalesce(var.control_plane.tag), "")}"].tag + image = local.ecr_images["${var.control_plane.image}:${try(coalesce(var.control_plane.tag), "")}"].name + tag = local.ecr_images["${var.control_plane.image}:${try(coalesce(var.control_plane.tag), "")}"].tag + service_account_name = try(var.sqs_service_account_name, "") }) admin_gui = merge(var.admin_gui, { image = local.ecr_images["${var.admin_gui.image}:${try(coalesce(var.admin_gui.tag), "")}"].name @@ -76,4 +78,6 @@ module "armonik" { image = local.ecr_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].image tag = local.ecr_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].tag }) + + depends_on = [module.sqs_service_account] } diff --git a/infrastructure/quick-deploy/aws/parameters.tfvars b/infrastructure/quick-deploy/aws/parameters.tfvars index 48927709f..f3a6b9836 100644 --- a/infrastructure/quick-deploy/aws/parameters.tfvars +++ b/infrastructure/quick-deploy/aws/parameters.tfvars @@ -718,4 +718,4 @@ environment_description = { version = "0.0.0" description = "AWS environment" color = "#80ff80" -} +} \ No newline at end of file diff --git a/infrastructure/quick-deploy/aws/storage.tf b/infrastructure/quick-deploy/aws/storage.tf index aacf072ac..c2e236967 100644 --- a/infrastructure/quick-deploy/aws/storage.tf +++ b/infrastructure/quick-deploy/aws/storage.tf @@ -122,6 +122,7 @@ resource "kubernetes_secret" "elasticache" { # Amazon MQ module "mq" { + count = length(var.sqs_service_account_name) > 0 ? 0 : 1 source = "./generated/infra-modules/storage/aws/mq" tags = local.tags name = "${local.prefix}-mq" @@ -143,6 +144,24 @@ module "mq" { kms_key_id = local.kms_key } +module "sqs" { + count = length(var.sqs_service_account_name) > 0 ? 1 : 0 + source = "./generated/infra-modules/storage/aws/sqs" + region = var.region + prefix = local.prefix +} + +module "sqs_service_account" { + count = length(var.sqs_service_account_name) > 0 ? 1 : 0 + namespace = local.namespace + source = "./generated/infra-modules/service-account/aws" + prefix = local.prefix + service_account_name = var.sqs_service_account_name + oidc_provider_arn = module.eks.aws_eks_module.oidc_provider_arn + oidc_issuer_url = module.eks.aws_eks_module.cluster_oidc_issuer_url + decrypt_policy_arn = aws_iam_policy.decrypt_object.arn +} + # MongoDB module "mongodb" { count = can(coalesce(var.mongodb_sharding)) ? 0 : 1 diff --git a/infrastructure/quick-deploy/aws/variables.tf b/infrastructure/quick-deploy/aws/variables.tf index 0de972938..f08e30a04 100644 --- a/infrastructure/quick-deploy/aws/variables.tf +++ b/infrastructure/quick-deploy/aws/variables.tf @@ -301,6 +301,12 @@ variable "mq_credentials" { } } +variable "sqs_service_account_name" { + description = "Name to use for the created SQS service account, SQS will be used when set" # no spaces or _ or else it'll fail to deploy (validation?) + type = string + default = "" +} + # Parameters for MongoDB variable "mongodb" { description = "Parameters of MongoDB" diff --git a/versions.tfvars.json b/versions.tfvars.json index de7c8582a..c2925585f 100644 --- a/versions.tfvars.json +++ b/versions.tfvars.json @@ -1,13 +1,13 @@ { "armonik_versions": { - "armonik": "2.20.0", - "infra": "0.6.1-pre1-fbd66b9", + "armonik": "2.21.0", + "infra": "0.7.0", "infra_plugins": "0.1.1", - "core": "0.27.2", - "api": "3.19.0", - "gui": "0.12.4", - "extcsharp": "0.12.9", - "samples": "2.20.0" + "core": "0.28.0", + "api": "3.21.0", + "gui": "0.13.3", + "extcsharp": "0.12.11", + "samples": "2.21.0" }, "armonik_images": { "armonik": [ @@ -47,46 +47,46 @@ ] }, "image_tags": { - "registry.k8s.io/autoscaling/cluster-autoscaler": "v1.30.2", - "registry.k8s.io/metrics-server/metrics-server": "v0.7.1", - "ghcr.io/kedacore/keda": "2.9.3", - "ghcr.io/kedacore/keda-metrics-apiserver": "2.9.3", + "registry.k8s.io/autoscaling/cluster-autoscaler": "v1.31.0", + "registry.k8s.io/metrics-server/metrics-server": "v0.7.2", + "ghcr.io/kedacore/keda": "2.16.0", + "ghcr.io/kedacore/keda-metrics-apiserver": "2.16.0", "public.ecr.aws/aws-ec2/aws-node-termination-handler": "v1.22.1", - "public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver": "v2.0.6", - "public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe": "v2.13.0-eks-1-30-11", - "public.ecr.aws/eks-distro/kubernetes-csi/node-driver-registrar": "v2.11.0-eks-1-30-11", - "public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner": "v5.0.1-eks-1-30-11", + "public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver": "v2.1.0", + "public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe": "v2.14.0-eks-1-31-7", + "public.ecr.aws/eks-distro/kubernetes-csi/node-driver-registrar": "v2.12.0-eks-1-31-7", + "public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner": "v5.1.0-eks-1-31-7", "symptoma/activemq": "5.18.4", - "mongo": "7.0.12", + "mongo": "8.0.3", "bitnami/mongodb": "8.0.3-debian-12-r0", "bitnami/mongodb-sharded": "8.0.3-debian-12-r0", - "redis": "7.4.0-alpine", - "minio/minio": "RELEASE.2024-08-03T04-33-23Z", + "rtsp/mongosh": "2.3.3", + "redis": "7.4.1-alpine", + "minio/minio": "RELEASE.2024-11-07T00-52-20Z", "datalust/seq": "2024.3", - "grafana/grafana": "11.1.1", - "prom/node-exporter": "v1.8.1", - "prom/prometheus": "v2.53.1", - "fluent/fluent-bit": "3.0.4", - "rtsp/mongosh": "2.2.15", - "nginxinc/nginx-unprivileged": "1.27.0-alpine-slim", "datalust/seqcli": "2024.3", + "grafana/grafana": "11.3.0", + "prom/node-exporter": "v1.8.2", + "prom/prometheus": "v3.0.0", + "fluent/fluent-bit": "3.1.10", + "nginxinc/nginx-unprivileged": "1.27.2-alpine-slim", "registry.k8s.io/sig-storage/nfs-subdir-external-provisioner": "v4.0.18", - "bitnami/rabbitmq": "3.12.14", - "ghcr.io/chaos-mesh/chaos-mesh": "v2.6.3", - "ghcr.io/chaos-mesh/chaos-daemon": "v2.6.3", - "ghcr.io/chaos-mesh/chaos-dashboard": "v2.6.3", + "bitnami/rabbitmq": "4.0.3", + "ghcr.io/chaos-mesh/chaos-mesh": "v2.7.0", + "ghcr.io/chaos-mesh/chaos-daemon": "v2.7.0", + "ghcr.io/chaos-mesh/chaos-dashboard": "v2.7.0", "ghcr.io/prometheus-community/windows-exporter": "0.29.2-ltsc2022", "mcr.microsoft.com/windows/nanoserver": "ltsc2022" }, "helm_charts" : { - "keda" : { "repository" : "https://kedacore.github.io/charts" , "version" : "2.9.3"}, - "metrics_server" : { "repository" : "https://kubernetes-sigs.github.io/metrics-server/" , "version" :"3.12.0"}, - "cluster_autoscaler" : {"repository" : "https://kubernetes.github.io/autoscaler" , "version" : "9.36.0"}, + "keda" : { "repository" : "https://kedacore.github.io/charts" , "version" : "2.16.0"}, + "metrics_server" : { "repository" : "https://kubernetes-sigs.github.io/metrics-server/" , "version" :"3.12.2"}, + "cluster_autoscaler" : {"repository" : "https://kubernetes.github.io/autoscaler" , "version" : "9.43.2"}, "termination_handler" : {"repository" : "https://aws.github.io/eks-charts" , "version" : "0.21.0" }, - "efs_csi_driver" : { "repository" :"https://kubernetes-sigs.github.io/aws-efs-csi-driver/" , "version": "2.5.7" }, + "efs_csi_driver" : { "repository" :"https://kubernetes-sigs.github.io/aws-efs-csi-driver/" , "version": "3.0.8" }, "rabbitmq" : { "repository" : "https://charts.bitnami.com/bitnami" , "version" : "13.0.2"}, "chaos_mesh" : { "repository" : "https://charts.chaos-mesh.org" , "version" : "2.6.3"}, "mongodb" : { "repository": "oci://registry-1.docker.io/bitnamicharts", "version" : "16.2.2"}, "mongodb-sharded" : { "repository": "oci://registry-1.docker.io/bitnamicharts", "version" : "9.0.3" } } -} +} \ No newline at end of file