GKE Performance Test #8
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: GKE Performance Test | |
on: | |
workflow_dispatch: | |
inputs: | |
analytics_enabled: | |
description: 'Enabled Analytics gathering' | |
required: false | |
default: false | |
type: boolean | |
auth_enabled: | |
description: 'Enabled Authentication' | |
required: false | |
default: false | |
type: boolean | |
quota_enabled: | |
description: 'Enabled Quota' | |
required: false | |
default: false | |
type: boolean | |
rate_limit_enabled: | |
description: 'Enabled Rate Limiting' | |
required: false | |
default: false | |
type: boolean | |
open_telemetry_enabled: | |
description: 'Enabled Open Telemetry' | |
required: false | |
default: false | |
type: boolean | |
open_telemetry_sampling_ratio: | |
description: 'Open Telemetry Sampling Ratio' | |
required: false | |
type: string | |
default: '0.5' | |
tyk_version: | |
description: 'Tyk Gateway version' | |
required: true | |
type: string | |
default: 'v5.3.0' | |
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 | |
cluster_ttl: | |
description: 'Cluster Time to Live (minutes)' | |
required: false | |
default: 240 | |
type: number | |
jobs: | |
performance_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Authenticate into gcloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCP_CREDENTIALS }} | |
- name: Install gcloud CLI | |
uses: google-github-actions/[email protected] | |
- name: Install gcloud k8s auto component | |
run: gcloud components install gke-gcloud-auth-plugin | |
- name: Install Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Stand up GKE cluster | |
run: | | |
cd gke | |
terraform init | |
terraform apply \ | |
--var="project=${{ secrets.GCP_PROJECT }}" \ | |
--var="cluster_location=${{ vars.GCP_CLUSTER_LOCATION }}" \ | |
--var="cluster_machine_type=${{ vars.GCP_CLUSTER_MACHINE_TYPE }}" \ | |
--auto-approve | |
- name: Deploy testing resources | |
run: | | |
cd deployments | |
terraform init | |
terraform apply \ | |
--var="kubernetes_config_context=performance-testing-gke" \ | |
--var="analytics_enabled=${{ inputs.analytics_enabled }}" \ | |
--var="auth_enabled=${{ inputs.auth_enabled }}" \ | |
--var="quota_enabled=${{ inputs.quota_enabled }}" \ | |
--var="rate_limit_enabled=${{ inputs.rate_limit_enabled }}" \ | |
--var="open_telemetry_enabled=${{ inputs.open_telemetry_enabled }}" \ | |
--var="open_telemetry_sampling_ratio=${{ inputs.open_telemetry_sampling_ratio }}" \ | |
--var="tyk_version=${{ inputs.tyk_version }}" \ | |
--var="grafana_service_type=LoadBalancer" \ | |
--auto-approve | |
- name: Run Tests | |
run: | | |
cd deployments | |
terraform init | |
terraform apply \ | |
--var="kubernetes_config_context=performance-testing-gke" \ | |
--var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ | |
--var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ | |
--auto-approve | |
- name: Access to Grafana Dashboard | |
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 "################################################################### | |
- name: Results Time to Live Sleep | |
run: sleep ${{inputs.cluster_ttl}}m | |
- name: Tear Down cluster | |
run: | | |
cd gke | |
terraform destroy \ | |
--var="project=${{ secrets.GCP_PROJECT }}" \ | |
--var="cluster_location=${{ vars.GCP_CLUSTER_LOCATION }}" \ | |
--var="cluster_machine_type=${{ vars.GCP_CLUSTER_MACHINE_TYPE }}" \ | |
--auto-approve |