Skip to content

Commit

Permalink
The annotation has to be set manually due to the order of file genera…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
GeorgianaElena committed Nov 12, 2024
1 parent 14a0592 commit fc8a564
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion config/clusters/templates/common/support.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: <output of `terraform output -raw aws_ce_grafana_backend_k8s_sa_annotation`>

cluster-autoscaler:
enabled: true
Expand Down
5 changes: 0 additions & 5 deletions deployer/commands/generate/dedicated_cluster/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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(
Expand Down
38 changes: 22 additions & 16 deletions docs/hub-deployment-guide/deploy-support/configure-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,32 @@ need to recreate them, only update them if required.

In the `infrastructure` repo, the full filepath should be: `config/clusters/<cluster_name>/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.
Expand Down

0 comments on commit fc8a564

Please sign in to comment.