Skip to content

Azure AKS Platform tests #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/platform-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ jobs:
# Choose the tests that match the labels
tests=$(jq --null-input --compact-output --argjson allTests "${allTests}" --argjson chosenTests "${chosenTests}" '$allTests | map(select(. as $test | $chosenTests | index($test)))')
else
# remove manual only tests
tests=$(jq --null-input --compact-output --argjson allTests "${allTests}" --argjson manualOnlyTests "${manualOnlyTests}" '$allTests | map(select(. as $test | $manualOnlyTests | index($test) | not))')
tests=${allTests}
fi

# remove manual only tests
tests=$(jq --null-input --compact-output --argjson tests "${tests}" --argjson manualOnlyTests "${manualOnlyTests}" '$tests | map(select(. as $test | $manualOnlyTests | index($test) | not))')

echo "Running tests: ${tests}"
echo "tests=${tests}" >> "${GITHUB_OUTPUT}"

Expand Down Expand Up @@ -82,7 +85,9 @@ jobs:
env:
TEST: ${{ matrix.test }}
run: |
if [ -f "charts/k8s-monitoring/tests/platform/${TEST}/eks-cluster-config.yaml" ]; then
if [ -f "charts/k8s-monitoring/tests/platform/${TEST}/aks-cluster-config.yaml" ]; then
echo "cluster-type=aks" >> "${GITHUB_OUTPUT}"
elif [ -f "charts/k8s-monitoring/tests/platform/${TEST}/eks-cluster-config.yaml" ]; then
echo "cluster-type=eks" >> "${GITHUB_OUTPUT}"
elif [ -f "charts/k8s-monitoring/tests/platform/${TEST}/gke-cluster-config.yaml" ]; then
echo "cluster-type=gke" >> "${GITHUB_OUTPUT}"
Expand All @@ -100,6 +105,26 @@ jobs:
with:
install_only: true

- name: Configure Azure Credentials
if: ${{ steps.check-cluster-config.outputs.cluster-type == 'aks' }}
run: |
echo "Not ready for automated testing yet"
exit 1
# uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
# with:
# auth-type: IDENTITY
# client-id: ${{ secrets.AZURE_CLIENT_ID }}
# subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# tenant-id: ${{ secrets.AZURE_TENANT_ID }}

- name: Setup Azure CLI
if: ${{ steps.check-cluster-config.outputs.cluster-type == 'aks' }}
uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # v2.1.0
with:
azcliversion: latest
inlineScript: |
az version

- name: Setup eksctl CLI
if: ${{ steps.check-cluster-config.outputs.cluster-type == 'eks' }}
run: |
Expand Down
11 changes: 11 additions & 0 deletions charts/k8s-monitoring/tests/platform/aks/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export AZURE_CLIENT_ID=$(op --account grafana.1password.com read "op://Kubernetes Monitoring/Azure/client id")
export AZURE_SUBSCRIPTION_ID=$(op --account grafana.1password.com read "op://Kubernetes Monitoring/Azure/subscription id")
export AZURE_TENANT_ID=$(op --account grafana.1password.com read "op://Kubernetes Monitoring/Azure/tenant id")
export AZURE_DEFAULT_GROUP=$(op --account grafana.1password.com read "op://Kubernetes Monitoring/Azure/resource group")
az config set defaults.group="$AZURE_DEFAULT_GROUP"
export KUBECONFIG=$(pwd)/kubeconfig.yaml

export GRAFANA_CLOUD_METRICS_USERNAME=$(op --account grafana.1password.com read "op://Kubernetes Monitoring/helmchart Prometheus/username")
export GRAFANA_CLOUD_LOGS_USERNAME=$(op --account grafana.1password.com read "op://Kubernetes Monitoring/helmchart Loki/username")
export GRAFANA_CLOUD_RW_POLICY_TOKEN=$(op --account grafana.1password.com read "op://Kubernetes Monitoring/helmchart Loki/password")
export RANDOM_NUMBER=$(shuf -i 100000-999999 -n 1)
3 changes: 3 additions & 0 deletions charts/k8s-monitoring/tests/platform/aks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
deployments/grafana-cloud-credentials.yaml
deployments/test-variables.yaml
kubeconfig.yaml
1 change: 1 addition & 0 deletions charts/k8s-monitoring/tests/platform/aks/.manual-only
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove this file when we have the appropriate credentials to create AKS clusters
Loading
Loading