From bf83b2df657558597d4ba147f80e00ac8a955125 Mon Sep 17 00:00:00 2001 From: janli Date: Tue, 19 Nov 2024 11:51:03 -0800 Subject: [PATCH] feat: update change log --- CHANGELOG.md | 7 +++++++ VARIABLES.md | 6 ++++-- k8s-readonly.tf | 2 +- k8s-readwrite.tf | 2 +- templates.tf | 6 ++---- templates/apiary-hms-readonly.json | 2 +- templates/apiary-hms-readwrite.json | 2 +- variables.tf | 19 +++++++++++++++---- 8 files changed, 32 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 203e2c7..e681624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [7.7.0] - 2024-11-12 ### Changed - Updated the hms namespaces for metrics for both readwrite and readonly. +### Added +- Added following variables: + - `hms_ecs_metrics_readwrite_namespace` + - `hms_ecs_metrics_readonly_namespace` + - `hms_k8s_metrics_readwrite_namespace` + - `hms_k8s_metrics_readonly_namespace` + - `hms_ro_tolerations` ## [7.6.1] - 2024-10-30 ### Changed diff --git a/VARIABLES.md b/VARIABLES.md index fd56a3e..e977836 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -138,8 +138,10 @@ | tcp\_keepalive\_probes | Sets net.ipv4.tcp_keepalive_probes (seconds) | number | `2` | no | | ecs\_platform\_version | ECS Service Platform Version | `string` | `"LATEST"` | ecs\_requires\_compatibilities | ECS task definition requires compatibilities. | `list(string)` | `["EC2", "FARGATE"]` | no | -| hms\_readonly\_namespace | ECS readwrite namespace | `string` | `hms_readonly` | no | -| hms\_readwrite\_namespace | ECS readonly namespace | `string` | `hms_readwrite` | no | +| hms\_ecs\_metrics\_readonly\_namespace | ECS readwrite metrics namespace | `string` | `hmsreadonlylegacy` | no | +| hms\_ecs\_metrics\_readwrite\_namespace | ECS readonly metrics namespace | `string` | `hmsreadwritelegacy` | no | +| hms\_k8s\_metrics\_readonly\_namespace | K8s readwrite metrics namespace | `string` | `hms_readonly` | no | +| hms\_k8s\_metrics\_readwrite\_namespace | K8s readonly metrics namespace | `string` | `hms_readwrite` | no | ### apiary_assume_roles diff --git a/k8s-readonly.tf b/k8s-readonly.tf index c659db1..54ad743 100644 --- a/k8s-readonly.tf +++ b/k8s-readonly.tf @@ -38,7 +38,7 @@ resource "kubernetes_deployment_v1" "apiary_hms_readonly" { annotations = { "ad.datadoghq.com/${local.hms_alias}-readonly.check_names" = var.datadog_metrics_enabled ? "[\"prometheus\"]" : null "ad.datadoghq.com/${local.hms_alias}-readonly.init_configs" = var.datadog_metrics_enabled ? "[{}]" : null - "ad.datadoghq.com/${local.hms_alias}-readonly.instances" = var.datadog_metrics_enabled ? "[{ \"prometheus_url\": \"http://%%host%%:${var.datadog_metrics_port}/actuator/prometheus\", \"namespace\": \"hms_readonly\", \"metrics\": [ \"${join("\",\"", var.datadog_metrics_hms_readwrite_readonly)}\" ] , \"type_overrides\": { \"${join("\": \"gauge\",\"", var.datadog_metrics_hms_readwrite_readonly)}\": \"gauge\"} }]" : null + "ad.datadoghq.com/${local.hms_alias}-readonly.instances" = var.datadog_metrics_enabled ? "[{ \"prometheus_url\": \"http://%%host%%:${var.datadog_metrics_port}/actuator/prometheus\", \"namespace\": \"${var.hms_k8s_metrics_readonly_namespace}\", \"metrics\": [ \"${join("\",\"", var.datadog_metrics_hms_readwrite_readonly)}\" ] , \"type_overrides\": { \"${join("\": \"gauge\",\"", var.datadog_metrics_hms_readwrite_readonly)}\": \"gauge\"} }]" : null "iam.amazonaws.com/role" = var.oidc_provider == "" ? aws_iam_role.apiary_hms_readonly.name : null "prometheus.io/path" = "/metrics" "prometheus.io/port" = "8080" diff --git a/k8s-readwrite.tf b/k8s-readwrite.tf index 02fcf03..0692c42 100644 --- a/k8s-readwrite.tf +++ b/k8s-readwrite.tf @@ -38,7 +38,7 @@ resource "kubernetes_deployment_v1" "apiary_hms_readwrite" { annotations = { "ad.datadoghq.com/${local.hms_alias}-readwrite.check_names" = var.datadog_metrics_enabled ? "[\"prometheus\"]" : null "ad.datadoghq.com/${local.hms_alias}-readwrite.init_configs" = var.datadog_metrics_enabled ? "[{}]" : null - "ad.datadoghq.com/${local.hms_alias}-readwrite.instances" = var.datadog_metrics_enabled ? "[{ \"prometheus_url\": \"http://%%host%%:${var.datadog_metrics_port}/actuator/prometheus\", \"namespace\": \"hms_readwrite\", \"metrics\": [ \"${join("\",\"", var.datadog_metrics_hms_readwrite_readonly)}\" ] , \"type_overrides\": { \"${join("\": \"gauge\",\"", var.datadog_metrics_hms_readwrite_readonly)}\": \"gauge\"} }]" : null + "ad.datadoghq.com/${local.hms_alias}-readwrite.instances" = var.datadog_metrics_enabled ? "[{ \"prometheus_url\": \"http://%%host%%:${var.datadog_metrics_port}/actuator/prometheus\", \"namespace\": \"${var.hms_k8s_metrics_readwrite_namespace}\", \"metrics\": [ \"${join("\",\"", var.datadog_metrics_hms_readwrite_readonly)}\" ] , \"type_overrides\": { \"${join("\": \"gauge\",\"", var.datadog_metrics_hms_readwrite_readonly)}\": \"gauge\"} }]" : null "iam.amazonaws.com/role" = var.oidc_provider == "" ? aws_iam_role.apiary_hms_readwrite.name : null "prometheus.io/path" = "/metrics" "prometheus.io/port" = "8080" diff --git a/templates.tf b/templates.tf index e677505..b276082 100644 --- a/templates.tf +++ b/templates.tf @@ -27,8 +27,7 @@ locals{ table_param_filter = var.enable_metadata_events ? var.table_param_filter : "" enable_gluesync = var.enable_gluesync ? "1" : "" gluedb_prefix = "${local.gluedb_prefix}" - hms_readwrite_namespace = "${var.hms_readwrite_namespace}" - hms_readonly_namespace = "${var.hms_readonly_namespace}" + hms_metrics_namespace = "${var.hms_ecs_metrics_readwrite_namespace}" ranger_service_name = "${local.instance_alias}-metastore" ranger_policy_manager_url = "${var.ranger_policy_manager_url}" ranger_audit_solr_url = "${var.ranger_audit_solr_url}" @@ -130,8 +129,7 @@ locals{ tcp_keepalive_time = var.tcp_keepalive_time tcp_keepalive_intvl = var.tcp_keepalive_intvl tcp_keepalive_probes = var.tcp_keepalive_probes - hms_readwrite_namespace = var.hms_readwrite_namespace - hms_readonly_namespace = var.hms_readonly_namespace + hms_metrics_namespace = "${var.hms_ecs_metrics_readonly_namespace}" datadog_metrics_hms_readwrite_readonly = var.datadog_metrics_hms_readwrite_readonly hms_metrics = local.hms_metrics hms_metrics_type_overrides = local.hms_metrics_type_overrides diff --git a/templates/apiary-hms-readonly.json b/templates/apiary-hms-readonly.json index d86c6b5..ea7a36b 100644 --- a/templates/apiary-hms-readonly.json +++ b/templates/apiary-hms-readonly.json @@ -75,7 +75,7 @@ } }, "dockerLabels": { - "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_readonly_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", + "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_metrics_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", "com.datadoghq.ad.check_names": "[\"prometheus\"]", "com.datadoghq.ad.init_configs": "[{}]" }, diff --git a/templates/apiary-hms-readwrite.json b/templates/apiary-hms-readwrite.json index ae04d48..64220d2 100644 --- a/templates/apiary-hms-readwrite.json +++ b/templates/apiary-hms-readwrite.json @@ -75,7 +75,7 @@ } }, "dockerLabels": { - "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_readwrite_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", + "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_metrics_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", "com.datadoghq.ad.check_names": "[\"prometheus\"]", "com.datadoghq.ad.init_configs": "[{}]" }, diff --git a/variables.tf b/variables.tf index 94c4efc..eba3444 100644 --- a/variables.tf +++ b/variables.tf @@ -452,18 +452,29 @@ variable "hms_rw_k8s_pdb_settings" { } } -variable "hms_readwrite_namespace" { +variable "hms_ecs_metrics_readwrite_namespace" { description = "ECS readwrite namespace" type = string - default = "hms_readwrite_legacy" + default = "hmsreadwritelegacy" } -variable "hms_readonly_namespace" { +variable "hms_ecs_metrics_readonly_namespace" { description = "ECS readonly namespace" type = string - default = "hms_readonly_legacy" + default = "hmsreadonlylegacy" } +variable "hms_k8s_metrics_readwrite_namespace" { + description = "ECS readwrite namespace" + type = string + default = "hms_readwrite" +} + +variable "hms_k8s_metrics_readonly_namespace" { + description = "ECS readonly namespace" + type = string + default = "hms_readonly" +} variable "hms_rw_node_affinity" { description = <