From 7b32faa55e1c43223ebd2f4790de4af7871fecf4 Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Wed, 6 Nov 2024 13:23:32 +0200 Subject: [PATCH 1/5] jupyter-health: enable and configure aws-ce-grafana backend --- config/clusters/jupyter-health/support.values.yaml | 8 ++++++++ terraform/aws/projects/jupyter-health.tfvars | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config/clusters/jupyter-health/support.values.yaml b/config/clusters/jupyter-health/support.values.yaml index 113d2146f..4fa7df110 100644 --- a/config/clusters/jupyter-health/support.values.yaml +++ b/config/clusters/jupyter-health/support.values.yaml @@ -27,6 +27,14 @@ grafana: hosts: - grafana.jupyter-health.2i2c.cloud +aws-ce-grafana-backend: + enabled: true + envBasedConfig: + clusterName: jupyter-health + serviceAccount: + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::211125465508:role/aws_ce_grafana_backend_iam_role + cluster-autoscaler: enabled: true autoDiscovery: diff --git a/terraform/aws/projects/jupyter-health.tfvars b/terraform/aws/projects/jupyter-health.tfvars index 43b0246d3..851ae3621 100644 --- a/terraform/aws/projects/jupyter-health.tfvars +++ b/terraform/aws/projects/jupyter-health.tfvars @@ -2,12 +2,16 @@ region = "us-east-2" cluster_name = "jupyter-health" cluster_nodes_location = "us-east-2a" +enable_aws_ce_grafana_backend_iam = true + user_buckets = { "scratch-staging" : { - "delete_after" : 7 + "delete_after" : 7, + "tags" : { "2i2c:hub-name" : "staging" }, }, "scratch" : { - "delete_after" : 7 + "delete_after" : 7, + "tags" : { "2i2c:hub-name" : "prod" }, }, } From d36b804040b7440afe452ffca0bf5949493a655c Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Wed, 6 Nov 2024 13:51:30 +0200 Subject: [PATCH 2/5] kitware: enable and configure aws-ce-grafana backend --- config/clusters/kitware/support.values.yaml | 8 ++++++++ terraform/aws/projects/kitware.tfvars | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config/clusters/kitware/support.values.yaml b/config/clusters/kitware/support.values.yaml index e1a483a52..dd6e6203f 100644 --- a/config/clusters/kitware/support.values.yaml +++ b/config/clusters/kitware/support.values.yaml @@ -27,6 +27,14 @@ grafana: hosts: - grafana.kitware.2i2c.cloud +aws-ce-grafana-backend: + enabled: true + envBasedConfig: + clusterName: kitware + serviceAccount: + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::471112920937:role/aws_ce_grafana_backend_iam_role + cluster-autoscaler: enabled: true autoDiscovery: diff --git a/terraform/aws/projects/kitware.tfvars b/terraform/aws/projects/kitware.tfvars index 47a89e6c4..8714f5666 100644 --- a/terraform/aws/projects/kitware.tfvars +++ b/terraform/aws/projects/kitware.tfvars @@ -2,12 +2,16 @@ region = "us-west-2" cluster_name = "kitware" cluster_nodes_location = "us-west-2a" +enable_aws_ce_grafana_backend_iam = true + user_buckets = { "scratch-staging" : { - "delete_after" : 7 + "delete_after" : 7, + "tags" : { "2i2c:hub-name" : "staging" }, }, "scratch" : { - "delete_after" : 7 + "delete_after" : 7, + "tags" : { "2i2c:hub-name" : "prod" }, }, } From 985a1f300e48caf39252b971eabad94ab32503b9 Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Wed, 6 Nov 2024 14:03:18 +0200 Subject: [PATCH 3/5] opensci: enable and configure aws-ce-grafana backend --- config/clusters/opensci/support.values.yaml | 8 ++++++++ terraform/aws/projects/opensci.tfvars | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config/clusters/opensci/support.values.yaml b/config/clusters/opensci/support.values.yaml index d1d7ba1c9..29faa0113 100644 --- a/config/clusters/opensci/support.values.yaml +++ b/config/clusters/opensci/support.values.yaml @@ -32,3 +32,11 @@ grafana: - secretName: grafana-tls hosts: - grafana.opensci.2i2c.cloud + +aws-ce-grafana-backend: + enabled: true + envBasedConfig: + clusterName: opensci + serviceAccount: + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::211125293633:role/aws_ce_grafana_backend_iam_role diff --git a/terraform/aws/projects/opensci.tfvars b/terraform/aws/projects/opensci.tfvars index db6fa3729..b69eefbce 100644 --- a/terraform/aws/projects/opensci.tfvars +++ b/terraform/aws/projects/opensci.tfvars @@ -2,15 +2,20 @@ region = "us-west-2" cluster_name = "opensci" cluster_nodes_location = "us-west-2a" +enable_aws_ce_grafana_backend_iam = true + user_buckets = { "scratch-staging" : { - "delete_after" : 7 + "delete_after" : 7, + "tags" : { "2i2c:hub-name" : "staging" }, }, "scratch-sciencecore" : { - "delete_after" : 7 + "delete_after" : 7, + "tags" : { "2i2c:hub-name" : "sciencecore" }, }, "persistent-sciencecore" : { - "delete_after" : null + "delete_after" : null, + "tags" : { "2i2c:hub-name" : "sciencecore" }, }, } From fbd548fbdc46fefc7b7da5d66833fdd3b2cc59d2 Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Wed, 6 Nov 2024 15:14:14 +0200 Subject: [PATCH 4/5] project-pythia: try enabling the aws-ce-grafana backend --- config/clusters/projectpythia/support.values.yaml | 8 ++++++++ terraform/aws/projects/projectpythia.tfvars | 2 ++ 2 files changed, 10 insertions(+) diff --git a/config/clusters/projectpythia/support.values.yaml b/config/clusters/projectpythia/support.values.yaml index 969c493d8..83d805c83 100644 --- a/config/clusters/projectpythia/support.values.yaml +++ b/config/clusters/projectpythia/support.values.yaml @@ -27,6 +27,14 @@ grafana: hosts: - grafana.projectpythia.2i2c.cloud +aws-ce-grafana-backend: + enabled: true + envBasedConfig: + clusterName: projectpythia + serviceAccount: + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::590183926898:role/aws_ce_grafana_backend_iam_role + cluster-autoscaler: enabled: true autoDiscovery: diff --git a/terraform/aws/projects/projectpythia.tfvars b/terraform/aws/projects/projectpythia.tfvars index 5cda7ae83..2bfd41d0b 100644 --- a/terraform/aws/projects/projectpythia.tfvars +++ b/terraform/aws/projects/projectpythia.tfvars @@ -6,6 +6,8 @@ default_budget_alert = { "enabled" : false, } +enable_aws_ce_grafana_backend_iam = true + # Tip: uncomment and fill the missing info in the lines below if you want # to setup scratch buckets for the hubs on this cluster. # From 68a28dadc615c1cef91673987b4ec95f5d82bc38 Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Wed, 6 Nov 2024 17:36:51 +0200 Subject: [PATCH 5/5] Add a placeholder bucket to get the 2i2c:hub-name tag --- terraform/aws/projects/projectpythia.tfvars | 36 +++++++++------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/terraform/aws/projects/projectpythia.tfvars b/terraform/aws/projects/projectpythia.tfvars index 2bfd41d0b..45f8ea162 100644 --- a/terraform/aws/projects/projectpythia.tfvars +++ b/terraform/aws/projects/projectpythia.tfvars @@ -8,24 +8,20 @@ default_budget_alert = { enable_aws_ce_grafana_backend_iam = true -# Tip: uncomment and fill the missing info in the lines below if you want -# to setup scratch buckets for the hubs on this cluster. -# -#user_buckets = { -# "scratch-staging" : { -# "delete_after" : 7, -# }, -# # Tip: add more scratch buckets below, if this cluster will be multi-tenant -#} +# FIXME: placeholder bucket to get the 2i2c:hub-name tag in place +# so the community cand enable it for cost allocation purposes +# To be removed once it has been activated. +user_buckets = { + "placeholder-bucket-staging" : { + "delete_after" : 7, + "tags" : { "2i2c:hub-name" : "staging" }, + }, +} -# Tip: uncomment and fill the missing info in the lines below if you want -# to setup specific cloud permissions for the buckets in this cluster. -# -#hub_cloud_permissions = { -# "staging" : { -# "user-sa" : { -# bucket_admin_access : ["scratch-staging"], -# }, -# }, -# # Tip: add more namespaces below, if this cluster will be multi-tenant -#} +hub_cloud_permissions = { + "staging" : { + "user-sa" : { + bucket_admin_access : ["placeholder-bucket-staging"], + }, + }, +} \ No newline at end of file