Skip to content

Latest commit

 

History

History
82 lines (63 loc) · 2.94 KB

File metadata and controls

82 lines (63 loc) · 2.94 KB

Terraform: cf-for-k8s on GKE

This Terraform module installs cf-for-k8s (Cloud Foundry on Kubernetes) on Google Kubernetes Engine.

It will:

  • Create a GKE cluster of the correct minimal size
  • Create a Google Cloud DNS hosted zone and wire it up to an existing base zone
  • Install cf-for-k8s from the official ytt configuration
  • Install external-dns and ensure its configured correctly
  • Installs Harbor registry in the cluster
  • Configures cf-for-k8s to use that Harbor registry for buildpacks
  • Output information to connect to the Cloud Foundry API endpoint
  • Output information to access the Harbor registry

Example:

module "cf_for_k8s" {
  source = "github.com/niallthomson/tanzu-playground//terraform/gke/cf-for-k8s"

  acme_email          = "nthomson@pivotal.io"
  base_zone_name      = "paasify-zone"

  environment_name    = "demo"
  dns_prefix          = "demo"

  project             = "fe-nthomson"
}

output "cf_api_endpoint" {
  value       = module.cf_for_k8s.cf_api_endpoint
}

output "cf_admin_username" {
  value       = module.cf_for_k8s.cf_admin_username
}

output "cf_admin_password" {
  value       = module.cf_for_k8s.cf_admin_password
}

output "harbor_endpoint" {
  value       = module.cf_for_k8s.harbor_endpoint
}

output "harbor_admin_username" {
  value       = module.cf_for_k8s.harbor_admin_username
}

output "harbor_admin_password" {
  value       = module.cf_for_k8s.harbor_admin_password
}

Pre-requisites

The following are pre-requisites to run the above Terraform:

  • Google Cloud Platform account, with gcloud logged in locally
  • Terraform 0.12 installed
  • Custom terraform-provider-k14sx provider installed as a TF plugin
  • DNS set up meeting the appropriate standards (see here)

Inputs

Name Description Type Default Required
acme_email Email address that will be used for Lets Encrypt certificate registration string n/a yes
base_zone_name The name of the Google Cloud DNS zone that already exists and is resolvable string n/a yes
dns_prefix The DNS prefix that will be used to generate a unique domain from the base domain string n/a yes
environment_name A name for the environment, which is used for various IaaS resources string n/a yes
project The Google Cloud project to use string n/a yes
kubernetes_version Version of Kubernetes to use for the cluster string "1.15.9-gke.26" no
region The GCP region where the resources will be deployed string "us-central1" no
zone The default GCP zone to use where applicable string "us-central1-b" no

Outputs

Name Description
cf_admin_password Cloud Foundry admin password
cf_admin_username Cloud Foundry admin username
cf_api_endpoint Cloud Foundry API endpoint