-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding gke subnet module Signed-off-by: gar <[email protected]> * Updating GCP deployment Signed-off-by: gar <[email protected]> * Parameterizing the private subnet name Signed-off-by: gar <[email protected]> * Cleaning up the terraform files Signed-off-by: gar <[email protected]> * Updating EIP and the nat usage of it Signed-off-by: gar <[email protected]> * Updating to v3.10.0 and adding cluster autoscaler Signed-off-by: gar <[email protected]> * Updating to v3.10.0 and adding cluster autoscaler Signed-off-by: gar <[email protected]> * Adding node provisioning and gke shield options Signed-off-by: gar <[email protected]>
- Loading branch information
Showing
20 changed files
with
394 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "../../../../tf-modules/gcp/private-gke-cluster/" | ||
|
||
extra_arguments "common_vars" { | ||
commands = get_terraform_commands_that_need_vars() | ||
|
||
arguments = [ | ||
"-var-file=${get_terragrunt_dir()}/../_env_defaults/gcp.tfvars", | ||
] | ||
} | ||
} | ||
|
||
inputs = { | ||
vpc_name = trimspace(run_cmd("terragrunt", "output", "network_name", "--terragrunt-working-dir", "../vpc")) | ||
network_name = trimspace(run_cmd("terragrunt", "output", "network_name", "--terragrunt-working-dir", "../vpc")) | ||
cluster_name = "dev" | ||
private_subnet_name = trimspace(run_cmd("terragrunt", "output", "private_subnet_name", "--terragrunt-working-dir", "../gke-subnets")) | ||
|
||
enable_private_kube_master_endpoint = false | ||
|
||
gke_version = "1.16.5-gke.2" | ||
initial_node_count = "1" | ||
|
||
master_ipv4_cidr_block="10.32.11.0/28" | ||
|
||
master_authorized_networks_cidr = [ | ||
{ cidr_block = "10.0.0.0/8", display_name = "10x" }, | ||
{ cidr_block = "172.16.0.0/12", display_name = "172x" }, | ||
{ cidr_block = "192.168.0.0/16", display_name = "192x" }, | ||
{ cidr_block = "38.30.8.138/32", display_name = "home" }, | ||
{ cidr_block = "35.222.67.76/32", display_name = "gar-vpn" }, | ||
{ cidr_block = "12.190.239.210/32", display_name = "gar-vpn-2" }, | ||
] | ||
|
||
outbound_through_nat_tags=["private-subnet", "gke-private-nodes"] | ||
|
||
cluster_autoscaling_enabled = true | ||
|
||
resource_limits_enable = [ | ||
{ | ||
type = "cpu", | ||
max = 10, | ||
min = 0, | ||
}, { | ||
type = "memory", | ||
max = 16, | ||
min = 0, | ||
} | ||
] | ||
|
||
release_channel_channel = "RAPID" | ||
|
||
enable_intranode_visibility = true | ||
} | ||
|
||
dependencies { | ||
paths = ["../vpc"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "../../../../tf-modules/gcp/gke-subnets/" | ||
|
||
extra_arguments "common_vars" { | ||
commands = get_terraform_commands_that_need_vars() | ||
|
||
arguments = [ | ||
"-var-file=${get_terragrunt_dir()}/../_env_defaults/gcp.tfvars", | ||
] | ||
} | ||
} | ||
|
||
inputs = { | ||
vpc_name = trimspace(run_cmd("terragrunt", "output", "network_name", "--terragrunt-working-dir", "../vpc")) | ||
region = trimspace(run_cmd("terragrunt", "output", "region", "--terragrunt-working-dir", "../vpc")) | ||
network_name = trimspace(run_cmd("terragrunt", "output", "network_name", "--terragrunt-working-dir", "../vpc")) | ||
|
||
services_ip_cidr_range="10.32.64.0/19" | ||
pods_ip_cidr_range="10.36.0.0/14" # 1024 max nodes | ||
|
||
##################### | ||
# networking | ||
##################### | ||
public_subnet_cidr_range = "10.32.16.0/20" | ||
private_subnet_cidr_range = "10.32.32.0/20" | ||
|
||
} | ||
|
||
dependencies { | ||
paths = ["../vpc"] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "../../../../tf-modules/gcp/vpc/" | ||
|
||
extra_arguments "common_vars" { | ||
commands = get_terraform_commands_that_need_vars() | ||
|
||
arguments = [ | ||
"-var-file=${get_terragrunt_dir()}/../_env_defaults/gcp.tfvars", | ||
] | ||
} | ||
} | ||
|
||
inputs = { | ||
vpc_name = "dev" | ||
|
||
public_subnet_cidr_range = "10.32.1.0/24" | ||
private_subnet_cidr_range = "10.32.5.0/24" | ||
|
||
number_of_nat_ip_address_to_use = 1 | ||
|
||
outbound_through_nat_tags=["private-subnet", "gke-private-nodes"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
terraform { | ||
backend "gcs" { | ||
} | ||
} | ||
|
||
provider "google" { | ||
region = var.region | ||
project = var.project_name | ||
credentials = file(var.credentials_file_path) | ||
version = "~> v3.10.0" | ||
} | ||
|
||
data "google_compute_network" "main-network" { | ||
name = var.vpc_name | ||
} | ||
|
||
resource "google_compute_subnetwork" "private_subnet" { | ||
name = "${var.network_name}-gke-private-subnet" | ||
ip_cidr_range = var.private_subnet_cidr_range | ||
network = data.google_compute_network.main-network.self_link | ||
region = var.region | ||
private_ip_google_access = "true" | ||
|
||
# enable secondary IP range for pods and services: | ||
secondary_ip_range { | ||
range_name = "${var.network_name}-gke-pods" | ||
ip_cidr_range = var.pods_ip_cidr_range | ||
} | ||
secondary_ip_range { | ||
range_name = "${var.network_name}-gke-services" | ||
ip_cidr_range = var.services_ip_cidr_range | ||
} | ||
} | ||
|
||
resource "google_compute_subnetwork" "public_subnet" { | ||
name = "${var.network_name}-gke-public-subnet" | ||
ip_cidr_range = var.public_subnet_cidr_range | ||
network = data.google_compute_network.main-network.self_link | ||
region = var.region | ||
private_ip_google_access = "true" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
output "private_subnet_name" { | ||
value = google_compute_subnetwork.private_subnet.name | ||
} | ||
|
||
output "public_subnet_name" { | ||
value = google_compute_subnetwork.public_subnet.name | ||
} | ||
|
||
output "private_subnet_cidr" { | ||
value = google_compute_subnetwork.private_subnet.ip_cidr_range | ||
} | ||
|
||
output "public_subnet_cidr" { | ||
value = google_compute_subnetwork.public_subnet.ip_cidr_range | ||
} |
Oops, something went wrong.