Giter Club home page Giter Club logo

terraform-gcp-yugabyte's Introduction

terraform-gcp-yugabyte

A Terraform module to deploy and run YugabyteDB on Google Cloud.

Config

  • First create a terraform file with provider details

    provider "google" 
    { 
      # Provide your GCP Creadentilals 
      credentials = "${file("yugabyte-pcf-bc8114281026.json")}"
    
      # The name of your GCP project 
      project = "yugabyte-pcf"
    }
    

    Note :- You can get credentials file by following steps given here

  • Now add the yugabyte terraform module to your file

    module "yugabyte-db-cluster" {
    source = "github.com/YugaByte/terraform-gcp-yugabyte.git"
    
    # The name of the cluster to be created.
    cluster_name = "test-yugabyte"
    
     # key pair.
    ssh_private_key = "SSH_PRIVATE_KEY_HERE"
    ssh_public_key = "SSH_PUBLIC_KEY_HERE"
    ssh_user = "SSH_USER_NAME_HERE"
    
    # The region name where the nodes should be spawned.
    region_name = "YOUR VPC REGION"
    
    # Replication factor.
    replication_factor = "3"
    
    # The number of nodes in the cluster, this cannot be lower than the replication factor.
    node_count = "3"
    }
    

Usage

Init terraform first if you have not already done so.

$ terraform init

To check what changes are going to happen in the environment run the following

$ terraform plan

Now run the following to create the instances and bring up the cluster.

$ terraform apply

Once the cluster is created, you can go to the URL http://<node ip or dns name>:7000 to view the UI. You can find the node's ip or dns by running the following:

terraform state show google_compute_instance.yugabyte_node[0]

You can access the cluster UI by going to any of the following URLs.

You can check the state of the nodes at any point by running the following command.

$ terraform show

To destroy what we just created, you can run the following command.

$ terraform destroy

Note:- To make any changes in the created cluster you will need the terraform state files. So don't delete state files of Terraform.

terraform-gcp-yugabyte's People

Contributors

andrewc-dev avatar baba230896 avatar bhavin192 avatar bretthoyer avatar isignal avatar rao-vasireddy avatar rkarthik007 avatar stevebang avatar svarnau avatar yugabyte-ci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-gcp-yugabyte's Issues

Error: Unsupported block type

I am trying to deploy yugabyte, but terraform plan and terraform apply throw this error:

Error: Unsupported block type

  on .terraform/modules/yugabyte-db-cluster/main.tf line 42, in resource "google_compute_instance" "yugabyte_node":
  42:     metadata { 

Blocks of type "metadata" are not expected here. Did you mean to define
argument "metadata"? If so, use the equals sign to assign it a value.

Mac OS Terraform issue with private keys

There is an issue with Terraform reading private keys on Mac OS - which causes the instance creation to fail.

module.yugabyte-db-cluster.google_compute_instance.yugabyte_node[2]: Provisioning with 'file'...
module.yugabyte-db-cluster.google_compute_instance.yugabyte_node[1]: Provisioning with 'file'...
module.yugabyte-db-cluster.google_compute_instance.yugabyte_node[0]: Provisioning with 'file'...

Error: Error applying plan:

3 errors occurred:
	* module.yugabyte-db-cluster.google_compute_instance.yugabyte_node[1]: Failed to parse key file "
<PRIVATE KEY CONTENT HERE>
": ssh: cannot decode encrypted private keys

There is a related issue open without any update: hashicorp/terraform#18927

Airflow has a similar issue but I am not clear/confident on the solution: PowerDataHub/terraform-aws-airflow#9

Support multi-regional deployments

Hi all,

Thank you so much for this module. Right now e'd have to basically fork this repository to be able to support a multi-regional setup. Is there any reason why that's not supported right now?

Support authentication

Is there a way to directly setup authentication for the cluster;
As I understand it correctly currently this cluster will be deployed without authentication enabled? So free for everybody to connect (yugabytedb/yugabytedb)

CI/CD for YB TerraForm GCP

A CI/CD pipeline which deploys the YB stack using Terraform in GCP and verifies with some basic tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.