Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the private cluster feature in GCP terraform config #5447

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions terraform/gcp/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,6 @@ resource "google_container_cluster" "cluster" {
prevent_destroy = true
}

// For private clusters, pass the name of the network and subnetwork created
// by the VPC
network = var.enable_private_cluster ? data.google_compute_network.default_network.name : null
subnetwork = var.enable_private_cluster ? data.google_compute_subnetwork.default_subnetwork.name : null

// Dynamically provision the private cluster config when deploying a
// private cluster
dynamic "private_cluster_config" {
for_each = var.enable_private_cluster ? [1] : []

content {
// Decide if this CIDR block is sensible or not
master_ipv4_cidr_block = "172.16.0.0/28"
enable_private_nodes = true
enable_private_endpoint = false
}
}

// Dynamically provision the IP allocation policy when deploying a
// private cluster. This allows for IP aliasing and makes the cluster
// VPC-native
dynamic "ip_allocation_policy" {
for_each = var.enable_private_cluster ? [1] : []
content {}
}

addons_config {
network_policy_config {
disabled = !var.enable_network_policy
Expand Down
58 changes: 0 additions & 58 deletions terraform/gcp/network.tf

This file was deleted.

2 changes: 1 addition & 1 deletion terraform/gcp/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "google_filestore_instance" "homedirs" {
}

networks {
network = var.enable_private_cluster ? data.google_compute_network.default_network.name : "default"
network = "default"
modes = ["MODE_IPV4"]
}
}
16 changes: 0 additions & 16 deletions terraform/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -300,22 +300,6 @@ variable "user_buckets" {
EOT
}

variable "enable_private_cluster" {
type = bool
default = false
description = <<-EOT
Deploy the kubernetes cluster into a private subnet

By default, GKE gives each of your nodes a public IP & puts them in a public
subnet. When this variable is set to `true`, the nodes will be in a private subnet
and not have public IPs. A cloud NAT will provide outbound internet access from
these nodes. The kubernetes API will still be exposed publicly, so we can access
it from our laptops & CD.

This is often required by institutional controls banning VMs from having public IPs.
EOT
}

variable "filestores" {
type = map(object({
name_suffix : optional(string, null),
Expand Down