CICD Pipeline using Jenkins & ArgoCD
  • About the project
  • Overview of the application
  • Dockerizing the application
  • Configure EC2 instance to setup the CI pipeline
  • Configure Jenkins on EC2 instance
  • Create Jenkins CI pipeline
  • Setting up SonarQube server
  • Configure DockerHub and GitHub access tokens inside Jenkins
  • Add GitHub Webhook trigger
  • Execute the Jenkins Build
  • Configure EC2 instance to setup the CD pipeline
  • Install MiniKube and Kubectl
  • Install ArgoCD
  • Deploy the app to Kubernetes using ArgoCD
Powered by GitBook
On this page

Deploy the app to Kubernetes using ArgoCD

PreviousInstall ArgoCD

Last updated 1 year ago

To allow ArgoCD to constantly monitor the spring boot app manifest and deploy the changes to Kubernetes, an ArgoCD application must be created which will fetch the code from the repository and sync the desired state and actual state of the Kubernetes cluster

argocd app create spring-boot-app --repo https://github.com/devops-maestro17/java-cicd-pipeline.git --path spring-boot-app-manifests --dest-namespace default --dest-server https://kubernetes.default.svc --directory-recurse --sync-policy automated

To get the application status

kubectl get app -n argocd

In order to access the application from the browser, the spring-boot-app service must be exposed.

minikube service spring-boot-app-service

This will create a http URL which can be directly accessed from the browser but before that the port forwarding must be enabled using the below command. This will allow HTTP requests on port 31812 (for example) which must also be enabled on Security Group of the EC2 instance

kubectl port-forward --address 0.0.0.0 svc/spring-boot-app-service 31812:80

The application can now be accessed using http://<ip address>/<port number>

The application configuration and the deployment status can also be seen using the ArgoCD UI as shown below:

Details of the application created and its components
Port forwarding