Continuous Delivery for Kubernetes With Argo CD

ArgoCD is a declarative CD tool for Kubernetes. As a part of the Argo family, ArgoCD has been incubated within the CNCF. All the resources are defined in the Git repo as Argo can directly interact with the deployments. The CLI and respective UI offer a comprehensive toolset that facilitates the deployment of git-defined resources to the Kubernetes cluster.

It focuses on managing application deployments, with an outstanding feature set covering several syncing options, user-access controls, status checks, and more.

ArgoCD also has a friendly modern web UI, where the users can check the status of their application deployments. At the same time, administrators can manage both projects and user access.

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. It supports Kubernetes manifests specified in

  1. kustomize
  2. helm charts
  3. YAML Manifests
  4. ksonnet applications
  5. jsonnet files

Features

  • Offers multi-tenancy through the concept called Projects.
  • It can sync Kubernetes clusters while also being able to handle external clusters.
  • It addresses the GitOps challenge of resources drifting from the configuration. Just like Flux, ArgoCD also detects drifted resources.
  • ArgoCD can remove obsolete resources during the sync process.
  • Automated deployment/rollout.

Prerequisites

  • Kubernetes cluster up and running.
  • GitHub or CodeCommit repository to deploy the application on the ArgoCD dashboard.

Installation

Argo CD is installed and managed in a Kubernetes native way.

It runs in its namespace on Kubernetes, with all configurations saved in Config Maps, Secrets, and Custom Resources.

Install Argo CD

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

This will create a new namespace, argocdwhere Argo CD services and application resources will live.

Access The Argo CD API Server

By default, the Argo CD API server is not exposed to an external IP. To access the API server, choose one of the following techniques to expose the Argo CD API server:

Change the argocd-server service type to LoadBalancer

kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}' 

Copy EXTERNAL-IP of argocd-server service http://192.168.0.102:80

Login Using The CLI

The initial password for the admin the account is auto-generated and stored as clear text in the field password in a secret named argocd-initial-admin-secret In your Argo CD installation namespace. You can retrieve this password using kubectl

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

Change the password using the command

argocd account update-password

ArgoCD deployed on our Kubernetes cluster now It’s time to deploy some applications with ArgoCD Dashboard.

Now open any web browser on your machine and enter the IP Address of argocd-service > login with admin as a username and password that we generated in the above step > Click Enter > it will open argo dashboard like above.

Let’s add our Helm, GitHub, or CodeCommit repository in argo after we create an application.

Goto Settings > Repositories here we have 3 Options to connect the Repository with ArgoCD.

  1. Connect Repo using SSH

If you want to connect with SSH authentication, use this option.

2. Connect Repo using HTTPS

If you want to connect with a username and password, use this option.

3. Connect Repo using GitHub App

Private repositories that are hosted on GitHub.com or GitHub Enterprise can be accessed using credentials from a GitHub Application.

Let’s create our first application on ArgoCD.

Goto Applications > Click on New App

General Setting:

Application Name: Your Application Name

Project: Application creates in the selected project

SYNC Policy: Application Sync Policy(Default Manual)

Source:

Repository URL: Select project repository

Revision: Repository branch of your project

Path: Path of deployment. (Default is . Root)

Destination:

Cluster URL: your cluster URL

Namespace: Enter Namespace in which you want to deploy your application

By default, Argo handles your application type based on your project configuration.

Select your values.yaml file and if you want to change thevalues.yaml file you can change it directly from the PARAMETERS group.

Now, Let’s click on CREATE button to deploy our first helm chart.

It will take some time according to application size.

Once your application status was Healthy click on it and it will display an application deployment graph like here

Thank you for reading, if you have anything to add please send a response or add a note!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Prashant Bhatasana

Prashant Bhatasana

514 Followers

AWS Community Builder | Terraform Associate | Automation Engineer, Love to work with #AWS #Terraform #Jenkins #kubernetes #Docker #Ansible #Selenium