ArgoCD Setup

Before we get started with GitOps, we need to install ArgoCD on our Kubernetes cluster and also download the ArgoCD CLI.

For this exercise we will use simple Kubernetes manifests for the ArgoCD installation. In a real cluster you would use a Helm chart, or Argo CD autopilot which allows you to manage Argo CD with itself!

Please note: Chrome users, please do not use Incognito mode while working through this certification. Also, please make sure third-party cookies are not blocked, as certain features may not work. You can manage this in your browser settings, or using the “eye” icon in the address bar.

Deploy Argo CD to Kubernetes

Use the terminal to deploy Argo CD:

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/codefresh-contrib/gitops-certification-examples/main/argocd-noauth/install.yaml

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

To view the deployment enter

kubectl get pods -n argocd

Note that this is simple installation method without any authentication. In a real setting you would probably setup SSO with your ArgoCD instance.

Expose the Argo CD UI

By default, Argo CD is only accessible from within the cluster. To expose the UI to users you can utilize any of the standard Kubernetes networking mechanisms such as

  • Ingress (recommended for production)

  • Load balancer (affects cloud cost)

  • NodePort (simple but not very flexible)

For this exercise we will do the simplest way and use a Nodeport service. In a production environment you should use an Ingress.

Feel free to look at the file service.yml in the Editor tab. It is a standard NodePort service resource.

Use the terminal to create it in the cluster:

After the service is created, check the "Argo CD UI" tab to access the Argo CD Web interface.

Log in the Argo CD UI

Argo CD has a flexible user model that also supports SSO with popular identify providers. For this simple example we will use the default admin account.

Argo CD initially has an admin user with an autogenerated password. You can get the admin password from the default Configmap

Just to make things simple we have disabled authentication in the ArgoCD UI.

Simply use the "ArgoCD UI" tab to look at the interface Everything is empty right now.

Argo CD CLI

Apart from the Graphical User interface, Argo CD also comes with a Command Line Interface (CLI) that can be used for common operations.

The CLI is great for administration work, while the GUI is best for inspecting applications and settings.

Step 1

To install the CLI

Step 2

Test that the CLI works by typing

Login with the CLI

Before we can use your CLI we need to authentication against our own Argo CD instace.

In a production environment you might have different authentication options and also change the default admin password (or remove the admin account completely).

Step 1

To authenticate

to view the minikube ip use the below command.

replace localhost with the Kubernetes Master Node IP Address,

We use the insecure option because Argo CD has a self-signed certificate. In a production installation you would have a real certificate and this option should not be used.

Log in as admin and use the password stored in admin-pass.txt. You can see the value from the editor tab.

Notice that for security reasons the password you paste is not shown in the terminal (not even with asterisks). Just paste the password value and press Enter.

Step 2

Run some example commands

Last updated