Home

Awesome

Argo CD in a nutshell

Zero-conf, repeatable Argo CD environments for demoing, development purposes or troubleshooting (i.e. to reproduce an issue on a clean environment) using Vagrant and k3s in a single-node setup.

Please be aware that this is work in progress, and mainly serves for my own purposes. I thought it could be useful enough to share, however, so here it is.

Getting started

You will need Vagrant and VirtualBox installed on your system. Also, this box will set-up a private network with CIDR range 192.168.56.0/24, so make sure you don't have this already setup on your host, or have a route to an already existing net or host in that range.

Then:

git clone https://github.com/jannfis/argocd-nutshell
cd argocd-nutshell
vagrant up

This will fire up a VM with the default variant of Argo CD up & running. This can take a couple of minutes, depending on your network speed and general computer performance specs.

To make sure everything is up & running, ssh into the box and check the pods status:

$ vagrant ssh
vagrant@argocd-nutshell:~$ kubectl get pods -n argocd
NAME                                  READY   STATUS    RESTARTS   AGE
argocd-redis-6fb68d9df5-sx7xh         1/1     Running   0          4m30s
argocd-dex-server-748c65b578-kqlpp    1/1     Running   0          4m30s
argocd-application-controller-0       1/1     Running   0          4m30s
argocd-repo-server-64f4ddf469-mbdzn   1/1     Running   0          4m30s
argocd-server-846cf6844-9dvcl         1/1     Running   0          4m30s

If all pods are running correctly, you can then access the web UI by visiting

https://192.168.56.100

The default username is admin, and the default password is admin as well.

Teardown

When you had enough testing, simply run

vagrant destroy -f

within the directory that contains the Vagrantfile.

What's in it?

On top of the already mentioned K3s cluster and a default installation of Argo CD with minor customisation (i.e. service of type LoadBalancer and an admin password set), the following is currently included after the box has been provisioned:

Versions

By default, the most recent stable versions of Argo CD and K3S will be installed in the box.

You can override (pin) the versions installed by the default variant by setting some environment variables before running vagrant up:

For example, if you want to install Argo CD v1.7.11 with accompanying CLI on a Kubernetes 1.18.6 cluster, create the box as follows:

ARGOCD_VERSION=v1.7.11 ARGOCD_CLI_VERSION=v1.7.11 K3S_VERSION=v1.18.6+k3s1 vagrant up

Git repository with test data

In order to have some test cases ready to use with the new Argo CD environment, you can have the script automatically setup a Git repository server which serves a configurable repository clone. It can be activated by setting the following environment variable before running vagrant up:

GIT_ENABLED=true

The following environment variables control what is set up:

Variants

Variants are certain pre-configured installations of Argo CD that argocd-nutshell can provision for you.

A variant is specified by launching your box with ARGOCD_VARIANT set to the name of the variant you want to launch.

Single-Sign-On with GitHub

The variant sso sets up Argo CD pre-configured to do SSO with a GitHub org. You will need to setup a GitHub oauth app for this, that needs to match the following configuration:

OAuth configuration

The client ID, client secret and GitHub org name must be passed to the Vagrant provisioner like follows:

DEX_CLIENT_ID=<client_id> \
  DEX_CLIENT_SECRET=<client_secret> \
  DEX_GH_ORG_NAME=<name of your GH org> \
  ARGOCD_VARIANT=sso vagrant up

Customization

You can provision custom boxes by doing the following:

And then hope it will work out.

Status

This has just been born, and is not ready for general consumption. Feel free to use it in the default configuration. Expect to hack on it. It has lots and lots of rough edges and pitfalls.

YMMV.