Skip to content

Latest commit

 

History

History
101 lines (81 loc) · 5.41 KB

File metadata and controls

101 lines (81 loc) · 5.41 KB

GCP Deployment

Pre-requirements

  1. Installed gcloud CLI
  2. Authorized gcloud SDK
gcloud init
gcloud auth application-default login
  1. [Optionally] Installed kubectl for interacting with EKS

Usage

Configuration

  1. Configure variables in terraform.tfvars
  • project_name - AWS organization project name;

  • region - AWS deployment region, default is eu-central-1;

  • docker_image - docker image of the collator;

  • container_args - collator arguments are specific to collator you spinning up; no spaces allowed in arguments - separate them with ", " instead of spaces;

  • container_command - command bypassed to collator container.

  1. Configure container ports with container_args in terraform.tfvars if your collator don't use defaults ports 30333, 9933, 9944

Optional Configurations

  1. Configure variables in backend.tf
  • bucket - bucket name where tfvars are stored;
  1. Configure deployment parameters for GKE cluster in gke-cluster.tf
  • min_master_version - minimal kubernetes version for master, GCP will update it automatically, and we can't prevent it
  • disk_size_gb - disk size of each GKE node
  • cluster_cidr - cidr for GKE cluster, make sure to edit cidr in network.tf if editing cluster_cidr
  • services_cidr - cidr for GKE services, make sure to edit cidr in network.tf if editing services_cidr
  • master_cidr - cidr for GKE master nodes, make sure to edit cidr in network.tf if editing master_cidr
  • machine_type - node vm type
  • nodes_number - initial nodes number
  • total_min_nodes - min nodes number for autoscaler
  • total_max_nodes - max nodes number for autoscaler, quota 8 for basic accounts
WARN After any changes, GKE cluster is re-created

Deployment

Once you have configured everything follows steps below to deploy collator

  • Install all dependecies with terraform init
  • Check deployment with terraform plan
  • If everything is planned correctly apply deployment with terraform apply
  • optional copy file backend.tf to GCP if you need to store tfstate in the google storage bucket
  • Verify that your node is syncing via telemetry

Requirements

Name Version
terraform >= 0.14
google 4.51.0

Providers

Name Version
google 4.51.0
kubernetes 2.18.1

Modules

No modules.

Resources

Name Type
google_compute_firewall.allow-all resource
google_compute_network.vpc resource
google_compute_route.egress_internet resource
google_compute_router.router resource
google_compute_router_nat.nat resource
google_compute_subnetwork.subnet resource
google_container_cluster.primary resource
google_container_node_pool.primary_nodes resource
google_storage_bucket.backend resource
google_storage_bucket_object.default resource
kubernetes_deployment.collator resource
google_client_config.provider data source

Inputs

Name Description Type Default Required
container_args n/a list(string) n/a yes
docker_image n/a string n/a yes
project_name n/a string n/a yes
container_command n/a list(string)
[
""
]
no
region GCP region string "us-central1" no

Outputs

No outputs.