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

Enable specifying master_authorized_networks_config #10

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
2 changes: 2 additions & 0 deletions cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ resource "google_container_cluster" "primary" {
logging_service = "${var.logging_service}"
monitoring_service = "${var.monitoring_service}"

master_authorized_networks_config = "${var.master_authorized_networks_config}"

addons_config {
http_load_balancing {
disabled = "${var.http_load_balancing ? 0 : 1}"
Expand Down
2 changes: 2 additions & 0 deletions cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ resource "google_container_cluster" "zonal_primary" {
logging_service = "${var.logging_service}"
monitoring_service = "${var.monitoring_service}"

master_authorized_networks_config = "${var.master_authorized_networks_config}"

addons_config {
http_load_balancing {
disabled = "${var.http_load_balancing ? 0 : 1}"
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ output "monitoring_service" {
value = "${local.cluster_monitoring_service}"
}

output "master_authorized_networks_config" {
description = "Networks from which access to master is permitted"
value = "${var.master_authorized_networks_config}"
}

output "master_version" {
description = "Current master kubernetes version"
value = "${local.cluster_master_version}"
Expand Down
19 changes: 19 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ variable "node_version" {
default = ""
}

variable "master_authorized_networks_config" {
type = "list"

description = <<EOF
The desired configuration options for master authorized networks. Omit the nested cidr_blocks attribute to disallow external access (except the cluster node IPs, which GKE automatically whitelists)
### example format ###
default = [{
cidr_blocks = [{
cidr_block = "10.0.0.0/8"
display_name = "example_network"
}],
}]
EOF

default = []
}

variable "horizontal_pod_autoscaling" {
description = "Enable horizontal pod autoscaling addon"
default = false
Expand Down