Hands on DevOps Coaching provided on AWS and Azure Cloud platforms. please contact devops.coaching@gmail.com for more info.
Monday, November 21, 2022
How to Deploy Springboot App into AKS cluster using Jenkins Pipeline and Kubectl CLI Plug-in | Deploy Microservices into AKS cluster using Jenkins Pipeline
We are going to learn how to Automate build and deployment of Springboot Microservices App into Azure Kubernetes Cluster(AKS) using 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 Deployments to Azure Kubernetes Cluster
Watch Steps in YouTube Channel:
Pre-requistes:
1. AKS cluster needs to be up running. You can create AKS cluster using any of one of the below options:
sh ('kubectl apply -f jenkins-aks-deploy-from-acr.yaml')
}
}
}
}
}
}
Step # 5 - Build the pipeline
Step # 6 - Verify deployments to AKS
kubectl get pods
kubectl get services
Steps # 7 - Access Springboot App Deployed in AKS cluster
Once deployment is successful, go to browser and enter above load balancer URL mentioned above
You should see page like below:
Clean up the Cluster:
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 myResourceGroup --yes --no-wait
[Pipeline] End of Pipeline
ReplyDeleteERROR: special characters are not allowed
at [Source: (StringReader); line: 1, column: 1]
Finished: FAILURE
I'm facing this issue at the Deploy stage, everything else works as expected