From fc8a5641033965d2a22502fd43662a61f97adc76 Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Tue, 12 Nov 2024 11:56:08 +0200 Subject: [PATCH] The annotation has to be set manually due to the order of file generation --- .../templates/common/support.values.yaml | 2 +- .../generate/dedicated_cluster/aws.py | 5 --- .../deploy-support/configure-support.md | 38 +++++++++++-------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/config/clusters/templates/common/support.values.yaml b/config/clusters/templates/common/support.values.yaml index d06c809277..b27cab4d8d 100644 --- a/config/clusters/templates/common/support.values.yaml +++ b/config/clusters/templates/common/support.values.yaml @@ -33,7 +33,7 @@ aws-ce-grafana-backend: clusterName: {{ cluster_name }} serviceAccount: annotations: - eks.amazonaws.com/role-arn: {{ aws_grafana_sa_annotation }} + eks.amazonaws.com/role-arn: cluster-autoscaler: enabled: true diff --git a/deployer/commands/generate/dedicated_cluster/aws.py b/deployer/commands/generate/dedicated_cluster/aws.py index 85195d954a..6aa86bb12c 100644 --- a/deployer/commands/generate/dedicated_cluster/aws.py +++ b/deployer/commands/generate/dedicated_cluster/aws.py @@ -110,10 +110,6 @@ def aws( ..., prompt="The AWS account id or alias. Declare 2i2c for 2i2c's SSO based accounts and paid_by_us=true", ), - aws_ce_grafana_backend_k8s_sa_annotation: str = typer.Option( - ..., - help="Output of `terraform output -raw aws_ce_grafana_backend_k8s_sa_annotation` for the cluster", - ), force: bool = typer.Option( False, "--force", @@ -143,7 +139,6 @@ def aws( "cluster_region": cluster_region, "sign_in_url": sign_in_url, "paid_by_us": str(paid_by_us).lower(), - "aws_grafana_sa_annotation": aws_ce_grafana_backend_k8s_sa_annotation, } if not check_before_continuing_with_generate_command( diff --git a/docs/hub-deployment-guide/deploy-support/configure-support.md b/docs/hub-deployment-guide/deploy-support/configure-support.md index fd31021a8e..cf6fd71008 100644 --- a/docs/hub-deployment-guide/deploy-support/configure-support.md +++ b/docs/hub-deployment-guide/deploy-support/configure-support.md @@ -16,26 +16,32 @@ need to recreate them, only update them if required. In the `infrastructure` repo, the full filepath should be: `config/clusters//support.values.yaml`. -Checkout the template support values file in `config/clusters/templates/common/support.values.yaml` for an example configuration. If the cluster is running on GCP or AWS, the deployer should have been generated this file already. +If the cluster is running on GCP or AWS, the deployer should have been generated this file already. -If you are deploying the support chart on an Azure cluster, you **must** manually create such a file using the template mentioned above. Also, you must set an annotation for `ingress-nginx`'s k8s Service resource by including the following in your `support.values.yaml` file: +1. If you are deploying the support chart on an AWS cluster, you **must** also manually update the `aws-ce-grafana-backend` service account annotation in the `support.values.yaml` with the output of thew following command: -```yaml -ingress-nginx: - controller: - service: - annotations: - # This annotation is a requirement for use in Azure provided - # LoadBalancer. - # - # ref: https://learn.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli#basic-configuration - # ref: https://github.com/Azure/AKS/blob/master/CHANGELOG.md#release-2022-09-11 - # ref: https://github.com/Azure/AKS/issues/2907#issuecomment-1109759262 - # ref: https://github.com/kubernetes/ingress-nginx/issues/8501#issuecomment-1108428615 - # - service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path: /healthz +```bash +terraform output -raw aws_ce_grafana_backend_k8s_sa_annotation ``` +2. If you are deploying the support chart on an Azure cluster, you **must** manually create such a file using the template at `config/clusters/templates/common/support.values.yaml`. Also, you must set an annotation for `ingress-nginx`'s k8s Service resource by including the following in your `support.values.yaml` file: + + ```yaml + ingress-nginx: + controller: + service: + annotations: + # This annotation is a requirement for use in Azure provided + # LoadBalancer. + # + # ref: https://learn.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli#basic-configuration + # ref: https://github.com/Azure/AKS/blob/master/CHANGELOG.md#release-2022-09-11 + # ref: https://github.com/Azure/AKS/issues/2907#issuecomment-1109759262 + # ref: https://github.com/kubernetes/ingress-nginx/issues/8501#issuecomment-1108428615 + # + service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path: /healthz + ``` + ## Edit your `cluster.yaml` file Add the following config as a top-level key to your `cluster.yaml` file.