From d274df7b20c1f957f341a8a9b9d7b16f1dc02e71 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:42:48 -0800 Subject: [PATCH 1/9] feat: add ecs tags --- ecs.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ecs.tf b/ecs.tf index d163d25..7d7f02a 100644 --- a/ecs.tf +++ b/ecs.tf @@ -17,6 +17,8 @@ resource "aws_ecs_service" "beekeeper_scheduler_apiary" { task_definition = aws_ecs_task_definition.beekeeper_scheduler_apiary.*.arn[0] desired_count = 1 launch_type = "FARGATE" + propagate_tags = "SERVICE" + tags = var.beekeeper_tags network_configuration { security_groups = [aws_security_group.beekeeper_sg.id] @@ -31,6 +33,8 @@ resource "aws_ecs_service" "beekeeper_path_cleanup" { task_definition = aws_ecs_task_definition.beekeeper_path_cleanup.*.arn[0] desired_count = 1 launch_type = "FARGATE" + propagate_tags = "SERVICE" + tags = var.beekeeper_tags network_configuration { security_groups = [aws_security_group.beekeeper_sg.id] From 970f7269e35a242d0c2c06d109c83cb78cea377a Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:45:12 -0800 Subject: [PATCH 2/9] feat: update to kubernetes_deployment_v1 --- k8s-api.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-api.tf b/k8s-api.tf index dce3009..fa57607 100644 --- a/k8s-api.tf +++ b/k8s-api.tf @@ -19,7 +19,7 @@ locals { } } -resource "kubernetes_deployment" "beekeeper_api" { +resource "kubernetes_deployment_v1" "beekeeper_api" { count = var.instance_type == "k8s" ? 1 : 0 metadata { name = local.api_full_name From a9e587b62957555573f141ddcaf786c0e0c41d62 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:46:04 -0800 Subject: [PATCH 3/9] feat: update to kubernetes_deployment_v1 --- k8s-metadata-cleanup.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-metadata-cleanup.tf b/k8s-metadata-cleanup.tf index a60b58c..813390f 100644 --- a/k8s-metadata-cleanup.tf +++ b/k8s-metadata-cleanup.tf @@ -19,7 +19,7 @@ locals { } } -resource "kubernetes_deployment" "beekeeper_metadata_cleanup" { +resource "kubernetes_deployment_v1" "beekeeper_metadata_cleanup" { count = var.instance_type == "k8s" ? 1 : 0 metadata { name = local.metadata_cleanup_full_name From ba80ae5b52250094e8de24ae9d0495581b296d38 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:46:35 -0800 Subject: [PATCH 4/9] feat: kubernetes_deployment_v1 --- k8s-path-cleanup.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-path-cleanup.tf b/k8s-path-cleanup.tf index 03c6708..acd98c8 100644 --- a/k8s-path-cleanup.tf +++ b/k8s-path-cleanup.tf @@ -19,7 +19,7 @@ locals { } } -resource "kubernetes_deployment" "beekeeper_path_cleanup" { +resource "kubernetes_deployment_v1" "beekeeper_path_cleanup" { count = var.instance_type == "k8s" ? 1 : 0 metadata { name = local.path_cleanup_full_name From 5f82e2a0b5f17f5b5f3aabe6fe004f27ca5dda14 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:47:05 -0800 Subject: [PATCH 5/9] feat: update to kubernetes_deployment_v1 --- k8s-scheduler-apiary.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-scheduler-apiary.tf b/k8s-scheduler-apiary.tf index 0ce8bf1..bad4746 100644 --- a/k8s-scheduler-apiary.tf +++ b/k8s-scheduler-apiary.tf @@ -19,7 +19,7 @@ locals { } } -resource "kubernetes_deployment" "beekeeper_scheduler_apiary" { +resource "kubernetes_deployment_v1" "beekeeper_scheduler_apiary" { count = var.instance_type == "k8s" ? 1 : 0 metadata { name = local.scheduler_apiary_full_name From 60a4825364984189e16c7c126ee0a586829f00a0 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:48:21 -0800 Subject: [PATCH 6/9] feat: update to kubernetes_ingress_v1 --- k8s.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s.tf b/k8s.tf index 67fdb45..23d6f9e 100644 --- a/k8s.tf +++ b/k8s.tf @@ -12,7 +12,7 @@ locals { } } -resource "kubernetes_ingress" "beekeeper" { +resource "kubernetes_ingress_v1" "beekeeper" { count = var.instance_type == "k8s" && var.k8s_ingress_enabled == 1 ? 1 : 0 metadata { name = local.k8s_app_alias From 00fa98937aa53130731b194c32ad3880e3fae084 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:56:46 -0800 Subject: [PATCH 7/9] feat: update to ingress_v1 --- k8s.tf | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/k8s.tf b/k8s.tf index 23d6f9e..a17ba48 100644 --- a/k8s.tf +++ b/k8s.tf @@ -33,8 +33,10 @@ resource "kubernetes_ingress_v1" "beekeeper" { path { path = var.k8s_path_cleanup_ingress_path backend { - service_name = kubernetes_service.beekeeper_path_cleanup[0].metadata[0].name - service_port = kubernetes_service.beekeeper_path_cleanup[0].spec[0].port[0].target_port + name = kubernetes_service.beekeeper_path_cleanup[0].metadata[0].name + port { + number = kubernetes_service.beekeeper_path_cleanup[0].spec[0].port[0].target_port + } } } } @@ -46,8 +48,10 @@ resource "kubernetes_ingress_v1" "beekeeper" { path { path = var.k8s_metadata_cleanup_ingress_path backend { - service_name = kubernetes_service.beekeeper_metadata_cleanup[0].metadata[0].name - service_port = kubernetes_service.beekeeper_metadata_cleanup[0].spec[0].port[0].target_port + name = kubernetes_service.beekeeper_metadata_cleanup[0].metadata[0].name + port { + number = kubernetes_service.beekeeper_metadata_cleanup[0].spec[0].port[0].target_port + } } } } @@ -59,8 +63,10 @@ resource "kubernetes_ingress_v1" "beekeeper" { path { path = var.k8s_scheduler_apiary_ingress_path backend { - service_name = kubernetes_service.beekeeper_scheduler_apiary[0].metadata[0].name - service_port = kubernetes_service.beekeeper_scheduler_apiary[0].spec[0].port[0].target_port + name = kubernetes_service.beekeeper_scheduler_apiary[0].metadata[0].name + port { + number = kubernetes_service.beekeeper_scheduler_apiary[0].spec[0].port[0].target_port + } } } } From 965f2c5b0f2b4d12ae37afdf019a63932a3c8650 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:58:11 -0800 Subject: [PATCH 8/9] feat: update map to tomap --- rds.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rds.tf b/rds.tf index 76e6bf3..b99bd86 100644 --- a/rds.tf +++ b/rds.tf @@ -9,8 +9,7 @@ resource "aws_db_subnet_group" "beekeeper_db_subnet_group" { subnet_ids = var.rds_subnets description = "Beekeeper DB Subnet Group for ${local.instance_alias}" - tags = merge(var.beekeeper_tags, - map("Name", "Beekeeper DB Subnet Group")) + tags = merge(var.beekeeper_tags,tomap({"Name"="Beekeeper DB Subnet Group"})) } resource "aws_security_group" "beekeeper_db_sg" { From 9c1a4d3c46ce115c5306923f36dbce0bdd3ba642 Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:04:40 -0800 Subject: [PATCH 9/9] feat: update change log --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84dedfc..85770dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [5.0.0] - 2023-11-16 +### Changed +- Upgdate k8s API to work with 2.x version: + - `kubernetes_deployment` to `kubernetes_deployment_v1` + - `kubernetes_ingress` to `kubernetes_ingress_v1` +- Update terrafrom `map` function to `tomap`(`map` function has been deprecated in `0.12` version). + ## [4.0.1] - 2023-09-18 ### Changed - Increase k8s provider version to `~>2.7.0` (was `~>1.0.0`). Fixes issue with K8S upgrade and error: 'Failed to create Ingress'.