From 7bc066634b1eb46cf12699e240ad6c667de3703e Mon Sep 17 00:00:00 2001 From: Rafal Korepta Date: Tue, 12 Dec 2023 13:03:58 +0100 Subject: [PATCH 1/3] Change Azure region to match allowed list --- .buildkite/capi/aks-cluster/README.md | 23 +++++++++++++++++++++++ .buildkite/capi/aks-cluster/values.yaml | 2 +- .buildkite/hooks/pre-command | 5 ++--- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 .buildkite/capi/aks-cluster/README.md diff --git a/.buildkite/capi/aks-cluster/README.md b/.buildkite/capi/aks-cluster/README.md new file mode 100644 index 0000000000..c851adbc7c --- /dev/null +++ b/.buildkite/capi/aks-cluster/README.md @@ -0,0 +1,23 @@ +# aks-cluster + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) + +A Helm chart for aks capi clusters + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| clientID | string | `""` | | +| clientSecret.name | string | `""` | | +| clientSecret.namespace | string | `""` | | +| controlPlaneReplicas | int | `1` | | +| kubernetesVersion | string | `"1.26.3"` | | +| location | string | `"eastus2"` | | +| resourceGroup | string | `""` | | +| subscriptionID | string | `""` | | +| tenantID | string | `""` | | +| workerReplicas | int | `1` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/.buildkite/capi/aks-cluster/values.yaml b/.buildkite/capi/aks-cluster/values.yaml index 5dc87fe873..43a5c9cfad 100644 --- a/.buildkite/capi/aks-cluster/values.yaml +++ b/.buildkite/capi/aks-cluster/values.yaml @@ -8,7 +8,7 @@ kubernetesVersion: 1.26.3 # Name of the Azure datacenter location. Change this value to your desired location -location: "westus2" +location: "eastus2" clientID: "" tenantID: "" diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index bbba42d765..44fa0518fa 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -139,17 +139,16 @@ test_aks() { --password $AZURE_CLIENT_SECRET \ --tenant $AZURE_TENANT_ID - # the westus2 is used as buildkite is deployed in us-west-2 which is close to Azure westus2 (Maybe in the same city) docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ az group create \ --name $TEST_RESOURCE_GROUP \ - --location westus2 + --location eastus2 docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ az storage account create \ --name $TEST_STORAGE_ACCOUNT \ --resource-group $TEST_RESOURCE_GROUP \ - --location westus2 \ + --location eastus2 \ --sku Standard_RAGRS \ --kind StorageV2 From 7aeb4ec27abf227ce658ad843cbf0bd7c3b819ea Mon Sep 17 00:00:00 2001 From: Rafal Korepta Date: Tue, 12 Dec 2023 17:04:57 +0100 Subject: [PATCH 2/3] Bump azure cli version --- .buildkite/hooks/pre-command | 10 +++++----- .buildkite/hooks/pre-exit | 8 ++++---- .buildkite/scripts/cloud-test.sh | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 44fa0518fa..b500738086 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -133,18 +133,18 @@ test_aks() { export TEST_STORAGE_ACCOUNT TEST_RESOURCE_GROUP TEST_STORAGE_CONTAINER - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az login --service-principal \ --username $AZURE_CLIENT_ID \ --password $AZURE_CLIENT_SECRET \ --tenant $AZURE_TENANT_ID - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az group create \ --name $TEST_RESOURCE_GROUP \ --location eastus2 - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az storage account create \ --name $TEST_STORAGE_ACCOUNT \ --resource-group $TEST_RESOURCE_GROUP \ @@ -152,13 +152,13 @@ test_aks() { --sku Standard_RAGRS \ --kind StorageV2 - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az storage container create \ --name $TEST_STORAGE_CONTAINER \ --account-name $TEST_STORAGE_ACCOUNT - TEST_AZURE_SHARED_KEY=$(docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 az storage account keys list -g $TEST_RESOURCE_GROUP -n $TEST_STORAGE_ACCOUNT --query '[0].value' -o tsv) + TEST_AZURE_SHARED_KEY=$(docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 az storage account keys list -g $TEST_RESOURCE_GROUP -n $TEST_STORAGE_ACCOUNT --query '[0].value' -o tsv) export TEST_AZURE_SHARED_KEY trap kind_dump EXIT diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index 5bac78092a..110e91e28d 100644 --- a/.buildkite/hooks/pre-exit +++ b/.buildkite/hooks/pre-exit @@ -52,22 +52,22 @@ cleanup_aks() { export CI TEST_STORAGE_ACCOUNT TEST_RESOURCE_GROUP - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az login --service-principal \ --username 918839a6-3e96-4950-8bf2-f56d0a2e7447 \ --password $AZURE_CLIENT_SECRET \ --tenant 9a95fd9e-005d-487a-9a01-d08c1eab2757 || true - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az storage account delete \ --name $TEST_STORAGE_ACCOUNT \ --resource-group $TEST_RESOURCE_GROUP \ --yes - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az group delete --resource-group $TEST_RESOURCE_GROUP --yes --debug - docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 \ + docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az group delete --resource-group $TEST_RESOURCE_GROUP --yes --debug || true } diff --git a/.buildkite/scripts/cloud-test.sh b/.buildkite/scripts/cloud-test.sh index ba4ac25569..354e310f44 100755 --- a/.buildkite/scripts/cloud-test.sh +++ b/.buildkite/scripts/cloud-test.sh @@ -28,7 +28,7 @@ gke() { aks() { echo '--- testing that there is data in the azure storage container' - if (docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.50.0 az storage blob list -c $TEST_STORAGE_CONTAINER --account-key $TEST_AZURE_SHARED_KEY --account-name $TEST_STORAGE_ACCOUNT --query "[].{name:name}" --output tsv | grep manifest.json ); then + if (docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 az storage blob list -c $TEST_STORAGE_CONTAINER --account-key $TEST_AZURE_SHARED_KEY --account-name $TEST_STORAGE_ACCOUNT --query "[].{name:name}" --output tsv | grep manifest.json ); then echo "Manifest found. Success!" else echo "No manifest uploaded. Cloud-storage test failed." From ecebd790be914c7859f7a0789cd7f7eb6598c9b0 Mon Sep 17 00:00:00 2001 From: Rafal Korepta Date: Tue, 12 Dec 2023 17:05:31 +0100 Subject: [PATCH 3/3] Add auth-mode flag --- .buildkite/hooks/pre-command | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index b500738086..7a57092edf 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -155,7 +155,8 @@ test_aks() { docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 \ az storage container create \ --name $TEST_STORAGE_CONTAINER \ - --account-name $TEST_STORAGE_ACCOUNT + --account-name $TEST_STORAGE_ACCOUNT \ + --auth-mode login TEST_AZURE_SHARED_KEY=$(docker run -v $(realpath .azure):/root/.azure mcr.microsoft.com/azure-cli:2.55.0 az storage account keys list -g $TEST_RESOURCE_GROUP -n $TEST_STORAGE_ACCOUNT --query '[0].value' -o tsv)