AKS Tests #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AKS Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
action: | |
description: 'Action' | |
required: false | |
default: 'apply' | |
type: choice | |
options: | |
- apply | |
- destroy | |
tests_timestamp_enabled: | |
description: 'Enabled Timestamp Test' | |
required: false | |
default: true | |
type: boolean | |
tests_httpbin_enabled: | |
description: 'Enabled Httpbin Test' | |
required: false | |
default: false | |
type: boolean | |
jobs: | |
performance_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Configure AKS credentials | |
uses: azure/login@v2 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Install Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
- name: Connect to AKS cluster | |
run: | | |
az aks get-credentials \ | |
--resource-group "pt-${{ vars.AZURE_CLUSTER_MACHINE_TYPE }}" \ | |
--name "pt-${{ vars.AZURE_CLUSTER_MACHINE_TYPE }}" | |
kubectl config rename-context $(kubectl config current-context) performance-testing-aks | |
- name: Create Terraform Cloud descriptor | |
run: cp .github/aks/tests ./tests/terraform.cloud.tf | |
- name: Run Terraform action on tests | |
run: | | |
cd tests | |
terraform init | |
terraform ${{ inputs.action }} \ | |
--var="kubernetes_config_context=performance-testing-aks" \ | |
--var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ | |
--var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ | |
--auto-approve | |
- name: Access to Grafana Dashboard | |
if: ${{ inputs.action == 'apply' }} | |
run: | | |
echo "################################################################### | |
echo "# | |
echo "# http://$(kubectl get svc -n dependencies grafana -ojsonpath='{.status.loadBalancer.ingress[0].ip}')" | |
echo "# Username: Admin" | |
echo "# Password: topsecretpassword" | |
echo "# | |
echo "################################################################### |