/terraform-k8s-flux-bootstrap

Bootstrap Weave Flux on k8s with a Github repo

Primary LanguageHCLMIT LicenseMIT

terraform-k8s-flux-bootstrap

This Terraform module will bootstrap Weaveworks Flux on a Kubernetes cluster by doing the following things:

  • Create an RSA key to be used by Flux
  • Store the private key as a Kubernetes Secret
  • Add the public key to the config repo in Github as a deploy key
  • Configure RBAC rules and deploy flux + memcached to the cluster

Current Limitations

  • Only supports Github for the config repo (and may only work for org repos)
  • Assumes the Kubernetes is an Amazon EKS cluster
  • Only supports deploying to the 'flux' namespace (but will be automatically created)

Usage

Prerequisites:

  • GITHUB_TOKEN environment variable present with appropriate Github API key
  • AWS region and credentials configured via appropriate provider block or environment variables / config file etc
module "flux-bootstrap" {
  source = "github.com/limejump/terraform-k8s-flux-bootstrap"

  eks_cluster_name       = "your-cluster-name-here"
  github_org_name        = "your-org-name-here"
  github_repository_name = "your-repo-name-here"
}

FAQ

What about the Flux Helm Operator

The easiest thing to do is to add the manifests for the Helm Operator to your flux config repo. This way, once Flux is up and running it will automatically deploy the Helm component! You can also deploy Tiller like this!