Skip to content

catalystcommunity/terraform-kubernetes-argocd-application

Repository files navigation

terraform-kubernetes-argocd-application

This module deploys an ArgoCD application custom resource. It utilizes the kubectl provider instead of the official Kubernetes provider to mitigate common problems with custom resources in Terraform, such as:

  • Required API access during planning time, requiring multiple terraform states in order to deploy an application to Kubernetes.
  • Sensitive values are displayed in logs, ref.

Example Implementations

Basic

You can make use of the built-in templatefile() function to easily add secret values to the platform_services_values if secret configuration is required.

provider "kubectl" {
  # provider configuration ...
}

module "my_app" {
  source = "catalystcommunity/argocd-application/kubernetes"

  name            = "my-app"
  source_chart    = "my-app"
  source_repo_url = "https://example.com/repository"
  helm_values     = templatefile("./helm-values/my-application-values.yaml", {
    "exampleSecretInput" : var.example_secret
  })
}

Requirements

Name Version
terraform >= 0.13.1
kubectl ~> 1.14.0

Inputs

Name Description Type Default Required
name Name of the ArgoCD application custom resource string n/a yes
source_chart Name of Helm chart string n/a yes
source_repo_url Helm repository URL string n/a yes
helm_values Helm values as a raw string in YAML format string "" no
namespace Namespace to deploy the ArgoCD application custom resource. Should be in the same namespace as ArgoCD. string "argo-cd" no
project ArgoCD project to associate the application to string "default" no
source_target_revision Target revision of the helm chart string ">=1.0.0" no
spec_override Application spec override. Gets merged with the default applcation spec that's generated from existing variables. Allows specifying configuration that is not specifically implemented by this module. map(any) {} no
sync_policy ArgoCD application sync policy. Defaults to a frequent automatic sync.
object({
automated = object({
prune = bool
selfHeal = bool
})
retry = object({
backoff = object({
duration = string
factor = number
maxDuration = string
})
limit = number
})
syncOptions = list(string)
})
{
"automated": {
"prune": true,
"selfHeal": true
},
"retry": {
"backoff": {
"duration": "5s",
"factor": 2,
"maxDuration": "3m"
},
"limit": 3
},
"syncOptions": [
"CreateNamespace=true",
"PrunePropagationPolicy=foreground",
"PruneLast=true"
]
}
no

Outputs

No outputs.

Resources

Name Type
kubectl_manifest.application resource

Modules

No modules.

About

Terraform module that provisions an ArgoCD Application in Kubernetes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages