CD with Argo CD

CD with Argo CD

I have tried various options for CD, I liked an approach where the deployments are separately managed from the CI cycles. This gives me a lot of flexibility to manage deployments better.

I would like to introduce ArgoCD. As per the Argo CD docs, Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. Argo CD has now become my defacto standard for deploying applications on Kubernetes.

To deploy an application on Kubernetes using ArgoCD here are the steps to be followed.

  • Build your application, run your tests, containerise the same and push it to a container registry. This is ideally the typical CI cycle. This is what a developer would do.
  • Create a separate git repo for your deployment now. This would contain application definitions, configurations, and environments. Application deployment and lifecycle management will now become automated, auditable, and easy to understand if this repo is used to perform the deployments. Check the following git repo for an example project that you can use for deployment.
  • Setup Argo CD on Kubernetes with these commands.

# command to install ArgoCD in k8
kubectl create namespace argocd

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# commands to access ArgoCD UI
kubectl get svc -n argocd
kubectl port-forward svc/argocd-server 8080:443 -n argocd

# login with admin user and below token (as in documentation):
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 --decode && echos        

  • Access the ArgoCD UI at https://localhost:8080 and login using the user name as "admin" and password as retrieved above.

No alt text provided for this image

  • Deploy your application using ArgoCD. The sample project has the following structure. It contains a dev folder that contains the Kubernetes Deployment and Service definitions. It also contains an application.yaml file that contains the Application definition for ArgoCD. We can now configure the application on ArgoCD using the following command. Note that this is the only apply we would do on Kubernetes and this command will deploy the application definition onto ArgoCD.

kubectl apply -n argocd -f application.yaml        
No alt text provided for this image
No alt text provided for this image

  • Access your application. You should now be able to access your application. If your tried using the sample repo for deployment, execute the command below and access the application at https://localhost:3000

kubectl port-forward svc/redux-punch 3000:3000 -n redux-punch        
No alt text provided for this image

  • For more details on how to manage environments, what all options and features are possible, refer to ArgoCD documentation.

要查看或添加评论,请登录

Venkatesh S的更多文章

  • Budibase - Build internal apps in minutes, No/Low Code Platform

    Budibase - Build internal apps in minutes, No/Low Code Platform

    I come across various use cases where I am supposed to build some internal apps. I always feel that coding the entire…

  • Rete Algorithm : Implementing Rule Engine using evrete

    Rete Algorithm : Implementing Rule Engine using evrete

    A Fast Algorithm for the Many Pattern and Many Object Pattern Match Problem. This was PhD work of Charles L.

  • Hoppscotch - Open Source API Development EcoSystem

    Hoppscotch - Open Source API Development EcoSystem

    I have been a regular user of Postman when it comes to building and using APIs. It has always helped me build the APIs…

  • TestContainers - Reliable environment for running tests

    TestContainers - Reliable environment for running tests

    I had several challenges while writing integration test cases where there are dependencies on multiple upstream and…

    1 条评论
  • Istio Service Mesh : Complete Setup

    Istio Service Mesh : Complete Setup

    Distributed or Microservices architectures have some serious challenges when it comes to building and deploying the…

  • AWS on Local Desktop - LocalStack

    AWS on Local Desktop - LocalStack

    In a typical application development lifecycle, I usually see that majority of the times certain AWS cloud services are…

  • Kubernetes with Rancher Desktop

    Kubernetes with Rancher Desktop

    I loved using Docker Desktop, however a few months ago, I picked up Rancher Desktop. After using it for almost 3 months…

  • Redux Punch

    Redux Punch

    What is Redux Punch? Redux punch is a project recipe bootstrapped with "Create React…

社区洞察

其他会员也浏览了