We are going to learn how to Automate build and deploy of Springboot Microservices App into Azure Kubernetes Cluster(AKS) using Helm and Jenkins pipeline.
Sample springboot App Code:
I have created a sample Springboot App setup in GitHub. Click here to access code base in GitHub.
Jenkins pipeline will:
- Automate maven build(jar) using Jenkins
- Automate Docker image creation
- Automate Docker image upload into Azure container registry
- Automate Springboot docker container Deployments to Azure Kubernetes Cluster using Helm charts
Implementation steps:
- Create a resource group, AKS cluster and Azure container registry
- Provide pull access for AKS to pull image from ACR
- Create a namespace for helm deployment
- Create a helm chart for spring boot app
- Create a Jenkins pipeline with below stages:
- checkout
- Build Jar
- Build docker image
- Upload image to ACR
- Deploy to AKS using helm
- Run the pipeline to deploy springboot app into AKS
- Verify deployments in the namespace in AKS
- Access the app in the browser
- Resource group
- AKS cluster
- ACR repo
- provide pull access to AKS for pulling docker image from ACR
- namespace in AKS cluster for deploying our springboot app
Make sure you change values as per your settings highlighted in yellow below:
To avoid charges from Azure, you should clean up unneeded resources. When the cluster is no longer needed, use the az group delete command to remove the resource group, container service, and all related resources.
az group delete --name resource-group-name --yes --no-wait
Watch steps in YouTube Channel: