Skip to content

How to setup ArgoCD from scratch and deploy your app

argocd-redis-example.png

Introduction

ArgoCD is a popular tool used for continuous delivery of Kubernetes applications. With ArgoCD, you can deploy your applications to Kubernetes clusters with ease. In this blog post, we will guide you through the process of setting up ArgoCD from scratch and deploying your first app.

Install ArgoCD

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

## Change the argocd-server service type to LoadBalancer
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'

## Get the external IP
kubectl get svc argocd-server

## Visit the ArgoCD UI from the browser with external IP above

## Login
argocd admin initial-password -n argocd

## CLI login
argocd login <ARGOCD_SERVER>

## Change password
argocd account update-password

Create your first APP from Web

Cloud use bitnami Helm repo as Source to quickly get started (https://charts.bitnami.com/bitnami).

Create your first APP from CLI

argocd login --core
kubectl config set-context --current --namespace=argocd
argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default

argocd app get guestbook
argocd app sync guestbook

Best Practices for Using ArgoCD

Here are some best practices to keep in mind when using ArgoCD:

  1. Always use version control for your Kubernetes manifests.
  2. Use ArgoCD’s built-in validation to catch errors before deploying.
  3. Use ArgoCD’s rollback functionality to quickly revert changes if necessary.

Other Deployment Tools

Tool Lizenz GitHub Stars Ease of Use UI Commercial Support Templating Deployment
https://github.com/cdk8s-team/cdk8s Apache 2.0 3.9k ⭐⭐⭐⭐
https://github.com/kubernetes/kubectl Apache 2.0 2.6k ⭐⭐⭐⭐
https://github.com/glasskube/operator LGPL.v3 152 ⭐⭐⭐⭐
https://github.com/helm/helm Apache 2.0 25.3k ⭐⭐⭐
https://github.com/kubernetes-sigs/kustomize Apache 2.0 10.2k ⭐⭐⭐⭐
https://github.com/fluxcd/flux2 Apache 2.0 5.5k ⭐⭐⭐
https://github.com/argoproj/argo-cd Apache 2.0 14.9k ⭐⭐⭐⭐
https://github.com/stefanprodan/timoni Apache 2.0 981 ⭐⭐⭐⭐⭐
https://github.com/carvel-dev/carvel Apache 2.0 325 ⭐⭐⭐
https://github.com/pulumi/pulumi Apache 2.0 18.4k ⭐⭐⭐⭐
https://github.com/hashicorp/terraform BSL 39.8k
https://github.com/grafana/tanka MIT 2.1k ⭐⭐
https://github.com/dhall-lang/dhall-kubernetes Apache 2.0 600 ⭐⭐⭐

Conclusion

Setting up ArgoCD and deploying your first app may seem daunting at first, but with this guide, you should be able to do it with ease. Remember to follow best practices when using ArgoCD to ensure a smooth deployment process. Happy deploying!

Reference

  • https://argo-cd.readthedocs.io/en/stable/getting_started/
  • argocd CLI: https://github.com/argoproj/argo-cd/releases/tag/v2.7.8
  • https://github.com/argoproj/argocd-example-apps
Feedback







Disclaimer
  • Welcome to visit the knowledge base of SRE and DevOps!
  • License under CC BY-NC 4.0
  • Made with Material for MkDocs and improve writing by generative AI tools
  • Copyright issue feedback me#imzye.com, replace # with @