Skip to content

Latest commit

 

History

History
82 lines (68 loc) · 4.25 KB

03-argocd-setup.md

File metadata and controls

82 lines (68 loc) · 4.25 KB

Chapter 3 - Setup ArgoCD

Rationale

In this chapter, you will learn to:

  • Use Helm to provision Argo CD to your DOKS cluster.
  • Keep your Kubernetes cluster applications state synchronized with a Git repository, using GitOps principles.
  • Deploy and manage your application via Argo CD.

After finishing all the steps from this tutorial, you should have a DOKS cluster with Argo CD deployed.

Instructions

Step 1 - Install Argo CD

  1. Add the Argo CD Helm repository:

    helm repo add argo https://argoproj.github.io/argo-helm
    
    helm repo update argo 
  2. Inspect the Argo CD Helm values file.

    code argo/argo-values.yaml
  3. Deploy Argo CD to your DOKS cluster:

    HELM_CHART_VERSION="4.9.7"
    
    helm install argocd argo/argo-cd --version "${HELM_CHART_VERSION}" \
      --namespace argocd \
      --create-namespace \
      -f "argo/values.yaml"
  4. Check if the Helm release was successful:

    helm ls -n argocd
  5. The output looks similar to (STATUS column value should be set to deployed):

    NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
    argocd  argocd          1               2022-03-23 11:22:48.486199 +0200 EET    deployed        argo-cd-4.2.1   v2.3.1
    
  6. Verify Argo CD application deployment status:

    kubectl get deployments -n argocd

    The output looks similar to (check the READY column - all Pods must be running):

    NAME                               READY   UP-TO-DATE   AVAILABLE   AGE
    argocd-applicationset-controller   1/1     1            1           2m9s
    argocd-dex-server                  1/1     1            1           2m9s
    argocd-notifications-controller    1/1     1            1           2m9s
    argocd-redis-ha-haproxy            3/3     3            3           2m9s
    argocd-repo-server                 2/2     2            2           2m9s
    argocd-server                      2/2     2            2           2m9s
    

    Argo CD server must have a replicaset minimum value of 2 for the HA mode. If for some reason some deployments are not healthy, please check Kubernetes events and logs for the affected component Pods.

Step 2 - Access and Explore the Argo CD Web Interface

  1. Port forward the argocd-server Kubernetes service
    kubectl port-forward svc/argocd-server -n argocd 8080:443
  2. Open a web browser and navigate to localhost:8080 (please ignore the invalid TLS certificates for now). You will be greeted with the Argo CD log in page. The default administrator username is admin, and the password is generated randomly at installation time. You can fetch it by running below command:
    kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
  3. Next, you will be redirected to the applications dashboard page. From here you can view, create or manage applications via the UI (an YAML editor is also available), as well as perform sync or refresh operations:

Step 3 - Bootstrap an ArgoCD Application

On a fresh install, Argo CD doesn't know where to sync your applications from, or what Git repositories are available for sourcing application manifests. So, the first step is to perform a one time operation called bootstrapping. You can perform all the operations presented in this section by either using the argocd CLI, or the graphical user interface.

Step 4 - Update the image in the deployment, push to github and observe the ArgoCD reconciliation process

Learn More