Skip to content

Latest commit

 

History

History
147 lines (105 loc) · 10.1 KB

README.md

File metadata and controls

147 lines (105 loc) · 10.1 KB

ArgoCD Terraform module

labyrinth labs logo

We help companies build, run, deploy and scale software and infrastructure by embracing the right technologies and principles. Check out our website at https://lablabs.io/


Terraform validation pre-commit

Description

A terraform module to deploy the ArgoCD on Amazon EKS cluster.

This module deploys ArgoCD in two different ways:

  1. A helm release that is further managed by Helm
  2. A helm release along with ArgoCD Application CRD which allows Argo to self-manage itself.

When self_managed variable is set to true, ArgoCD application is deployed and you're able to manage ArgoCD from ArgoCD. The helm release has a lifecycle ignore_changes rules set on it's resource, so no further changes are made to the release. It is only used for the initial ArgoCD deployment.

Important notice

Changing the self_managed variable after ArgoCD was already deployed will result in it's re-creation.

Related Projects

Check out these related projects.

Examples

See Basic example for further information.

ArgoCD self-managed mode

This module provides an option to deploy in self managed mode. If self_managed is set, the module will make an initial deployment of ArgoCD with Helm and then proceed to deploy ArgoCD Application object. The original helm release is ignored in further terraform runs and only the newly deployed, self-managed object is used.

Potential issues with running terraform plan

When deploying Argo in self-managed mode, Kubernetes terraform provider requires access to Kubernetes cluster API during plan time. This introduces potential issue when you want to deploy the cluster with this addon at the same time, during the same Terraform run.

To overcome this issue, the module deploys the ArgoCD application object using the Helm provider, which does not require API access during plan. If you want to deploy the application using this workaround, you can set the self_managed_use_helm variable to true.

Requirements

Name Version
terraform >= 1.0
helm >= 1.0
kubernetes >= 2.4
utils >= 0.12.0

Modules

No modules.

Resources

Name Type
helm_release.argocd_application resource
helm_release.self_managed resource
helm_release.this resource
kubernetes_manifest.self resource
utils_deep_merge_yaml.argo_application_values data source

Inputs

Name Description Type Default Required
argo_application_enabled n/a bool false no
argo_application_namespace Namespace where to deploy Argo application string "argo" no
argo_application_use_helm n/a bool false no
argo_application_values Values to pass to the dummy helm chart installing the ArgoCD application object string "" no
argo_destionation_server Destination server for ArgoCD Application string "https://kubernetes.default.svc" no
argo_info ArgoCD info manifest parameter list
[
{
"name": "terraform",
"value": "true"
}
]
no
argo_project ArgoCD Application project string "default" no
argo_sync_policy ArgoCD syncPolicy manifest parameter map {} no
enabled Variable indicating whether deployment is enabled bool true no
helm_atomic If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used. Defaults to false. bool false no
helm_chart_name Helm chart name to be installed string "argo-cd" no
helm_chart_version Version of the Helm chart string "3.17.5" no
helm_cleanup_on_fail Allow deletion of new resources created in this upgrade when upgrade fails. Defaults to false. bool false no
helm_create_namespace Create the namespace if it does not yet exist bool true no
helm_release_name Helm release name string "argocd" no
helm_repo_url Helm repository string "https://argoproj.github.io/argo-helm" no
helm_timeout Time in seconds to wait for any individual kubernetes operation (like Jobs for hooks). Defaults to 300 seconds. number 300 no
helm_wait Will wait until all resources are in a ready state before marking the release as successful. It will wait for as long as timeout. Defaults to true. bool true no
k8s_namespace The K8s namespace in which the ingress-nginx has been created string "argo" no
self_managed If set to true, the module will create ArgoCD Application manifest in the cluster and abandon the Helm release bool true no
self_managed_use_helm If set to true, the ArgoCD Application manifest will be deployed using Kubernetes provider as a Helm release. Otherwise it'll be deployed as a Kubernetes manifest. See Readme for more info bool false no
settings Additional settings which will be passed to the Helm chart values, see https://artifacthub.io/packages/helm/argo/argo-cd map(any) {} no
values Additional yaml encoded values which will be passed to the Helm chart. string "" no

Outputs

No outputs.

Contributing and reporting issues

Feel free to create an issue in this repository if you have questions, suggestions or feature requests.

Validation, linters and pull-requests

We want to provide high quality code and modules. For this reason we are using several pre-commit hooks and GitHub Actions workflow. A pull-request to the master branch will trigger these validations and lints automatically. Please check your code before you will create pull-requests. See pre-commit documentation and GitHub Actions documentation for further details.

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.