Virtual machines are still the most common way to build and deploy applications via CI/CD. This session explores a new approach: KEDA, a cloud-native autoscaler that will drive the on-demand scaling of containerized build agents running on Azure Container Apps. By leveraging both technologies, we can build highly scalable, cost-efficient and sustainable CI/CD pipelines.
- Click here to view the meetup details
- Find the slides here
- Install Terraform or OpenTofu
- Inject your GitHub PAT as Terraform variable
gh_token
- Update the following variables in
vars.tf
to match your needs:repo_owner
repo_scope
repo_name_app
repo_name_job
image_tag
- Adopt the following locals in
main.tf
to match your needs:prefix
location
runnerImage
- Initialize your GitHub repo by adding the Workflows
release.yaml
&docker-build.yaml
to the path.github/workflows/
- Commit & push
Dockerfile
andentrypoint.sh
to your repo and let the workflow build & release the image
- Run Terraform locally or via worklfow to create needed resources
# Initialize Terraform
terraform init
# Run Teerraform plan to see what will be created
terraform plan
# Execute Terraform apply to create resources
terraform apply -auto-approve
- Add this demo workflow to your repo and run the workflow:
name: Octo Organization CI
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v4
- name: Display summary
run: |
echo "### Next-Gen CICD! :rocket:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Hello from Container App" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- $HOSTNAME" >> $GITHUB_STEP_SUMMARY
# App Env
az containerapp env logs show \
--name gh-runner-env-app \
--resource-group gh-runner-rg \
| jq
# Job Env
az containerapp env logs show \
--name gh-runner-env-job \
--resource-group gh-runner-rg \
| jq
az containerapp logs show \
--name gh-runner-app \
--resource-group gh-runner-rg \
--type system \
| jq
az containerapp logs show \
--name gh-runner-app \
--resource-group gh-runner-rg \
--type console \
| jq
# KEDA logs
ContainerAppSystemLogs_CL
| where EventSource_s == "KEDA"
| project TimeGenerated, EventSource_s ,Reason_s, Log_s, JobName_s, EnvironmentName_s
| order by TimeGenerated asc
# KEDA logs
ContainerAppSystemLogs_CL
| where EventSource_s == "ContainerAppController"
| project TimeGenerated, EventSource_s ,Reason_s, Log_s, JobName_s, EnvironmentName_s
| order by TimeGenerated asc