Skip to content
This repository has been archived by the owner on Jul 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #109 from pivotal-cf-experimental/146557113
Browse files Browse the repository at this point in the history
Fixes for Terraform and documentation
  • Loading branch information
alex-slynko authored Jun 6, 2017
2 parents ec66a35 + f4634c4 commit 1d9147b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 7 additions & 2 deletions docs/guides/gcp/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Example: Open Source Cloud Foundry and Kubo on GCP
# Example: Kubo on GCP

## Prerequisites

Expand Down Expand Up @@ -66,7 +66,7 @@ The remaining steps should all be done in succession from a single session to re
-var projectid=${project_id} \
-var kubo_region=${kubo_region} \
-state=${kubo_terraform_state}
```
```
1. Create the resources
```bash
Expand All @@ -77,6 +77,11 @@ The remaining steps should all be done in succession from a single session to re
-state=${kubo_terraform_state}
```
Additionally, the terraform script accepts the following variables:
- `ip_cidr_range`: the CIDR range for the kubo subnetwork. The default value is `10.0.1.0/24`
- `prefix`: A prefix to use for all the GCP resource names. Defaults to an empty string.
## Configure Kubo
1. Retrieve the outputs of your Terraform run to be used in your Kubo deployment
Expand Down
12 changes: 10 additions & 2 deletions docs/guides/gcp/kubo.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ variable "kubo_region" {
default = "us-west1"
}

variable "ip_cidr_range" {
type = "string"
default = "10.0.1.0/24"
}

variable "network" {
type = "string"
}
Expand All @@ -15,6 +20,7 @@ variable "prefix" {
type = "string"
default = ""
}

provider "google" {
credentials = ""
project = "${var.projectid}"
Expand All @@ -28,6 +34,7 @@ resource "google_compute_address" "kubo-tcp" {

// TCP Load Balancer
resource "google_compute_target_pool" "kubo-tcp-public" {
region = "${var.kubo_region}"
name = "${var.prefix}kubo-tcp-public"
}

Expand All @@ -52,11 +59,11 @@ resource "google_compute_firewall" "kubo-tcp-public" {
}


// Subnet for Kubo
// Subnet for Kubo
resource "google_compute_subnetwork" "kubo-subnet" {
name = "${var.prefix}kubo-${var.kubo_region}"
region = "${var.kubo_region}"
ip_cidr_range = "10.0.1.0/24"
ip_cidr_range = "${var.ip_cidr_range}"
network = "https://www.googleapis.com/compute/v1/projects/${var.projectid}/global/networks/${var.network}"
}

Expand All @@ -67,6 +74,7 @@ resource "google_compute_address" "kubo-workers-tcp" {

// TCP Load Balancer
resource "google_compute_target_pool" "kubo-workers-tcp-public" {
region = "${var.kubo_region}"
name = "${var.prefix}kubo-workers-tcp-public"
}

Expand Down

0 comments on commit 1d9147b

Please sign in to comment.