<p>The question seems posed subjectively, and will hence be difficult to answer well, but here goes.</p>
<p>Perhaps what is referred to here by using Terraform via the <a href="https://registry.terraform.io/providers/hashicorp/kubernetes" rel="nofollow noreferrer">k8s</a> and/or <a href="https://registry.terraform.io/providers/hashicorp/helm" rel="nofollow noreferrer">helm</a> providers to provision the state</p>
<blockquote>
<p>&quot;Terraform is not a configuration management tool&quot;</p>
</blockquote>
<p>This means that it is a way to achieve a desired state via a given provider. The article you mention does exactly this, using the k8s provider to provision the state of the argocd cluster.</p>
<p>When would this be a &quot;best&quot; way? When you want to have the <em>entire</em> state of the system declared in a single place.</p>
<ul>
<li>If you are responsible for <em>only</em> ArgoCD, there would be no &quot;best&quot; way, since the <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/" rel="nofollow noreferrer">documentation itself</a> provides a guide for using either Kustomize or Helm.</li>
<li>If, however, you are responsible for other components, including the infrastructure that ArgoCD requires (network, cluster, security groups, etc), then you would benefit from using Terraform to provision <em>everything</em></li>
</ul>
<p>Consider the alternative: each part of the system would use its own configuration and provisioning tool meaning lots of context-switching and the need to learn more than one configuration language.</p>
<p>The answer therefore is: The best way to install ArgoCD, or <strong>anything at all</strong> is to first determine the boundaries of the system, then attempt to minimise the tooling necessary to achieve the desired state of that bounded system.</p>

CC BY-SA 4.0
2022-12-20T10:15:32.297Z
2022-12-20T10:15:32.297Z
Bruce Becker
<p>It seems that <a href="https://kustomize.io/" rel="nofollow noreferrer">Kustomize</a> is the way to go.</p>
<p>That is what they use for most of the official Argo CD repositories (e.g., <a href="https://github.com/argoproj/argo-cd/tree/master/manifests" rel="nofollow noreferrer">argoproj/argo-cd</a>, <a href="https://github.com/argoproj/argoproj-deployments/tree/master/argocd" rel="nofollow noreferrer">argoproj/argoproj-deployments</a> and <a href="https://github.com/argoproj-labs/argocd-extensions" rel="nofollow noreferrer">argoproj-labs/argocd-extensions</a>).</p>
<p>Note that the they do also have <a href="https://github.com/argoproj/argo-helm" rel="nofollow noreferrer">a Helm chart</a>, which is a perfectly fine way to <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/#helm" rel="nofollow noreferrer">install it</a> too.</p>
<p>For the purposes of configuring Argo CD as code, please also have a look at <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/" rel="nofollow noreferrer">Declarative Setup</a>.</p>

CC BY-SA 4.0
2023-07-21T06:03:21.947Z
2023-07-21T06:03:21.947Z
lindhe
<p>Working on getting a full deployment pipeline set up using GitOps and Everything as Code. I, therefore, need to be able to spin everything up and down with a single click (or pretty close to it!). My target is to Terraform a Kubernetes cluster in EKS, then have Argo CD pull containers from docker hub.</p>
<p>In the article &quot;<a href="https://betterprogramming.pub/how-to-set-up-argo-cd-with-terraform-to-implement-pure-gitops-d5a1d797926a" rel="nofollow noreferrer">How To Set Up Argo CD With Terraform To Implement Pure GitOps</a>&quot;, the author advocates using Terraform to install Argo CD.</p>
<p>I have always tried to <em>avoid</em> using Terraform for configuration management. In the <a href="https://developer.hashicorp.com/terraform/intro/vs/chef-puppet#:%7E:text=Terraform%20is%20not%20a%20configuration%20management%20tool" rel="nofollow noreferrer">Terraform documentation</a>, Hashicorp note that</p>
<blockquote>
<p>Terraform is not a configuration management tool</p>
</blockquote>
<p>Is Terraform the best-practice way to perform this action, or is there a better method?</p>

CC BY-SA 4.0
2022-12-18T20:56:05.490Z
Is [Kustomize](https://argo-cd.readthedocs.io/en/stable/user-guide/kustomize/) a better solution?
James Geddes
<kubernetes><amazon-web-services><terraform><continuous-deployment><cicd>
What is the best way to install ArgoCD as code?
James Geddes
# What is the best way to install ArgoCD as code?

(Asked by: username_0 on 2022-12-18)

Working on getting a full deployment pipeline set up using GitOps and Everything as Code. I, therefore, need to be able to spin everything up and down with a single click (or pretty close to it!). My target is to Terraform a Kubernetes cluster in EKS, then have Argo CD pull containers from docker hub.

In the article "[How To Set Up Argo CD With Terraform To Implement Pure GitOps](https://betterprogramming.pub/how-to-set-up-argo-cd-with-terraform-to-implement-pure-gitops-d5a1d797926a)", the author advocates using Terraform to install Argo CD.

I have always tried to *avoid* using Terraform for configuration management. In the [Terraform documentation](https://developer.hashicorp.com/terraform/intro/vs/chef-puppet#:%7E:text=Terraform%20is%20not%20a%20configuration%20management%20tool), Hashicorp note that

> Terraform is not a configuration management tool

Is Terraform the best-practice way to perform this action, or is there a better method?

**Tags:** kubernetes, amazon-web-services, terraform, continuous-deployment, cicd

> **Comments:**
> **username_0**: Is [Kustomize](https://argo-cd.readthedocs.io/en/stable/user-guide/kustomize/) a better solution?  

---

## 2 answers

### Answer by username_1 on 2022-12-20. Score: 2

The question seems posed subjectively, and will hence be difficult to answer well, but here goes.

Perhaps what is referred to here by using Terraform via the [k8s](https://registry.terraform.io/providers/hashicorp/kubernetes) and/or [helm](https://registry.terraform.io/providers/hashicorp/helm) providers to provision the state

> "Terraform is not a configuration management tool"

This means that it is a way to achieve a desired state via a given provider. The article you mention does exactly this, using the k8s provider to provision the state of the argocd cluster.

When would this be a "best" way? When you want to have the *entire* state of the system declared in a single place.

* If you are responsible for *only* ArgoCD, there would be no "best" way, since the [documentation itself](https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/) provides a guide for using either Kustomize or Helm.
* If, however, you are responsible for other components, including the infrastructure that ArgoCD requires (network, cluster, security groups, etc), then you would benefit from using Terraform to provision *everything*

Consider the alternative: each part of the system would use its own configuration and provisioning tool meaning lots of context-switching and the need to learn more than one configuration language.

The answer therefore is: The best way to install ArgoCD, or **anything at all** is to first determine the boundaries of the system, then attempt to minimise the tooling necessary to achieve the desired state of that bounded system.


---

### Answer by username_2 on 2023-07-21. Score: 1

It seems that [Kustomize](https://kustomize.io/) is the way to go.

That is what they use for most of the official Argo CD repositories (e.g., [argoproj/argo-cd](https://github.com/argoproj/argo-cd/tree/master/manifests), [argoproj/argoproj-deployments](https://github.com/argoproj/argoproj-deployments/tree/master/argocd) and [argoproj-labs/argocd-extensions](https://github.com/argoproj-labs/argocd-extensions)).

Note that the they do also have [a Helm chart](https://github.com/argoproj/argo-helm), which is a perfectly fine way to [install it](https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/#helm) too.

For the purposes of configuring Argo CD as code, please also have a look at [Declarative Setup](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/).


---

