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
Google Cloud project.
ArgoCD deployed on Google Kubernetes Engine (GKE). Reference: https://manikandank276.hashnode.dev/how-to-deploy-argocd-on-google-kubernetes-engine-gke
Step
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
Review the GKE cluster.
kubectl get node kubectl get namespaces kubectl get pods --namespace <type namespace name>
Login to ArgoCD.
Click on the "+ NEW APP" button.
Fill "GENERAL" form.
Application Name: app (or type your preference)
Project Name: default
SYNC POLICY: Manual
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)
Fill "DESTINATION" form.
Cluster URL: https://kubernetes.default.svc
namespace: argocd (or type your preference)
Click on the "CREATE" button.
The new application creates successfully.
Click on the "app" argoCD application name with "OutOfSync".
The application shows details of the application configuration.
Click on the "SYNC" button.
Review the form and click on the "SYNCHRONIZE" button.
The "app" changes to "Synced".
The new "app1-apache" & "app2-wordpress" Helm (icon) applications create with "OutOfSync".
Click on the "app1-apache" & "app2-wordpress" name with "OutOfSync" and Click on the "SYNC" button.
The applicaitons changes to "Synced".
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
Find the load-balancing IP of Helm applications.
kubectl get pods --namespace namespace2 kubectl get pods --namespace namespace3 # Note the external IP
Open the external IP of load balancing in the new browser tab to see the application.
Sync "app" argoCD application if required.
Add or Modify configuration in the git repo.
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.