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

Add feature to define individual oauth scopes to node pools #94

Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Then perform the following commands on the root folder:
| node_pools_labels | Map of maps containing node labels by node-pool name | map | `<map>` | no |
| node_pools_metadata | Map of maps containing node metadata by node-pool name | map | `<map>` | no |
| node_pools_tags | Map of lists containing node network tags by node-pool name | map | `<map>` | no |
| node_pools_oauth_scopes | Map of lists containing node oauth scopes by node-pool name | map | `<map>` | no |
| node_pools_taints | Map of lists containing node taints by node-pool name | map | `<map>` | no |
| node_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `` | no |
| non_masquerade_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list | `<list>` | no |
Expand Down
4 changes: 1 addition & 3 deletions cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ resource "google_container_node_pool" "pools" {
service_account = "${lookup(var.node_pools[count.index], "service_account", local.service_account)}"
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"

oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform",
]
oauth_scopes = ["${concat(var.node_pools_oauth_scopes["all"], var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}"]
}

lifecycle {
Expand Down
4 changes: 1 addition & 3 deletions cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ resource "google_container_node_pool" "zonal_pools" {
service_account = "${lookup(var.node_pools[count.index], "service_account", local.service_account)}"
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"

oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform",
]
oauth_scopes = ["${concat(var.node_pools_oauth_scopes["all"], var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}"]
}

lifecycle {
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ variable "node_pools_tags" {
}
}

variable "node_pools_oauth_scopes" {
type = "map"
description = "Map of lists containing node oauth scopes by node-pool name"

default = {
all = ["https://www.googleapis.com/auth/cloud-platform"]
morgante marked this conversation as resolved.
Show resolved Hide resolved
default-node-pool = []
}
}

variable "stub_domains" {
type = "map"
description = "Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server"
Expand Down