From a63e5d995e7fdfc5d0a513bfa6f30d7b9af1fbf8 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 14:10:31 -0400 Subject: [PATCH 01/20] remove depends_on --- main.tf | 3 --- 1 file changed, 3 deletions(-) diff --git a/main.tf b/main.tf index c601857..24f8638 100644 --- a/main.tf +++ b/main.tf @@ -144,8 +144,6 @@ module "keycloak_db_config" { source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" - depends_on = [helm_release.keycloak-db] - namespace = kubernetes_namespace.keycloak.metadata[0].name service_account_name = module.service_account.service_account_name job_name = "keycloak-db-config-job" @@ -200,7 +198,6 @@ module "ingress_resources" { } module "post_install" { - depends_on = [helm_release.keycloak] # tflint-ignore: terraform_module_pinned_source source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" From ac80d5ea8b6b9be020748a0ad53cc33bad93dc0e Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 14:19:03 -0400 Subject: [PATCH 02/20] update kubectl_key to utilities_key --- copy_images.tf | 2 +- main.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index 0dd161d..ee9058e 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -3,7 +3,7 @@ locals { keycloak_key = format("%v#%v", local.keycloak_name, var.keycloak_tag) postgresql_key = format("%v#%v", "bitnami/postgresql", var.postgresql_tag) postgres_exporter_key = format("%v#%v", "bitnami/postgres-exporter", var.postgres_exporter_tag) - kubectl_key = format("%v#%v", "bitnami/kubectl-debian", var.utilities_tag) + utilities_key = format("%v#%v", "bitnami/kubectl-debian", var.utilities_tag) ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") image_config = [ diff --git a/main.tf b/main.tf index 24f8638..5ab08ee 100644 --- a/main.tf +++ b/main.tf @@ -148,8 +148,8 @@ module "keycloak_db_config" { service_account_name = module.service_account.service_account_name job_name = "keycloak-db-config-job" config_script = local.db_config_job_script - kubectl_img = module.images.images[local.kubectl_key].dest_full_path - init_img = module.images.images[local.kubectl_key].dest_full_path + kubectl_img = module.images.images[local.utilities_key].dest_full_path + init_img = module.images.images[local.utilities_key].dest_full_path timeout = "3m" } From 52ba566d3e89bcff52b9930d87fea1ebb6833903 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 14:22:05 -0400 Subject: [PATCH 03/20] not expected --- copy_images.tf | 1 - main.tf | 6 ------ 2 files changed, 7 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index ee9058e..1256cec 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -3,7 +3,6 @@ locals { keycloak_key = format("%v#%v", local.keycloak_name, var.keycloak_tag) postgresql_key = format("%v#%v", "bitnami/postgresql", var.postgresql_tag) postgres_exporter_key = format("%v#%v", "bitnami/postgres-exporter", var.postgres_exporter_tag) - utilities_key = format("%v#%v", "bitnami/kubectl-debian", var.utilities_tag) ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") image_config = [ diff --git a/main.tf b/main.tf index 5ab08ee..09c4ad6 100644 --- a/main.tf +++ b/main.tf @@ -84,8 +84,6 @@ module "pre_install" { service_account_name = module.service_account.service_account_name job_name = "keycloak-config-secret-job" config_script = local.secrets_job_script - kubectl_img = module.images.images[local.kubectl_key].dest_full_path - init_img = module.images.images[local.kubectl_key].dest_full_path timeout = "5m" } @@ -148,8 +146,6 @@ module "keycloak_db_config" { service_account_name = module.service_account.service_account_name job_name = "keycloak-db-config-job" config_script = local.db_config_job_script - kubectl_img = module.images.images[local.utilities_key].dest_full_path - init_img = module.images.images[local.utilities_key].dest_full_path timeout = "3m" } @@ -206,8 +202,6 @@ module "post_install" { service_account_name = module.service_account.service_account_name job_name = "keycloak-config-job" config_script = local.config_job_script - kubectl_img = module.images.images[local.kubectl_key].dest_full_path - init_img = module.images.images[local.kubectl_key].dest_full_path timeout = "10m" } From 66f62b70503ce839034081f1d18ccab880d764b4 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 14:30:13 -0400 Subject: [PATCH 04/20] test using mcmCluster --- README.md | 6 +++--- main.tf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8933914..b863f2c 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,9 @@ Common issues and solutions: |------|--------|---------| | [images](#module\_images) | git::https://github.e.it.census.gov/terraform-modules/aws-ecr-copy-images.git/ | tf-upgrade | | [ingress\_resources](#module\_ingress\_resources) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-istio-service-ingress.git | n/a | -| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | -| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | -| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | +| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git | mcmCluster//config-job | +| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git | mcmCluster//config-job | +| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git | mcmCluster//config-job | | [service\_account](#module\_service\_account) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//service-account | n/a | ## Resources diff --git a/main.tf b/main.tf index 09c4ad6..e00764b 100644 --- a/main.tf +++ b/main.tf @@ -77,7 +77,7 @@ module "service_account" { module "pre_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git?ref=mcmCluster//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = kubernetes_namespace.keycloak.metadata[0].name @@ -139,7 +139,7 @@ data "kubernetes_secret" "db-secrets" { module "keycloak_db_config" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git?ref=mcmCluster//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = kubernetes_namespace.keycloak.metadata[0].name @@ -195,7 +195,7 @@ module "ingress_resources" { module "post_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git?ref=mcmCluster//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = kubernetes_namespace.keycloak.metadata[0].name From b508242ae5cdaa61788ae0761bebf5fb85cbfa59 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 14:32:47 -0400 Subject: [PATCH 05/20] remove kubectl and init refs --- README.md | 6 +++--- main.tf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b863f2c..8933914 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,9 @@ Common issues and solutions: |------|--------|---------| | [images](#module\_images) | git::https://github.e.it.census.gov/terraform-modules/aws-ecr-copy-images.git/ | tf-upgrade | | [ingress\_resources](#module\_ingress\_resources) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-istio-service-ingress.git | n/a | -| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git | mcmCluster//config-job | -| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git | mcmCluster//config-job | -| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git | mcmCluster//config-job | +| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | +| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | +| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | | [service\_account](#module\_service\_account) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//service-account | n/a | ## Resources diff --git a/main.tf b/main.tf index e00764b..09c4ad6 100644 --- a/main.tf +++ b/main.tf @@ -77,7 +77,7 @@ module "service_account" { module "pre_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git?ref=mcmCluster//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = kubernetes_namespace.keycloak.metadata[0].name @@ -139,7 +139,7 @@ data "kubernetes_secret" "db-secrets" { module "keycloak_db_config" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git?ref=mcmCluster//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = kubernetes_namespace.keycloak.metadata[0].name @@ -195,7 +195,7 @@ module "ingress_resources" { module "post_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git?ref=mcmCluster//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = kubernetes_namespace.keycloak.metadata[0].name From 6c6e4251843d7c300328a60d92b78cba62f5d7d7 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 15:11:24 -0400 Subject: [PATCH 06/20] pass into config-job --- main.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.tf b/main.tf index 09c4ad6..6cfb0ca 100644 --- a/main.tf +++ b/main.tf @@ -84,6 +84,8 @@ module "pre_install" { service_account_name = module.service_account.service_account_name job_name = "keycloak-config-secret-job" config_script = local.secrets_job_script + region = var.region + cluster_name = var.cluster_name timeout = "5m" } @@ -146,6 +148,8 @@ module "keycloak_db_config" { service_account_name = module.service_account.service_account_name job_name = "keycloak-db-config-job" config_script = local.db_config_job_script + region = var.region + cluster_name = var.cluster_name timeout = "3m" } @@ -202,6 +206,8 @@ module "post_install" { service_account_name = module.service_account.service_account_name job_name = "keycloak-config-job" config_script = local.config_job_script + region = var.region + cluster_name = var.cluster_name timeout = "10m" } From b857e3e2cda14eedbd1d2ded37bdbeed21bc5fc7 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 15:15:46 -0400 Subject: [PATCH 07/20] dont ingest utilities here as config-job does it --- README.md | 1 - copy_images.tf | 9 --------- variables.tf | 5 ----- 3 files changed, 15 deletions(-) diff --git a/README.md b/README.md index 8933914..7d4b2c9 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,6 @@ Common issues and solutions: | [profile](#input\_profile) | AWS config profile used to upload images into ECR | `string` | `""` | no | | [region](#input\_region) | AWS region | `string` | n/a | yes | | [service\_name](#input\_service\_name) | The name of the service to be deployed in the EKS cluster. | `string` | `"service"` | no | -| [utilities\_tag](#input\_utilities\_tag) | Version tag for the docker image to use to execute kubectl commands. | `string` | `"1.0.3"` | no | ## Outputs diff --git a/copy_images.tf b/copy_images.tf index 1256cec..add4d58 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -33,15 +33,6 @@ locals { source_tag = var.postgres_exporter_tag tag = var.postgres_exporter_tag }, - { - enabled = true - dest_path = null - name = "bitnami/kubectl-debian" - source_image = "big-bang/utilities" - source_registry = format("%v/%v", local.ent_ecr_source, "ironbank") - source_tag = var.utilities_tag - tag = var.utilities_tag - }, ] } diff --git a/variables.tf b/variables.tf index 8d2e93a..524bfe2 100644 --- a/variables.tf +++ b/variables.tf @@ -107,8 +107,3 @@ variable "service_name" { type = string default = "service" } -variable "utilities_tag" { - description = "Version tag for the docker image to use to execute kubectl commands." - type = string - default = "1.0.3" -} From bde284e71785602d3defec11b447299dc12043e6 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 15:54:19 -0400 Subject: [PATCH 08/20] weird depends_on issue with module --- README.md | 12 ++++++------ main.tf | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7d4b2c9..10616a6 100644 --- a/README.md +++ b/README.md @@ -76,12 +76,12 @@ Common issues and solutions: | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 5.14 | -| [aws.eecr](#provider\_aws.eecr) | ~> 5.14 | -| [helm](#provider\_helm) | ~> 2.11 | -| [kubernetes](#provider\_kubernetes) | ~> 2.23 | -| [null](#provider\_null) | ~> 3.2 | -| [random](#provider\_random) | ~> 3.6 | +| [aws](#provider\_aws) | 5.95.0 | +| [aws.eecr](#provider\_aws.eecr) | 5.95.0 | +| [helm](#provider\_helm) | 2.17.0 | +| [kubernetes](#provider\_kubernetes) | 2.36.0 | +| [null](#provider\_null) | 3.2.4 | +| [random](#provider\_random) | 3.7.2 | ## Modules diff --git a/main.tf b/main.tf index 6cfb0ca..12109a8 100644 --- a/main.tf +++ b/main.tf @@ -102,7 +102,9 @@ resource "helm_release" "keycloak-db" { depends_on = [ data.kubernetes_secret.db-secrets, - module.images + module.images, + module.service_account, + module.pre_install ] set { @@ -162,7 +164,7 @@ resource "helm_release" "keycloak" { repository = "${path.module}/charts" timeout = 600 wait = true - depends_on = [helm_release.keycloak-db] + depends_on = [helm_release.keycloak-db, module.keycloak_db_config] values = [templatefile("${path.module}/keycloak-server-values.yaml", { hostname = format("https://%v.%v", var.keycloak_hostname, var.cluster_domain) From 6c27a21161ee5e3d8509b7f8a80365f2294ae15d Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 16:11:07 -0400 Subject: [PATCH 09/20] add utilities back --- copy_images.tf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/copy_images.tf b/copy_images.tf index add4d58..dac8240 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -3,7 +3,9 @@ locals { keycloak_key = format("%v#%v", local.keycloak_name, var.keycloak_tag) postgresql_key = format("%v#%v", "bitnami/postgresql", var.postgresql_tag) postgres_exporter_key = format("%v#%v", "bitnami/postgres-exporter", var.postgres_exporter_tag) - ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") + # tflint-ignore: terraform_unused_declarations + utilities_key = format("%v#%v", "big-bang/utilities", var.utilities_tag) + ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") image_config = [ { @@ -33,6 +35,15 @@ locals { source_tag = var.postgres_exporter_tag tag = var.postgres_exporter_tag }, + { + enabled = true + dest_path = null + name = "big-bang/utilities" + source_image = "big-bang/utilities" + source_registry = format("%v/%v", local.ent_ecr_source, "ironbank") + source_tag = var.utilities_tag + tag = var.utilities_tag + }, ] } From 5001e3f98cdb3688372bfe031c726b7f3ed6bf7d Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 16:14:52 -0400 Subject: [PATCH 10/20] provide version: --- copy_images.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index dac8240..bdd87e5 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -4,7 +4,7 @@ locals { postgresql_key = format("%v#%v", "bitnami/postgresql", var.postgresql_tag) postgres_exporter_key = format("%v#%v", "bitnami/postgres-exporter", var.postgres_exporter_tag) # tflint-ignore: terraform_unused_declarations - utilities_key = format("%v#%v", "big-bang/utilities", var.utilities_tag) + utilities_key = format("%v#%v", "big-bang/utilities", "1.0.3") ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") image_config = [ @@ -41,8 +41,8 @@ locals { name = "big-bang/utilities" source_image = "big-bang/utilities" source_registry = format("%v/%v", local.ent_ecr_source, "ironbank") - source_tag = var.utilities_tag - tag = var.utilities_tag + source_tag = "1.0.3" + tag = "1.0.3" }, ] } From 0bb378f20de0c2fd14e73e17ed6c9a13ed1b39f9 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 16:48:34 -0400 Subject: [PATCH 11/20] update images for utilites handling --- copy_images.tf | 9 ++++----- main.tf | 12 ++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index bdd87e5..f93abf0 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -3,9 +3,8 @@ locals { keycloak_key = format("%v#%v", local.keycloak_name, var.keycloak_tag) postgresql_key = format("%v#%v", "bitnami/postgresql", var.postgresql_tag) postgres_exporter_key = format("%v#%v", "bitnami/postgres-exporter", var.postgres_exporter_tag) - # tflint-ignore: terraform_unused_declarations - utilities_key = format("%v#%v", "big-bang/utilities", "1.0.3") - ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") + utilities_key = format("%v#%v", "big-bang/utilities", var.utilities_tag) + ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") image_config = [ { @@ -41,8 +40,8 @@ locals { name = "big-bang/utilities" source_image = "big-bang/utilities" source_registry = format("%v/%v", local.ent_ecr_source, "ironbank") - source_tag = "1.0.3" - tag = "1.0.3" + source_tag = var.utilities_tag + tag = var.utilities_tag }, ] } diff --git a/main.tf b/main.tf index 12109a8..80b65da 100644 --- a/main.tf +++ b/main.tf @@ -84,10 +84,8 @@ module "pre_install" { service_account_name = module.service_account.service_account_name job_name = "keycloak-config-secret-job" config_script = local.secrets_job_script - region = var.region - cluster_name = var.cluster_name - - timeout = "5m" + utilities_image_path = module.images.images[local.utilities_key].dest_full_path + timeout = "5m" } resource "helm_release" "keycloak-db" { @@ -150,8 +148,7 @@ module "keycloak_db_config" { service_account_name = module.service_account.service_account_name job_name = "keycloak-db-config-job" config_script = local.db_config_job_script - region = var.region - cluster_name = var.cluster_name + utilities_image_path = module.images.images[local.utilities_key].dest_full_path timeout = "3m" } @@ -208,8 +205,7 @@ module "post_install" { service_account_name = module.service_account.service_account_name job_name = "keycloak-config-job" config_script = local.config_job_script - region = var.region - cluster_name = var.cluster_name + utilities_image_path = module.images.images[local.utilities_key].dest_full_path timeout = "10m" } From a89dc99ae440e73e464add56208133bcafdaa6b6 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 16:53:11 -0400 Subject: [PATCH 12/20] add depends_on again --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index 80b65da..03c2fce 100644 --- a/main.tf +++ b/main.tf @@ -197,6 +197,7 @@ module "ingress_resources" { } module "post_install" { + depends_on = [helm_release.keycloak, module.ingress_resources] # tflint-ignore: terraform_module_pinned_source source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" From df3c9245a9937e11f7d7af38b139bf5549475c8a Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 17:06:54 -0400 Subject: [PATCH 13/20] uniquify --- copy_images.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index f93abf0..5ef42b1 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -3,7 +3,7 @@ locals { keycloak_key = format("%v#%v", local.keycloak_name, var.keycloak_tag) postgresql_key = format("%v#%v", "bitnami/postgresql", var.postgresql_tag) postgres_exporter_key = format("%v#%v", "bitnami/postgres-exporter", var.postgres_exporter_tag) - utilities_key = format("%v#%v", "big-bang/utilities", var.utilities_tag) + utilities_key = format("%v#%v", "utilities", var.utilities_tag) ent_ecr_source = format("%v.%v.%v.%v", var.eecr_info.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images") image_config = [ @@ -37,7 +37,7 @@ locals { { enabled = true dest_path = null - name = "big-bang/utilities" + name = "utilities" source_image = "big-bang/utilities" source_registry = format("%v/%v", local.ent_ecr_source, "ironbank") source_tag = var.utilities_tag From 6ddaec074f9272c2daeffb11ed2b5303746edbfe Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 17:16:32 -0400 Subject: [PATCH 14/20] not depends_on another module --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 03c2fce..44139e1 100644 --- a/main.tf +++ b/main.tf @@ -197,7 +197,7 @@ module "ingress_resources" { } module "post_install" { - depends_on = [helm_release.keycloak, module.ingress_resources] + depends_on = [helm_release.keycloak] # tflint-ignore: terraform_module_pinned_source source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" From da066875d6daa27724b98175560a953d24f8259a Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 17:19:41 -0400 Subject: [PATCH 15/20] indirect depends --- main.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 44139e1..1894c1e 100644 --- a/main.tf +++ b/main.tf @@ -197,12 +197,11 @@ module "ingress_resources" { } module "post_install" { - depends_on = [helm_release.keycloak] # tflint-ignore: terraform_module_pinned_source source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" - namespace = kubernetes_namespace.keycloak.metadata[0].name + namespace = helm_release.keycloak.namespace service_account_name = module.service_account.service_account_name job_name = "keycloak-config-job" config_script = local.config_job_script From 94d0120181043ca7397ef9efd2a8ea80c58917dd Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 18:14:21 -0400 Subject: [PATCH 16/20] try pulling from branch --- README.md | 6 +++--- main.tf | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 10616a6..69651cc 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,9 @@ Common issues and solutions: |------|--------|---------| | [images](#module\_images) | git::https://github.e.it.census.gov/terraform-modules/aws-ecr-copy-images.git/ | tf-upgrade | | [ingress\_resources](#module\_ingress\_resources) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-istio-service-ingress.git | n/a | -| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | -| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | -| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | +| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/ | mcmCluster//config-job | +| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/ | mcmCluster//config-job | +| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/ | mcmCluster//config-job | | [service\_account](#module\_service\_account) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//service-account | n/a | ## Resources diff --git a/main.tf b/main.tf index 1894c1e..225ae2e 100644 --- a/main.tf +++ b/main.tf @@ -77,10 +77,10 @@ module "service_account" { module "pre_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/?ref=mcmCluster//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" - namespace = kubernetes_namespace.keycloak.metadata[0].name + namespace = module.service_account.namespace service_account_name = module.service_account.service_account_name job_name = "keycloak-config-secret-job" config_script = local.secrets_job_script @@ -141,10 +141,9 @@ data "kubernetes_secret" "db-secrets" { module "keycloak_db_config" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" - # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/?ref=mcmCluster//config-job" - namespace = kubernetes_namespace.keycloak.metadata[0].name + namespace = helm_release.keycloak-db.namespace service_account_name = module.service_account.service_account_name job_name = "keycloak-db-config-job" config_script = local.db_config_job_script @@ -191,14 +190,14 @@ module "ingress_resources" { source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-istio-service-ingress.git" public_hostname = var.service_name public_domain = var.cluster_domain - service_name = "keycloak-keycloakx-http" + service_name = format("%v-%v-%v", var.service_name, var.keycloak_namespace, "http") service_namespace = var.keycloak_namespace service_port = local.public_port_number } module "post_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/?ref=mcmCluster//config-job" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = helm_release.keycloak.namespace From 05d62f6302917ab8acb593070d1338271c8cc274 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 18:17:25 -0400 Subject: [PATCH 17/20] order --- README.md | 6 +++--- main.tf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 69651cc..82bef4e 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,9 @@ Common issues and solutions: |------|--------|---------| | [images](#module\_images) | git::https://github.e.it.census.gov/terraform-modules/aws-ecr-copy-images.git/ | tf-upgrade | | [ingress\_resources](#module\_ingress\_resources) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-istio-service-ingress.git | n/a | -| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/ | mcmCluster//config-job | -| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/ | mcmCluster//config-job | -| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/ | mcmCluster//config-job | +| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/ | mcmCluster | +| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/ | mcmCluster | +| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/ | mcmCluster | | [service\_account](#module\_service\_account) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//service-account | n/a | ## Resources diff --git a/main.tf b/main.tf index 225ae2e..ffe3b67 100644 --- a/main.tf +++ b/main.tf @@ -77,7 +77,7 @@ module "service_account" { module "pre_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/?ref=mcmCluster//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = module.service_account.namespace @@ -141,7 +141,7 @@ data "kubernetes_secret" "db-secrets" { module "keycloak_db_config" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/?ref=mcmCluster//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" namespace = helm_release.keycloak-db.namespace service_account_name = module.service_account.service_account_name @@ -197,7 +197,7 @@ module "ingress_resources" { module "post_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git/?ref=mcmCluster//config-job" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = helm_release.keycloak.namespace From 0ac5e6ba674e8fd759b85d8b61895aca968e97b1 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 18:23:21 -0400 Subject: [PATCH 18/20] cleanup of commented sources --- README.md | 1 + main.tf | 7 ++----- variables.tf | 7 +++++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 82bef4e..daa82d2 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ Common issues and solutions: | [profile](#input\_profile) | AWS config profile used to upload images into ECR | `string` | `""` | no | | [region](#input\_region) | AWS region | `string` | n/a | yes | | [service\_name](#input\_service\_name) | The name of the service to be deployed in the EKS cluster. | `string` | `"service"` | no | +| [utilities\_tag](#input\_utilities\_tag) | Used for chown and curl. | `string` | `"1.0.3"` | no | ## Outputs diff --git a/main.tf b/main.tf index ffe3b67..1aab4fe 100644 --- a/main.tf +++ b/main.tf @@ -70,7 +70,6 @@ resource "kubernetes_namespace" "keycloak" { module "service_account" { # tflint-ignore: terraform_module_pinned_source source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//service-account" - # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//service-account" namespace = kubernetes_namespace.keycloak.metadata[0].name } @@ -78,9 +77,8 @@ module "service_account" { module "pre_install" { # tflint-ignore: terraform_module_pinned_source source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" - # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" - namespace = module.service_account.namespace + namespace = kubernetes_namespace.keycloak.metadata[0].name service_account_name = module.service_account.service_account_name job_name = "keycloak-config-secret-job" config_script = local.secrets_job_script @@ -191,14 +189,13 @@ module "ingress_resources" { public_hostname = var.service_name public_domain = var.cluster_domain service_name = format("%v-%v-%v", var.service_name, var.keycloak_namespace, "http") - service_namespace = var.keycloak_namespace + service_namespace = kubernetes_namespace.keycloak.metadata[0].name service_port = local.public_port_number } module "post_install" { # tflint-ignore: terraform_module_pinned_source source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" - # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-config-job.git//config-job" namespace = helm_release.keycloak.namespace service_account_name = module.service_account.service_account_name diff --git a/variables.tf b/variables.tf index 524bfe2..20ade53 100644 --- a/variables.tf +++ b/variables.tf @@ -107,3 +107,10 @@ variable "service_name" { type = string default = "service" } + +# From bigbang utilities +variable "utilities_tag" { + description = "Used for chown and curl." + type = string + default = "1.0.3" +} From ed728e420b3bc7e4f734827a6dfed7cd42d189ba Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 18:44:18 -0400 Subject: [PATCH 19/20] restore pull from main --- README.md | 6 +++--- main.tf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index daa82d2..a133e48 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,9 @@ Common issues and solutions: |------|--------|---------| | [images](#module\_images) | git::https://github.e.it.census.gov/terraform-modules/aws-ecr-copy-images.git/ | tf-upgrade | | [ingress\_resources](#module\_ingress\_resources) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-istio-service-ingress.git | n/a | -| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/ | mcmCluster | -| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/ | mcmCluster | -| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/ | mcmCluster | +| [keycloak\_db\_config](#module\_keycloak\_db\_config) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | +| [post\_install](#module\_post\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | +| [pre\_install](#module\_pre\_install) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job | n/a | | [service\_account](#module\_service\_account) | git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//service-account | n/a | ## Resources diff --git a/main.tf b/main.tf index 1aab4fe..0efe95a 100644 --- a/main.tf +++ b/main.tf @@ -76,7 +76,7 @@ module "service_account" { module "pre_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" namespace = kubernetes_namespace.keycloak.metadata[0].name service_account_name = module.service_account.service_account_name @@ -139,7 +139,7 @@ data "kubernetes_secret" "db-secrets" { module "keycloak_db_config" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" namespace = helm_release.keycloak-db.namespace service_account_name = module.service_account.service_account_name @@ -195,7 +195,7 @@ module "ingress_resources" { module "post_install" { # tflint-ignore: terraform_module_pinned_source - source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job/?ref=mcmCluster" + source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-config-job.git//config-job" namespace = helm_release.keycloak.namespace service_account_name = module.service_account.service_account_name From 8375883b33605109e44da3ef7679f61f92cdc43f Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Tue, 22 Apr 2025 18:50:03 -0400 Subject: [PATCH 20/20] use hardcoded service_name for now --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 0efe95a..4d4ff2a 100644 --- a/main.tf +++ b/main.tf @@ -188,7 +188,7 @@ module "ingress_resources" { source = "git::https://github.e.it.census.gov/SCT-Engineering/tfmod-istio-service-ingress.git" public_hostname = var.service_name public_domain = var.cluster_domain - service_name = format("%v-%v-%v", var.service_name, var.keycloak_namespace, "http") + service_name = "keycloak-keycloakx-http" service_namespace = kubernetes_namespace.keycloak.metadata[0].name service_port = local.public_port_number }