equinix / terraform-equinix-metal-anthos-on-baremetal

Terraform module for quick deployment of baremetal Anthos on Equinix Metal
https://registry.terraform.io/modules/equinix/anthos-on-baremetal
Apache License 2.0
26 stars 24 forks source link

Update documentation for Terraform module use #28

Open displague opened 3 years ago

displague commented 3 years ago

We should be able to simplify some of the documentation now that the module is published to provide a less developer-centric installation.

If the GCP Terraform provider can be incorporated (#14), we could further simplify the installation instructions because Terraform's built in variable prompts would be run on apply and we wouldn't need the util/setup_gcp_project.sh script.

Here are some early thoughts on what simplified instructions could offer:

No need to git clone:

terraform init --from-module=equinix/anthos-on-baremetal/metal
util/setup_gcp_project.sh # We should explain where all the Google Container Registry (GCR) service account value can be found
terraform apply

To avoid entering all the variables every time you terraform apply, you can create a terraform.tfvars file, any of the input variables can be stored in this file.

When the terraform apply is done (with a green text summary), you can do things like:

KUBECONFIG=$(terraform output Kubeconfig_location) kubectl get nodes

and

ssh -i $(terraform output ssh_key_location) root@$(terraform output -json Worker_Public_IPs | jq '.[0]' ) # 0 is the first worker

A complete list of output variables is available at https://registry.terraform.io/modules/equinix/anthos-on-baremetal/metal/latest?tab=outputs.

To use this module in a larger configuration:

# example that demonstrates consuming the Kubeconfig variable 

If you plan to contribute to the project, rather than running terraform init --from-module=equinix/anthos-on-baremetal/metal, you will want to run:

git clone git@github.com:equinix/terraform-metal-anthos-on-baremetal
terraform init
displague commented 3 years ago

We should also note that gcloud init should be run, if it is not already configured.

joshpadilla commented 3 years ago

Can someone assign this doc update to me? I may break each suggestion into a smaller issue so they are easier to track, etc. I've created a local branch for readme update.

displague commented 3 years ago

Anthos approach that should be recommended in this section, is that a user need only create the following main.tf:

module "anthos-on-baremetal" {
  source  = "equinix/anthos-on-baremetal/metal"
  version = "0.5.1"

  gcp_project_id = "..."
  metal_auth_token = "..."
  storage_module = "portworx"
  storage_options = {}
}

Then run:

$ gcloud init
$ gcloud auth application-default login
$ terraform init
$ terraform apply