{"id":584,"date":"2024-04-19T07:48:16","date_gmt":"2024-04-19T07:48:16","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=584"},"modified":"2024-04-19T07:48:16","modified_gmt":"2024-04-19T07:48:16","slug":"how-to-deploy-helm-charts-using-argo-cd","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=584","title":{"rendered":"How to Deploy Helm Charts Using Argo CD"},"content":{"rendered":"<p>In this blog, we are going to learn how to deploy Helm Charts using Argo CD.<\/p>\n<p>Helm charts are templates that can be used again and again just by changing the values on the <strong>values.yaml<\/strong> file according to your requirements.<\/p>\n<p>In this guide, we will look at how helm charts can be used with ArgoCD to deploy single and multiple environments.<\/p>\n<h2 id=\"setup-workflow\">Setup Workflow<\/h2>\n<p>A simple diagrammatic overview of this setup is given below<\/p>\n<figure class=\"kg-card kg-image-card kg-card-hascaption\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/argocd-helm-deployment-1-1.gif\" class=\"kg-image\" alt=\"Deploy Helm Charts Using Argo CD setup workflow\" loading=\"lazy\" width=\"800\" height=\"1040\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/argocd-helm-deployment-1-1.gif 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/argocd-helm-deployment-1-1.gif 800w\" sizes=\"auto, (min-width: 720px) 720px\"><figcaption><span style=\"white-space: pre-wrap;\">Click to View in HD<\/span><\/figcaption><\/figure>\n<h2 id=\"setup-prerequisites\">Setup Prerequisites<\/h2>\n<p>The following are the prerequisites for this setup.<\/p>\n<ol>\n<li><a href=\"https:\/\/devopscube.com\/setup-kubernetes-cluster-kubeadm\/\">Kubernetes Cluster<\/a><\/li>\n<li>Kubectl<\/li>\n<li><a href=\"https:\/\/devopscube.com\/setup-argo-cd-using-helm\/\">Argo CD<\/a> installed in your cluster<\/li>\n<li><a href=\"https:\/\/devopscube.com\/install-configure-helm-kubernetes\/\" rel=\"noreferrer noopener\">Helm installed<\/a> in your system<\/li>\n<\/ol>\n<h2 id=\"helm-chart-repository\">Helm Chart Repository<\/h2>\n<p>You can use the below repository as an example or you can your own helm repository.<\/p>\n<p>Clone the repository to your workstation.<\/p>\n<pre><code>git clone https:\/\/github.com\/kubernetes-learning-projects\/helm-chart.git<\/code><\/pre>\n<p>For this demo, we will use the<strong> java-app<\/strong> helm chart that is part of this repository.<\/p>\n<p>Once the repository is cloned, cd in to the<strong> java-app<\/strong> folder using the following command<\/p>\n<pre><code>cd java-app<\/code><\/pre>\n<p>You can see the following directory structure.<\/p>\n<pre><code>.\n\u251c\u2500\u2500 Chart.yaml\n\u251c\u2500\u2500 templates\n\u2502   \u251c\u2500\u2500 configmap.yaml\n\u2502   \u251c\u2500\u2500 deployment.yaml\n\u2502   \u2514\u2500\u2500 service.yaml\n\u2514\u2500\u2500 values.yaml<\/code><\/pre>\n<p>The <strong><code>Chart.yam<\/code>l<\/strong> file contains the name, description, type, and version of the helm chart.<\/p>\n<p>Inside the <strong><code>templates<\/code><\/strong> folder that contains the YAMl template of the application which gets values from the <strong><code>values.yaml<\/code><\/strong> file.<\/p>\n<p>The <strong><code>values.yaml<\/code><\/strong> file contains values that will be substituted into the YAML templates inside the <strong>templates<\/strong> folder during deployment.<\/p>\n<p>To get a detailed understanding of Helm Charts, visit the <a href=\"https:\/\/devopscube.com\/create-helm-chart\/\">creating helm chart<\/a> detailed blog.<\/p>\n<h2 id=\"deploy-helm-charts-using-argo-cd\">Deploy Helm Charts using Argo CD<\/h2>\n<p>For the purpose of demonstration, we will assume, we have two <strong>environments named dev and prod.<\/strong><\/p>\n<p>First, we will be deploying the <strong>helm chart in a single environment<\/strong> dev and then will be deploying the helm chart on<strong> two environments dev and prod<\/strong>.<\/p>\n<p>Lets get started with the setup.<\/p>\n<h3 id=\"deploy-helm-chart-in-a-single-environment\">Deploy Helm Chart in a Single Environment:<\/h3>\n<p>First, let&#8217;s see how to deploy a helm chart in a single environment using Argo CD.<\/p>\n<p>This is a basic helm deployment with just a single <strong><code>values.yaml<\/code><\/strong> file.<\/p>\n<p>Now, login to your Argo CD UI and press the add <strong>NEW APP<\/strong> button to configure the GitHub repository which has the helm chart.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-111-9.png\" class=\"kg-image\" alt=\"press the add NEW APP button to start the configuration\" loading=\"lazy\" width=\"835\" height=\"469\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-111-9.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-111-9.png 835w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>A new page will appear to give the configuration for your application, specify the <strong>Application <\/strong>Name, give the <strong>Project Name<\/strong>, and select the <strong>SYNC POLICY <\/strong>as shown below<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-119-10.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"1246\" height=\"659\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-119-10.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-119-10.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-119-10.png 1246w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>In the above image, you can see the <strong>AUTO-CREATE NAMESPACE<\/strong> sync option is selected, so you don&#8217;t have to create a namespace manually Argo CD will create the namespace if not present.<\/p>\n<p>Then, add the URL of your Git repository, and the path of the helm chart. In our case its <strong>java-app<\/strong> folder.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-32-20.png\" class=\"kg-image\" alt=\"Selecting the source for adding a new app\" loading=\"lazy\" width=\"1568\" height=\"786\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-32-20.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-32-20.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-32-20.png 1568w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Then, select you&#8217;re destination cluster URL and the namespace where you want to deploy the helm chart.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/2024-02-08_16-19-18-1.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"1332\" height=\"504\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/2024-02-08_16-19-18-1.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/2024-02-08_16-19-18-1.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/2024-02-08_16-19-18-1.png 1332w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>As you can see I am selecting the default cluster which is the cluster my Argo CD is running on, if you have multiple clusters configured to Argo CD select the cluster URL where you want to deploy.<\/p>\n<p>And we are deploying the application on the <strong>pet-clinic-app<\/strong> namespace, the namespace you specify will be created by Argo CD is not present because of the <strong>AUTO-CREATE NAMESPACE<\/strong> sync option selected.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-33-16.png\" class=\"kg-image\" alt=\"Helm chart with argocd: Selecing the destination for addinf new app\" loading=\"lazy\" width=\"1332\" height=\"600\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-33-16.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-33-16.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-33-16.png 1332w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Below that, you can see Argo CD automatically detects the files in the Github repository as helm chart and will show you the values of the <strong>values.yaml<\/strong> file as shown below<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/2024-02-07_14-52-11-1.png\" class=\"kg-image\" alt=\"Helm chart with argocd: helm values alteration before deploying a new app\" loading=\"lazy\" width=\"784\" height=\"558\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/2024-02-07_14-52-11-1.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/2024-02-07_14-52-11-1.png 784w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>You can alter the values as per your requirements, and if the chart type is not detected automatically you can select the type as shown below<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-34-10.png\" class=\"kg-image\" alt=\"Helm chart with argocd: selecing configuration type helm\" loading=\"lazy\" width=\"692\" height=\"460\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-34-10.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-34-10.png 692w\"><\/figure>\n<p>Then, press the Create button at the top of the configuration, then it will deploy the YAML file and create a dashboard for it as shown below<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/2024-02-07_14-53-25-1.png\" class=\"kg-image\" alt=\"Helm chart with argocd: application dashboard\" loading=\"lazy\" width=\"1102\" height=\"655\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/2024-02-07_14-53-25-1.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/2024-02-07_14-53-25-1.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/2024-02-07_14-53-25-1.png 1102w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>As you can see ArgoCD gives every information about the deployment on the dashboard.<\/p>\n<h3 id=\"deploy-helm-chart-on-multiple-environment\">Deploy Helm Chart on Multiple Environment<\/h3>\n<p>To do this you have to create two value files as shown below<\/p>\n<pre><code>.\n\u251c\u2500\u2500 Chart.yaml\n\u251c\u2500\u2500 templates\n\u2502   \u251c\u2500\u2500 configmap.yaml\n\u2502   \u251c\u2500\u2500 deployment.yaml\n\u2502   \u2514\u2500\u2500 service.yaml\n\u251c\u2500\u2500 values-dev.yaml\n\u2514\u2500\u2500 values-prod.yaml<\/code><\/pre>\n<p>One of the differences in both methods is, that while using a single values file the values will be shown on the UI and you can alter the values from the UI.<\/p>\n<p>But with multiple values files, you cannot change the values from the UI, you can only select the values file you want to use as shown below.<\/p>\n<p>For this method, you have to create <strong>NEW APP<\/strong> two times, do the same steps you did in the above single environment method until the helm <strong>values.yaml<\/strong> file selecting step.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-121-7.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"512\" height=\"284\"><\/figure>\n<p>Do the same steps again and select the next values file<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-35-14.png\" class=\"kg-image\" alt=\"Helm chart with argocd: selecting values file for multiple environment\" loading=\"lazy\" width=\"1046\" height=\"574\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-35-14.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-35-14.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-35-14.png 1046w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>If you want to change the values, you have to modify the values file from your local workspace and push it to Git.<\/p>\n<p>After deploying the helm chart on two environments you can see your application on the dashboard as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-36-11.png\" class=\"kg-image\" alt=\"Helm chart with argocd: Deployed apps on mutiple environment\" loading=\"lazy\" width=\"784\" height=\"528\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-36-11.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-36-11.png 784w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>I have deployed both applications on the same cluster, if you want to deploy both applications on different clusters you can change the cluster URL in the destination section.<\/p>\n<p>You may ask, why we have to create multiple value files for multiple environments and why can&#8217;t we use a single value file and change the values while deploying the helm.<\/p>\n<p>We can do that also, but it is only suitable for basic applications with a minimum number of values, it is not possible for large organizations that have an application with different deployment requirements per environment.<\/p>\n<p>They can&#8217;t change the values every time they deploy, so they keep fixed values for each environment and change the values on each value file if needed.<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>In summary, you learn about integrating Helm on Argo CD and also about deploying applications on both single and multiple environments with values files.<\/p>\n<p>I hope you find this blog useful and easy to understand about Argo CD helm integration.<\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/how-to-deploy-helm-charts-using-argo-cd\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Deploy Helm Charts Using Argo CD \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/how-to-deploy-helm-charts-using-argo-cd\/<\/p>\n","protected":false},"author":1,"featured_media":585,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-584","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=584"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/585"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}