Implementing Multi-Tier Application by Using ArgoCD

How can we help?
< All Topics
Print

Implementing Multi-Tier Application by Using ArgoCD

Brief Definition

ArgoCD is a tool that enables development teams to implement changes to applications in a Kubernetes cluster. This is done by utilizing a Git repository as the primary source to define and maintain the desired state of the application.

In this tutorial, we will discuss how to deploy a Multi-Tier application using ArgoCD.

Environment Setup

  • Create a Kubernetes cluster. This step will utilize a Kubernetes cluster created using RKE (Rancher Kubernetes Engine). Please refer to the following article to prepare your Kubernetes cluster.
  • You can install kubectl to interacting with related cluster..
  • Install ArgoCD by using or Manifest file.
    • kubectl create namespace argocd
    • kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
    • Config ArgoCD to public expose using Ingress
    • Example:

      apiVersion: networking.k8s.io/v1
      kind: Ingress
      metadata:
          nginx.ingress.kubernetes.io/backend-protocol: HTTPS
          nginx.ingress.kubernetes.io/ssl-passthrough: 'true'
        name: argocd.ahmadcloud.my.id
        namespace: argocd
        resourceVersion: '6106299'
      spec:
        ingressClassName: nginx
        rules:
          - host: argocd.ahmadcloud.my.id
            http:
              paths:
                - backend:
                    service:
                      name: argocd-server
                      port:
                        number: 443
                  path: /
                  pathType: Prefix
        tls:
          - hosts:
              - argocd.ahmadcloud.my.id
            secretName: star.ahmadcloud.my.id
      

Application and Project Definition

  • Create ArgoCD project for multi-tier application
  • Specify the Git repository for each component (frontend, backend, and database)..
  • Configure access to Git repositories within ArgoCD. If you are using a private repository that requires access, please perform this configuration through the web UI.

Application Manifest Creation

  • Please obtain an example manifest file from the following repository: https://gitlab.com/ahmadnromiz/learn-argocd. In the manifest/overlay path, there are costumization files used for declarative custom workloads before deploying to the Kubernetes cluster.
  • The example of the base manifest file
  • The example of the overlay manifest file