Skip to content

Ritish134/Gitops-pipeline-ArgoCD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitOps Pipeline with Argo CD and Argo Rollouts

image

Overview

This repo demonstrates setting up a GitOps pipeline using Argo CD for continuous deployment and Argo Rollouts for advanced deployment strategies within a Kubernetes environment. This automates the deployment and management of a simple web application.

Prerequisites

  • Docker installed on your machine.
  • kubectl installed on your machine.
  • Minikube installed on your machine.

Summary of Process

  1. Start Minikube with Docker as the Driver:

    • Start Minikube using Docker as the driver.

      minikube start --driver=docker

      s1

  2. Setup and Configuration:

    • Created a GitHub repository to host the source code.

    • Install Argo CD on the Kubernetes cluster following the official documentation.

      kubectl create namespace argocd
      kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
    • Install the Argo Rollouts controller in the Kubernetes cluster following the official guide.

      kubectl create namespace argo-rollouts
      kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml

      s2

  3. Creating the GitOps Pipeline: Dockerize the Application:

    • Build a Docker image for the web application and push it to a public container registry. Here
      docker build -t ritish134/web-app:v1 .
      docker push ritish134/web-app:v1

    s3 s4

    • Modified Kubernetes manifests in the Git repository to use the Docker image.
    • Configured Argo CD to monitor the repository and automatically deploy changes to the Kubernetes cluster.
  4. Implementing a Canary Release with Argo Rollouts:

    • Defined a rollout strategy using Argo Rollouts, specifying a canary release strategy.
    • Triggered a rollout by updating the Docker image, pushing the new version to the registry, and updating the rollout definition.
    • Monitored the rollout using Argo Rollouts to ensure successful completion of the canary release.

    s5

Challenges Encountered and Resolutions

  • ImagePullBackOff and ErrImagePull Errors:

    • Challenge: Encountered issues with pulling the Docker image during deployment.
    • Resolution: Verified image availability, checked network connectivity, and ensured proper Docker and Kubernetes configurations.

    s7

  • Pending External IP for LoadBalancer Service:

    • Challenge: Faced difficulties obtaining an external IP address for the LoadBalancer service.
    • Resolution: Used port forwarding or NodePort service types for local Kubernetes clusters.

    s6

    s8

Clean Up

To cleanly remove all resources created from the Kubernetes cluster:

  1. Delete Argo CD Application:

    • Log in to the Argo CD UI.
    • Delete the web-app application to remove deployed resources from the cluster.
  2. Uninstall Argo CD and Argo Rollouts Controllers:

  • Uninstall Argo CD:

    kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
    
  • Uninstall Argo Rollouts:

    kubectl delete -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
    
  1. Delete Kubernetes Resources:

    • Use kubectl delete commands to delete any remaining Kubernetes resources, such as deployments, services, and pods.
  2. Clean Up Git Repository:

    • Optionally, clean up the Git repository by removing any files or branches related to it.

By following these steps, we can ensure a clean removal of all resources created, leaving the Kubernetes cluster and Git repository in original state.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published