ArgoCD

https://argo-cd.readthedocs.io/en/stable/getting_started/

Installation

Create a namespace and apply the installation manifest

Password

We have to now retrieve the initial password (wait for the previous command to finish, it usually takes about 30sec):

Port forward

Let's port-forward for now to see if the instance is up and runnin You should be able to see the ArgoCD UI under port 3000. You can use the initial password alongside admin username to login.

Ingress

An ingress manifest may look similar to the below. Keep in mind that in order for the below to work we have to have --enable-ssl-passthrough option enabled in the nginx-ingress Deployment manifest! Now we can apply that manifest and test if we can reach the domain. If all is fine, it's a good moment to change the initial password.

App placeholder / Namespace

It's basically a good idea to group projects somehow. That's why AppProject resource type may be useful. Otherwise all projects of ours will land onto the default group. The manifest may look like this:

GitOps concept

In order to achieve the Pull-based CI/CD we need at least two repositories:

  • GitOps repo - here we're going to be storing all the app manifests and update them (docker image tag for example) when we want to deploy a new version to cluster
  • Our APP_X repo - a regular repo holding the APP_X code alongside the pipeline workflow (github, buildkite, etc), Dockerfile, etc

Now we have to tell ArgoCD where is the GitOps repo so it can connect to it and listen to the changes. Therefor we have to generate a new ssh key pair: and:

  • add private one to ArgoCD - Settings-Repositories-Connect Repo:
    • ViaSSH
    • name:gitops
    • project:applications (Same as in AppProject manifest)
    • resitoryUrl:your-ssh-url / paste Private Key
    • paste Private Key
  • add public one to GitOps repo - Github.com-repo-settings-Deploy keys
    • Read-Only
    • Name: argocd
    • paste public key

Add an APP to ArgoCD

Once we have everything ready we can now add our App repo to ArgoCD so it can react on the changes. An example manifest is here.

            kubectl apply -f app1dev.yaml
          

TODO: MULTI CLUSTERS