Skip to content

rafaelperoco/terraform-flux-flux-install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flux install module

Terraform module to install FluxCD V2

Dependencies

Create ssh keypair and add and add to your git repo and keep it in a safe place.

export MY_CLUSTER="your-cluster-name"
ssh-keygen -t ed25519 -C $MY_CLUSTER -f identity

Import known hosts from your git provider GitHub

export MY_PROJECT_PATH="your/project/path"
ssh-keyscan -H github.com >> $MY_PROJECT_PATH/known_hosts

GitLab

export MY_PROJECT_PATH="your/project/path"
ssh-keyscan -H gitlab.com >> $MY_PROJECT_PATH/known_hosts

BitBucket

export MY_PROJECT_PATH="your/project/path"
ssh-keyscan -H bitbucket.org >> $MY_PROJECT_PATH/known_hosts

Usage

Basic usage of the module as follows:

module "flux-install" {
  source            = "rafaelperoco/flux-install/flux"
  version           = "0.1.4"
  target_path       = var.target_path
  flux_manifests    = var.flux_manifests
  gitrepository     = var.gitrepository
  gitrepo_url       = var.gitrepo_url
  gitbranch         = var.gitbranch
  interval          = var.interval
  identity_file     = var.identity_file
  identity_pub_file = var.identity_pub_file
  known_hosts_file  = var.known_hosts_file
}

terraform.tfvars

target_path = "cluster"
flux_manifests = "cluster"
identity_file = "identity"
identity_pub_file = "identity.pub"
known_hosts_file = "known_hosts"
gitrepo_url = "ssh://[email protected]/your-username/my-cluster-with-flux.git"
gitrepository = "my-cluster-with-flux"
interval = "1m0s"
gitbranch = "main"

providers.tf

provider "kubernetes" {
  config_path = "~/.kube/config"
}

About

Terraform Flux module using official provider

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages