• Stars
    star
    397
  • Rank 107,921 (Top 3 %)
  • Language
    Go
  • License
    Mozilla Public Li...
  • Created over 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terraform provider for ArgoCD
Terraform logo Terraform logo

Terraform Provider for ArgoCD

Tests

The ArgoCD Terraform Provider provides lifecycle management of ArgoCD resources.

NB: The provider is not concerned with the installation/configuration of ArgoCD itself. To make use of the provider, you will need to have an existing ArgoCD deployment and, the ArgoCD API server must be accessible from where you are running Terraform.


Documentation

Official documentation on how to use this provider can be found on the Terraform Registry.

Compatibility promise

This provider is compatible with at least the last 2 minor releases of ArgoCD (e.g, ranging from 1.(n).m, to 1.(n-1).0, where n is the latest available minor version).

Older releases are not supported and some resources may not work as expected.

Motivations

I thought ArgoCD already allowed for 100% declarative configuration?

While that is true through the use of ArgoCD Kubernetes Custom Resources, there are some resources that simply cannot be managed using Kubernetes manifests, such as project roles JWTs whose respective lifecycles are better handled by a tool like Terraform. Even more so when you need to export these JWTs to another external system using Terraform, like a CI platform.

Wouldn't using a Kubernetes provider to handle ArgoCD configuration be enough?

Existing Kubernetes providers do not patch arrays of objects, losing project role JWTs when doing small project changes just happen.

ArgoCD Kubernetes admission webhook controller is not as exhaustive as ArgoCD API validation, this can be seen with RBAC policies, where no validation occur when creating/patching a project.

Using Terraform to manage Kubernetes Custom Resource becomes increasingly difficult the further you use HCL2 DSL to merge different data structures and want to preserve type safety.

Whatever the Kubernetes CRD provider you are using, you will probably end up using locals and the yamlencode function which does not preserve the values' type. In these cases, not only the readability of your Terraform plan will worsen, but you will also be losing some safeties that Terraform provides in the process.


Requirements

Contributing

Contributions are welcome!

Building

  1. git clone this repository and cd into its directory
  2. make build will trigger the Golang build

The provided GNUmakefile defines additional commands generally useful during development, like for running tests, generating documentation, code formatting and linting. Taking a look at it's content is recommended.

Testing

The acceptance tests run against a disposable ArgoCD installation within a Kind cluster. Other requirements are having a Docker daemon running and Kustomize installed.

make testacc_prepare_env
make testacc
make testacc_clean_env

Generating documentation

This provider uses terraform-plugin-docs to generate documentation and store it in the docs/ directory. Once a release is cut, the Terraform Registry will download the documentation from docs/ and associate it with the release version. Read more about how this works on the official page.

Use make generate to ensure the documentation is regenerated with any changes.

Using a development build

If running tests and acceptance tests isn't enough, it's possible to set up a local terraform configuration to use a development builds of the provider. This can be achieved by leveraging the Terraform CLI configuration file development overrides.

First, use make install to place a fresh development build of the provider in your ${GOBIN} (defaults to ${GOPATH}/bin or ${HOME}/go/bin if ${GOPATH} is not set). Repeat this every time you make changes to the provider locally.

Then, setup your environment following these instructions to make your local terraform use your local build.

Troubleshooting during local development


Credits

  • Thanks to JetBrains for providing a GoLand open source license to support the development of this provider.
  • Thanks to Keplr for allowing me to contribute to this side-project of mine during paid work hours.

More Repositories

1

argocd-image-updater

Automatic container image update for Argo CD
Go
1,220
star
2

argocd-autopilot

Argo-CD Autopilot
Go
889
star
3

argocd-vault-plugin

An Argo CD plugin to retrieve secrets from Secret Management tools and inject them into Kubernetes secrets
Go
805
star
4

argocd-operator

A Kubernetes operator for managing Argo CD clusters.
Go
625
star
5

hera

Hera is an Argo Python SDK. Hera aims to make construction and submission of various Argo Project resources easy and accessible to everyone! Hera abstracts away low-level setup details while still maintaining a consistent vocabulary with Argo. ⭐️ Remember to star!
Python
559
star
6

argocd-notifications

Notifications for Argo CD
Go
492
star
7

old-argo-dataflow

Dataflow is a Kubernetes-native platform for executing large parallel data-processing pipelines.
Go
268
star
8

rollout-extension

Argo Rollout visualization in Argo CD Web UI
TypeScript
186
star
9

argocd-bot

Bot to automate Kubernetes deployment via Github PRs
TypeScript
135
star
10

argocd-extension-metrics

An Argo CD extension to enable visualization of metrics in Argo CD UI.
TypeScript
115
star
11

argocd-extensions

Support for extending Argo CD
Go
108
star
12

argo-python-dsl

Python DSL for Argo Workflows
Python
99
star
13

argo-kube-notifier

Argo Kube Notifier controller monitors Kubernetes resources
Go
95
star
14

rollouts-plugin-trafficrouter-gatewayapi

The Argo Rollouts plugin implementing the Kubernetes Gateway API specification for using different traffic providers in progressive delivery scenarios
Go
92
star
15

argo-rollouts-manager

Kubernetes Operator for Argo Rollouts controller.
Go
90
star
16

argo-workflows-catalog

Argo Workflows Catalog
Go
86
star
17

gordian

Gordian applies transformations to files across multiple github repositories and creates pull requests for the owners of the repositories to review and merge them.
Python
78
star
18

argocd-interlace

Enabling Software Supply Chain Security Capabilities in ArgoCD
Go
78
star
19

argo-client-python

⚠️⚠️⚠️This repository is no longer maintained, please find your Java SDKs https://github.com/argoproj/argo-workflows/blob/master/docs/client-libraries.md ⚠️⚠️⚠️
Python
78
star
20

argocd-agent

Redefining the multi cluster story of Argo CD
Go
48
star
21

argo-client-java

⚠️This repository is no longer maintained, please find your Java SDKs https://github.com/argoproj/argo-workflows/blob/master/docs/client-libraries.md
Java
35
star
22

appsource

Automatically self-serviced applications for ArgoCD.
Go
24
star
23

argocd-extension-installer

Install Argo CD extensions using init-containers
Shell
17
star
24

rollouts-plugin-trafficrouter-contour

The Argo Rollouts plugin implementing the Contour HTTPProxy traffic control in progressive delivery scenarios.
Go
15
star
25

argocd-rbac-operator

Kubernetes Operator for Argo CD RBAC Management.
Go
14
star
26

applicationset-hello-plugin

Python
13
star
27

community

Community documents for argoproj-labs
12
star
28

argo-java-client

Created java data model from argo project by it's swagger files. Argo proj does use Kubernetes api so this client only contains Model and no APIs
Java
12
star
29

argoverse

ShaderLab
11
star
30

training-material

Shell
8
star
31

argo-client-gen

⚠️⚠️⚠️This repository is no longer maintained, please find your Java SDKs https://github.com/argoproj/argo-workflows/blob/master/docs/client-libraries.md ⚠️⚠️⚠️
8
star
32

gitops-promoter

A GitOps Environment Promotion Tool
Go
7
star
33

multi-cluster-kubernetes

Proof of concept of amalgamating multiple Kubernetes APIs into a single view
Go
6
star
34

argo-cd-benchmarking

JavaScript
6
star
35

argo-cd-tokens

Go
6
star
36

argo-workflows-slack-executor-plugin

Python
5
star
37

argocd-example-extension

JavaScript
5
star
38

argo-workflows-python-executor-plugin

Python
5
star
39

argo-graph

TypeScript
4
star
40

rollouts-plugin-trafficrouter-consul

Argo Rollouts Plugin for Consul Service Mesh
Go
4
star
41

friends

Projects which would love to associate themselves with the Argo ecosystem of projects!
4
star
42

argo-workflows-events-workshop

3
star
43

couler

This project has been moved to https://github.com/couler-proj/couler
3
star
44

argo-eventbus

Go
3
star
45

argocd-ephemeral-access

A kubernetes controller to manage Argo CD temporary access
Go
3
star
46

argocd-cmp-plugin-examples

2
star
47

terraform-provider-argocd-old

2
star
48

argo-workflows-hello-executor-plugin

Python
1
star
49

rollouts-opsmx-metric-plugin

Argo Rollouts plugin implementation for logs and metrics analysis
1
star
50

rollouts-plugin-trafficrouter-openshift

Go
1
star