DevOps

ArgoCD Helm Chart Install Applications

Kubernetes has become the de facto standard for managing containerized workloads in cloud-native environments and deploying cloud-native applications. However, navigating the complexities of deploying and managing Kubernetes applications can be overwhelming. Enter Argo CD and Helm, two powerful tools that transform the way developers handle Kubernetes applications. This comprehensive guide delves into Argo CD, a GitOps continuous delivery tool, and Helm, the renowned package manager for Kubernetes, to demonstrate how they simplify the deployment and management process. We’ll explore ArgoCD helm chart install and how to deploy an application.

What Is Argo CD?

Argo CD is a popular GitOps continuous delivery tool that simplifies the deployment process of cloud-native applications on Kubernetes. By leveraging Git as a single source of truth, Argo CD enables developers to harness GitOps principles to manage Kubernetes applications more effectively in their deployment strategy.

As a GitOps-based tool, Argo CD allows for easier management of pre-configured Kubernetes resources and custom resource definitions, making it a go-to choice for modern cloud-native enterprises.

What is Helm?

Helm is a widely-used package manager for Kubernetes that simplifies the process of deploying and managing applications within a Kubernetes cluster. Essentially, Helm allows developers to define, install, and upgrade even the most complex Kubernetes applications using a system of charts.

Helm charts are collections of pre-configured Kubernetes resources that represent a specific application or service. These charts act as templates that can be customized to suit various deployment scenarios, making it easier for developers to manage the deployment of cloud-native applications in a Kubernetes environment.

Helm consists of two main components: the Helm client and the Tiller server (for Helm v2) or Helm library (for Helm v3). The Helm client is responsible for managing charts and communicating with the Tiller server or Helm library, while the Tiller server or Helm library manages the deployment of charts within the Kubernetes cluster.

By utilizing Helm charts, developers can benefit from a more streamlined and consistent Kubernetes deployment process, with the ability to easily track application configurations, roll back to previous versions, update application configurations, and manage dependencies between various Kubernetes resources. This level of control and flexibility makes Helm an essential tool for deploying and managing Kubernetes applications effectively.

How to Install Helm

Helm is an essential tool for managing Kubernetes applications, and the helm install is a simple process. Follow these steps to install Helm on your system:

  1. Download the latest Helm release: Visit the Helm GitHub repository’s releases page and download the appropriate version for your operating system (Windows, macOS, or Linux).

  2. Extract the downloaded archive: Once the download is complete, extract the archive to retrieve the helm binary.

    • For macOS and Linux: Open a terminal and navigate to the directory containing the downloaded archive. Run the following command to extract the archive:

      tar -zxvf helm-v3.x.x-linux-amd64.tar.gz

      Replace 3.x.x with the downloaded version and linux-amd64 with the appropriate platform (e.g., darwin-amd64 for macOS).

    • For Windows: Use a file extraction tool like 7-Zip or WinRAR to extract the downloaded archive.

  3. Move the helm binary to your system’s PATH:

    • For macOS and Linux: Run the following command in the terminal to move the helm binary to /usr/local/bin, which should be in your system’s PATH:

      sudo mv linux-amd64/helm /usr/local/bin/helm

      Replace linux-amd64 with the appropriate platform if needed.

    • For Windows: Move the helm.exe binary to a directory in your system’s PATH, such as C:WindowsSystem32.

  4. Verify the installation: To confirm that Helm is installed correctly, open a new terminal window and run the following command:

    helm version

    This command should display the installed version of Helm.

Installing an NGINX Helm Chart

Let’s look at a simple example of deploying NGINX using a helm chart. Deploying an NGINX Helm chart is a straightforward process that enables you to set up a fully-functioning NGINX server within your Kubernetes cluster. Follow these steps to install the NGINX Helm chart and start leveraging its capabilities:

  1. Add the Bitnami Helm repository: Bitnami offers a wide range of Helm charts for popular applications, including NGINX. To add the Bitnami repository to your Helm client, run the following command:

    helm repo add bitnami https://charts.bitnami.com/bitnami
  2. Update your Helm repositories: To ensure that you have access to the latest versions of available charts, update your Helm repositories with the following command:

    helm repo update
  3. Install the NGINX Helm chart: With the Bitnami repository added and updated, you can now proceed to install the NGINX Helm chart. Run the following command, replacing <release-name> with a name for your Helm release:

    helm install <release-name> bitnami/nginx

    This command will deploy the NGINX server in your Kubernetes cluster using the default configuration provided by the Bitnami NGINX Helm chart.

  4. Verify the deployment: To confirm that the NGINX server is up and running, use the kubectl command to check the status of the created resources. First, list the deployed pods with the following command:

    kubectl get pods

    Next, check the details of the created service by running:

    kubectl get svc

    This command will display information about the NGINX service, including the cluster IP address and exposed ports.

Using Helm Charts with GitOps

Helm charts are a widely-used package manager for Kubernetes applications, providing a simple and efficient way to deploy and manage Kubernetes applications. Helm charts offer a collection of pre-configured Kubernetes resources and allow developers to define, install, and upgrade even more complex deployments.

As a GitOps continuous delivery tool, Argo CD works seamlessly with Helm charts, enabling users to deploy Helm charts easily and automatically. This integration ensures a smooth Kubernetes deployment process and streamlines the management of application configurations throughout multiple environments.

How is ArgoCD Used to Deploy Helm Charts?

Argo CD employs the native GitOps functionality of Helm charts (helm template) to deploy cloud-native applications within a Kubernetes cluster. By using Argo CD to manage Helm charts, developers can establish a consistent deployment process while also maintaining the benefits of Helm’s package manager capabilities.

The Argo CD application controller continuously monitors the Git repository and the target environment to ensure that the actual and desired state of the application always match. When discrepancies are detected, Argo CD initiates sync operations defined by the Helm chart to return the target environment to the desired state.

How do you install ArgoCD?

Installing Argo CD involves several steps. First, ensure that you have the necessary prerequisites, such as a Kubernetes cluster and the kubectl command-line tool. Next, use the following command to install Argo CD:

kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

This command installs the necessary Argo CD components, such as the Argo CD server, the application controller, and the repository server.

Installing ArgoCD using Kubeapps

You can also use an application like Kubeapps to install ArgoCD from the catalog.

All of the pods are now running. Note the following installation notes:

CHART NAME: argo-cd
CHART VERSION: 4.6.3
APP VERSION: 2.6.7

** Please be patient while the chart is being deployed **

Access your Argo CD installation:
Execute the following commands:
kubectl port-forward --namespace default svc/argo-cd-server 8080:80 &
export URL=http://127.0.0.1:8080/
echo "Argo CD URL: http://127.0.0.1:8080/"

Execute the following commands to obtain the Argo CD credentials:
echo "Username: "admin""
echo "Password: $(kubectl -n default get secret argocd-secret -o jsonpath="{.data.clearPassword}" | base64 -d)"

Ingress or LoadBalancer

If you are using an ingress controller like NGINX or Traefik, you can setup your ingress routes accordingly to access ArgoCD which doesn’t expose external addresses by default as it is setup for ClusterIP.

However, you can also easily change the service to LoadBalancer by patching the service like so. Be sure to replace your namespace and loadBalancerIP with the correct values.

kubectl patch service argocd-argo-cd-server -n mynamespace --patch '{ "spec": { "type": "LoadBalancer", "loadBalancerIP": "172.16.5.207" } }'

Create an Application in Argo CD Defined By a Helm Chart

To create an application in Argo CD using a Helm chart, follow these steps:

  1. Access the Argo CD UI and log in using the provided credentials.

  2. Click the “New App” button.

3. Provide the necessary information for your application, such as the application name, project, and target namespace.

4. Under the “Source” section, select “Helm” as the chart type and provide the Helm repository URL containing the desired chart.

5. Configure the required Helm values and repository credentials, if necessary.

6. Click “Create” to create the application.

Application Deployment with ArgoCD

Once the Argo CD application is created, it will automatically deploy the defined Helm chart within the Kubernetes cluster. Argo CD’s application controller ensures that the desired state of the application matches the actual state within the target environment by continuously monitoring and initiating sync operations as needed.

During the deployment process, Argo CD provides real-time feedback on the progress and status of the application through its user interface. This feedback includes information about the healthy and synced status of the application, as well as any potential issues or discrepancies detected during the deployment process.

Synchronizing Changes from Original Repository

When deploying Helm charts using Argo CD, the GitOps agent performs synchronization between the Git repository and the Kubernetes cluster. This process ensures that the desired state of the application, as defined by the Helm chart in the Git repository, is always maintained within the Kubernetes cluster.

Argo CD’s synchronization process can be triggered manually or automatically. Manual synchronization allows for precise control over when changes are applied to the target environment, while automatic synchronization ensures that changes are applied as soon as they are detected.

Application Management with ArgoCD

Argo CD provides a comprehensive suite of tools for managing deployed applications, including features for tracking application configurations, managing Helm release versions, and rolling back to previous versions if necessary. The Argo CD UI offers a convenient way to visualize and interact with the deployed applications and their associated Kubernetes resources, streamlining the management of complex Kubernetes deployments.

Using the Argo CD UI, developers can easily monitor the status of deployed applications, update Helm values, and initiate manual sync operations to ensure that the actual and desired state of the application remains consistent within the target environment.

Learn More About GitOps and ArgoCD Helm chart Deployment

GitOps and Helm chart deployment has become increasingly popular as organizations adopt cloud-native technologies and Kubernetes-based workflows. By combining the power of GitOps principles with the versatility of Helm charts, developers can achieve more robust and efficient management of Kubernetes applications.

For those interested in learning more about GitOps and Helm chart deployment, various resources and tutorials are available online. These resources can help developers understand the underlying concepts and best practices for deploying Helm charts with GitOps tools like Argo CD.

Monitoring and Maintaining Helm Releases with Argo CD

Argo CD provides an intuitive interface for monitoring Helm releases and ensuring that deployed applications maintain the expected configuration. By using Argo CD, developers can easily view the current status of Helm release deployments, including information about the Helm release name, version, and associated Kubernetes resources.

In addition to monitoring, Argo CD also helps in maintaining Helm releases by enabling developers to update Helm values, rollback to previous Helm releases, and manage repository credentials. These features allow for more effective control over the application lifecycle and make addressing issues that may arise during deployment easier.

Managing Multiple Environments with Argo CD

Argo CD’s support for multiple environments allows developers to manage and deploy applications across various stages of the development process. By configuring Argo CD applications to target specific namespaces or clusters, developers can easily deploy Helm charts to different environments, such as development, staging, and production.

This flexibility makes it possible to manage complex deployments and ensure that application configurations remain consistent across multiple environments. Additionally, Argo CD’s native GitOps functionality helps maintain the desired state in each environment by automatically syncing changes from the Git repository to the target environment.

Advanced Deployment Strategies with ArgoCD Helm chart

Argo CD supports advanced deployment strategies for Helm charts, such as Canary, Blue/Green, and Rolling updates. These strategies allow for more sophisticated and controlled application deployments, minimizing the risk of downtime and ensuring that new application versions are gradually rolled out to users.

By combining the power of Argo CD and Helm, developers can easily implement these advanced deployment strategies, ensuring that their cloud-native applications are always highly available and resilient to failures.

FAQs: ArgoCD Helm chart for Kubernetes Application Deployment

Q1: What is the difference between Argo CD and Helm?

A1: Argo CD is a GitOps continuous delivery tool that automates the deployment and management of Kubernetes applications. It tracks application configurations in a Git repository, ensuring that the desired state in the repository matches the actual state in the cluster. Helm, on the other hand, is a package manager for Kubernetes that simplifies the deployment and management of Kubernetes applications using a system of charts (templates).

Q2: How do ArgoCD Helm chart work together?

A2: Argo CD can utilize Helm charts to define and deploy applications within a Kubernetes cluster. By combining the GitOps methodology of Argo CD with the templating capabilities of Helm charts, you can easily manage and deploy Kubernetes applications across multiple environments.

Q3: How do I roll back a deployment in Argo CD?

A3: To roll back a deployment in Argo CD, navigate to the Argo CD UI, select the application you want to roll back, and click the “History” tab. From there, you can choose a previous version of the application configuration and click “Sync” to roll back to that version.

Q4: Can I use Argo CD with other Git repositories besides GitHub?

A4: Yes, Argo CD supports various Git repositories, including GitHub, GitLab, Bitbucket, and others. As long as your Git repository is accessible from your Argo CD instance, you can use it to manage your Kubernetes applications.

Q5: Can I deploy multiple Helm charts within a single Argo CD application?

A5: Yes, you can deploy multiple Helm charts within a single Argo CD application by creating a parent chart that includes the desired Helm charts as dependencies. This approach allows you to manage multiple Helm charts and their configurations within a single Argo CD application, streamlining the deployment process.

Q6: How do I update my Helm chart in Argo CD?

A6: To update your Helm chart in Argo CD, make the necessary changes to your chart in your Git repository and commit the changes. Argo CD will automatically detect the changes and update the application in your Kubernetes cluster to match the new desired state defined by the updated Helm chart.

Wrapping up

Argo CD is an excellent tool for deploying and managing Kubernetes applications ArgoCD Helm chart and GitOps principles. Argo CD enables developers to tackle the daunting task of deploying and managing complex Kubernetes applications easily and confidently by providing a streamlined deployment process, real-time feedback, and robust application management features.

Subscribe to VirtualizationHowto via Email 🔔

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com and has over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, Brandon has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.