Setup ArgoCD in Kubernetes

Anup Dubey
FAUN — Developer Community 🐾
4 min readJun 27, 2020

--

This blog walks you through setup ArgoCD in the Kubernetes cluster. And bootstrap resources in k8s through the ArgoCD. But before setup, I would like to cover some basics first, and then a step-by-step guide on its implementation.

What Is Argo CD?

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. It extends the benefits of declarative specifications and Git-based configuration management to accelerate deployment and lifecycle management of applications.

Architecture:-

How it works:-

Argo CD follows the GitOps pattern of using Git repositories as the source of truth for defining desired application states. Kubernetes manifests can be specified in several ways:

  • kustomize applications
  • Helm charts
  • ksonnet applications
  • jsonnet files
  • Plain directory of YAML/json manifests
  • Any custom config management tool configured as a config management plugin

Argo CD then automates the deployment of the desired application states in the specified target environments. Application deployments can track updates to branches, tags, or be pinned to a specific version of manifests at a Git commit.

Features:-

  • Automated deployment of applications to specified target environments
  • Ability to manage and deploy to multiple clusters
  • SSO Integration (OIDC, OAuth2, LDAP, SAML 2.0, GitHub, GitLab, Microsoft, LinkedIn)
  • Multi-tenancy and RBAC policies for authorization
  • Rollback/Roll-anywhere to any application configuration committed in Git repository
  • Health status analysis of application resources
  • Automated configuration drift detection and visualization
  • Automated or manual syncing of applications to its desired state
  • Web UI which provides a real-time view of application activity
  • PreSync, Sync, PostSync hooks to support complex application rollouts (e.g.blue/green & canary upgrades)
  • Audit trails for application events and API calls

For more details, see Argo CD.

Install and set up the ArgoCD:-

Prerequisites:-

Before you get started, you will need to do a number of things.

  • Installed kubectl command-line tool
  • Have a kubeconfig file (default location is ~/.kube/config).

As the “Getting Started” documentation from ArgoCD will show, the install process is very straightforward.

Let’s start working on it!!

Follow the mentioned steps to get this up and running:

  • Clone the Github repo and deploy ArgoCD into Cluster.
  • Check ArgoCD Deployment status
  • Access ArgoCD UI through port-forwarding
  • Access ArgoCD.
  • Bootstrap resources
  1. Clone the Github repo and deploy ArgoCD into Cluster:-

First clone the Github repo. This repository has a Makefile and a cluster-charts for setting up an ArgoCD running in Kubernetes.

git clone https://github.com/anup1384/argocdops.git

After cloning this go to argocdops directory and run make command with option “install-argocd” for HA setup use “install-arocd-ha” option.

make install-argocd

2. Check ArgoCD Deployment status:-

Now we are done with the ArgoCD deployment, it’s time to deployment status.

make argocd-status

3. Access ArgoCD UI through port-forwarding

Run the following command to use ArgoCD service in the local system using kube proxy.

make proxy-argocd-ui

ArgoCD UI home page can be accessed by the https://localhost:8080/.

This type of page will come!!!

4. Access ArgoCD:-

Run the following command to retrieve the password (password is actually the name of your running server).

make argocd-password

In the Login page, enter admin in username and password.

Then you’ll see the following screen! Congrats, you got ArgoCD running in your cluster!

5. Bootstrap resources:-

Deploy bootstrap resources applications through the ArgoCD in Kubernetes.

make bootstrap

Now bootstrap-cluster has been deployed but the current state of the deployment of the resources is out-of-sync with the deployment configuration in the git repository.
Click on the Sync button, in the UI and then click Synchronize.
Now you can watch your app/server deploy!

I hope this blog was useful to you. Looking forward to claps and suggestions. For any queries, feel free to comment.

For more related content, visit https://opendevops.in/

Don’t forget to check out my other posts:

  1. Deploying and Scaling Jenkins on Kubernetes
  2. Setup Elastic Search cluster, Kibana & Fluentd on Kubernetes with X-pack Security: Part-1
  3. Deploying and Scaling Jenkins on Kubernetes
  4. How to host Helm chart repository on GitHub
  5. Kubernetes application logging using Fluentd

Subscribe to FAUN topics and get your weekly curated email of the must-read tech stories, news, and tutorials 🗞️

Follow us on Twitter 🐦 and Facebook 👥 and Instagram 📷 and join our Facebook and Linkedin Groups 💬

If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇

--

--