Skip to content

allamand/gitops-bridge-argocd-bootstrap-terraform

 
 

Repository files navigation

gitops-bridge-argocd-bootstrap-terraform

Terraform module for gitops-bridge argocd bootstrap

It handles three aspect of ArgoCD bootstrap

  1. Installs an intial deployment of argocd, this deployment (gets replaced by argocd applicationset)
  2. Creates the ArgoCD cluster secret (including in-cluster)
  3. Creates the intial set App of Apps (addons, workloads, etc.)

To be use with gitops-bridge project, see example here

Usage

locals {
  name                   = "ex-${replace(basename(path.cwd), "_", "-")}"
  environment            = "dev"
  cluster_version        = "1.27"
  gitops_addons_url      = "https://github.com/gitops-bridge-dev/gitops-bridge-argocd-control-plane-template"
  gitops_addons_basepath = ""
  gitops_addons_path     = "bootstrap/control-plane/addons"
  gitops_addons_revision = "HEAD"

  oss_addons = {
    enable_argo_workflows = true
    enable_foo                                   = true # you can add any addon here, make sure to update the gitops repo with the corresponding application set
  }
  addons = merge(local.oss_addons, { kubernetes_version = local.cluster_version })

  addons_metadata = merge(
    {
      addons_repo_url      = local.gitops_addons_url
      addons_repo_basepath = local.gitops_addons_basepath
      addons_repo_path     = local.gitops_addons_path
      addons_repo_revision = local.gitops_addons_revision
    }
  )

  argocd_bootstrap_app_of_apps = {
    addons = file("${path.module}/bootstrap/addons.yaml")
  }

}

###########################################################################
# GitOps Bridge: Metadata
###########################################################################
module "gitops_bridge_metadata" {
  source = "github.com/gitops-bridge-dev/gitops-bridge-argocd-metadata-terraform?ref=v1.0.0"

  cluster_name = local.name
  environment  = local.environment
  metadata     = local.addons_metadata
  addons       = local.addons
}

###########################################################################
# GitOps Bridge: Bootstrap
###########################################################################
module "gitops_bridge_bootstrap" {
  source = "github.com/gitops-bridge-dev/gitops-bridge-argocd-bootstrap-terraform?ref=v1.0.0"

  argocd_cluster               = module.gitops_bridge_metadata.argocd
  argocd_bootstrap_app_of_apps = local.argocd_bootstrap_app_of_apps
}

Requirements

Name Version
terraform >= 1.0
helm >= 2.10.1
kubectl >= 1.14
kubernetes >= 2.22.0

Providers

Name Version
helm >= 2.10.1
kubectl >= 1.14
kubernetes >= 2.22.0

Modules

No modules.

Resources

Name Type
helm_release.argocd resource
kubectl_manifest.bootstrap resource
kubernetes_secret_v1.cluster resource

Inputs

Name Description Type Default Required
argocd argocd helm options any {} no
argocd_bootstrap_app_of_apps argocd app of apps to deploy any {} no
argocd_cluster argocd cluster secret any null no
argocd_create_install Deploy argocd helm bool true no
create Create terraform resources bool true no

Outputs

Name Description
apps ArgoCD apps
argocd Argocd helm release
cluster ArgoCD cluster

About

Terraform module for ArgoCD bootstrap

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Smarty 74.5%
  • HCL 24.3%
  • Shell 1.2%