ctreatma / terraform-gcpartner-anthos-baremetal

Automatically deploy Anthos on Baremetal Kubernetes Clusters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anthos on Baremetal Website Apache License PRs Welcome

Google Anthos on Baremetal

This Terraform module will allow you to deploy Google Cloud's Anthos on Baremetal on Multiple different Clouds (Google Cloud, PhoenixNAP, & Equinix Metal)

The software in this repository has been tested sucessfully on the following hosts:

  1. Ubuntu 20.04 (amd64)
  2. macOS 12.4 (macOS Catalina with an Intel processor)

Prerequisites

Software to Install

Accounts Needed

Information to Gather

  • Deploy on GCP
    • Your GCP Project ID
  • Deploy on PhoenixNAP
    • Client ID
    • Client Secret
  • Deploy on Equinix Metal
    • API Auth Token
    • Your Equinix Metal Project ID

Deployment

Authenticate to Google Cloud

gcloud init # Follow any prompts
gcloud auth application-default login # Follown any prompts

Clone the Repo

git clone https://github.com/GCPartner/terraform-gcpartner-anthos-baremetal.git
cd terraform-gcpartner-anthos-baremetal

Create your terraform.tfvars

The following values will need to be modified by you.

GCP Minimal Deployment

cat <<EOF >terraform.tfvars 
gcp_project_id = "my_project"
EOF

PhoenixNAP Minimal Deployment

cat <<EOF >terraform.tfvars 
gcp_project_id = "my_project"
cloud = "PNAP"
pnap_client_id = "******"
pnap_client_secret = "******"
pnap_network_name = "my-network"
EOF

Equinix Metal Minimal Deployment

cat <<EOF >terraform.tfvars 
gcp_project_id = "my_project"
cloud = "EQM"
metal_auth_token = "a0ec413e-0786-4c17-a302-20ccd8a40c2e"
metal_project_id = "cf27282f-df35-4839-9f15-77e201aa2a2c"
EOF

Initialize Terraform

terraform init

Deploy the stack

terraform apply --auto-approve

What success looks like

Apply complete! Resources: 79 added, 0 changed, 0 destroyed.

Outputs:

bastion_host_ip = "34.134.208.244"
bastion_host_username = "gcp"
private_subnet = "172.31.254.0/24"
ssh_command = "ssh -i /home/c0dyhi11/.ssh/anthos-cody-qp5we gcp@34.134.208.244"
ssh_key_path = "/home/c0dyhi11/.ssh/anthos-cody-qp5we"
vlan_id = "Not applicable for Google cloud"

Inputs

Name Description Type Default Required
cloud GCP (Google Cloud Platform), EQM (Equinx Metal), or PNAP (Phoenix Nap) to deploy the 'Nodes' string "GCP" no
organization_id Organization ID (GCP or EQM) string "null" no
operating_system The Operating system to deploy (Only ubuntu_20_04 has been tested) string "ubuntu_20_04" no
cluster_name The ABM cluster name string "abm-cluster" no
create_project Create a new Project if this is 'true'. Else use provided 'project_id' (Unsuported for PNAP) bool false no
project_name The name of the project if 'create_project' is 'true'. string "abm-lab" no
private_subnet The private IP space for the cluster string "172.31.254.0/24" no
ha_control_plane Do you want a highly available control plane bool true no
worker_node_count How many worker nodes to deploy number 3 no
network_type Deploy the nodes on a 'private' or 'public' network. (Only supported in PNAP today) string "public" no
create_network Create a new network if this is 'true'. Else use provided 'p*_network_id' bool true no
public_network_id If create_network=false, this will be the public network used for the deployment. (Only supported in PNAP today) string "null" no
private_network_id If create_network=false, this will be the private network used for the deployment. (Only supported in PNAP today) string "null" no
ansible_playbook_version The version of the ansible playbook to install string "v1.0.3" no
ansible_url URL of the ansible code string "https://github.com/GCPartner/ansible-gcpartner-anthos-baremetal/archive/refs/tags/v1.0.3.tar.gz" no
ansible_tar_ball Tarball of the ansible code string "v1.0.3.tar.gz" no
pnap_client_id PhoenixNAP API ID string "null" no
pnap_client_secret PhoenixNAP API Secret string "null" no
pnap_location PhoenixNAP Location to deploy into string "ASH" no
pnap_cp_type PhoenixNAP server type to deploy for control plane nodes string "s2.c1.medium" no
pnap_worker_type PhoenixNAP server type to deploy for worker nodes string "s2.c1.medium" no
gcp_project_id The project ID for GCP string "null" no
gcp_cp_instance_type The GCE instance type for control plane nodes string "e2-standard-8" no
gcp_worker_instance_type The GCE instance type for worker nodes string "e2-standard-8" no
gcp_zone The GCE zone where the instances should reside string "us-central1-a" no
gcp_billing_account The GCP billing account to use for the project string "null" no
metal_auth_token Equinix Metal API Key string "null" no
metal_project_id The project ID to use for EQM string "null" no
metal_facility Equinix Metal Facility to deploy into string "ny5" no
metal_cp_plan Equinix Metal device type to deploy for cp nodes string "c3.small.x86" no
metal_worker_plan Equinix Metal device type to deploy for worker nodes string "c3.small.x86" no
metal_billing_cycle How the node will be billed (Not usually changed) string "hourly" no

Outputs

Name Description
ssh_command Command to run to SSH into the bastion host
ssh_key_path Path to the SSH Private key for the bastion host
bastion_host_ip IP Address of the bastion host in the test environment
bastion_host_username Username for the bastion host in the test environment
vlan_id The vLan ID for the server network
subnet The IP space for the cluster
cluster_name The name of the Anthos Cluster
kubeconfig The kubeconfig for the Anthos Cluster
ssh_key SSH Public and Private Key
network_details The network details for the nodes
os_image The OS Image used to build the nodes

About

Automatically deploy Anthos on Baremetal Kubernetes Clusters

License:Apache License 2.0


Languages

Language:HCL 95.2%Language:Python 2.5%Language:Shell 2.3%