How to deploy Helm chart on Google Kubernetes Engine (GKE) using ArgoCD?

How to deploy Helm chart on Google Kubernetes Engine (GKE) using ArgoCD?

ArgoProj is a collection of tools for getting work done with Kubernetes. Argo Workflows - Container-native Workflow Engine. Argo CD - Declarative GitOps Continuous Delivery. Argo Events - Event-based Dependency Manager. Argo Rollouts - Progressive Delivery with support for Canary and Blue-Green deployment strategies. Reference: https://landscape.cncf.io/?selected=argo

Google Kubernetes Engine (GKE) is a managed, production-ready environment for running containerized applications on Kubernetes. Reference: https://cloud.google.com/kubernetes-engine

Helm is the best way to find, share, and use software built for Kubernetes. Helm deploys packaged applications to Kubernetes and structures them into charts. The charts contain all pre-configured application resources along with all the versions into one easily manageable package. Helm streamlines installing, upgrading, fetching dependencies, and configuring deployments on Kubernetes with simple CLI commands. Software packages are found in repositories or are created. Reference: https://landscape.cncf.io/?selected=helm

Prerequisite

Step

  1. Create Helm chat on the git repo. Reference: https://github.com/manikandank276/blog/tree/main/argoproject-101/app

     apiVersion: argoproj.io/v1alpha1
     kind: Application
     metadata:
       name: app1-apache
       namespace: argocd
     spec:
       destination:
         name: ''
         namespace: namespace2
         server: 'https://kubernetes.default.svc'
       source:
         path: ''
         repoURL: 'https://charts.bitnami.com/bitnami'
         targetRevision: 9.6.3
         chart: apache
       sources: []
       project: default
    
  2. Review the GKE cluster.

     kubectl get node
     kubectl get namespaces
     kubectl get pods --namespace <type namespace name>
    
  3. Login to ArgoCD.

  4. Click on the "+ NEW APP" button.

  5. Fill "GENERAL" form.

    • Application Name: app (or type your preference)

    • Project Name: default

    • SYNC POLICY: Manual

  6. Fill "SOURCE" form.

    • Repository URL: https://github.com/manikandank276/blog (or type your preference)

    • select GIT dropdown

    • Revision: HEAD

    • Select Branches dropdown

    • Path: argoproject-101/app (or type your preference)

  7. Fill "DESTINATION" form.

  8. Click on the "CREATE" button.

  9. The new application creates successfully.

  10. Click on the "app" argoCD application name with "OutOfSync".

  11. The application shows details of the application configuration.

  12. Click on the "SYNC" button.

  13. Review the form and click on the "SYNCHRONIZE" button.

  14. The "app" changes to "Synced".

  15. The new "app1-apache" & "app2-wordpress" Helm (icon) applications create with "OutOfSync".

  16. Click on the "app1-apache" & "app2-wordpress" name with "OutOfSync" and Click on the "SYNC" button.

  17. The applicaitons changes to "Synced".

  18. Review the GKE cluster.

    kubectl get node
    kubectl get namespaces
    kubectl get pods --namespace namespace2
    kubectl get pods --namespace namespace3
    #New Helm application pods listed
    
  19. Find the load-balancing IP of Helm applications.

    kubectl get pods --namespace namespace2
    kubectl get pods --namespace namespace3
    # Note the external IP
    
  20. Open the external IP of load balancing in the new browser tab to see the application.

  21. Sync "app" argoCD application if required.

  22. Add or Modify configuration in the git repo.

  23. The change reflects in ArgoCD and shows as "OutOfSync". Click on the "SYNC" button to deploy changes in the GKE.

Helm chart deployed using ArgoCD successfully. The output looks like the one below.