Skip to content

Commit

Permalink
Allow overriding oAuth scopes for NAP pools
Browse files Browse the repository at this point in the history
The defaults I included come from the scopes I observed in a cluster I
stood up when no scopes were specified. I am assuming these are GKE
defaults. This does not match the default scopes for normal node pools
in this Terraform module, so it may not be the correct choice.
  • Loading branch information
dpetersen committed Sep 21, 2020
1 parent c288db9 commit f5e85e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ resource "google_container_cluster" "primary" {
enabled = var.cluster_autoscaling.enabled
auto_provisioning_defaults {
service_account = local.service_account
oauth_scopes = var.cluster_autoscaling.oauth_scopes
}
autoscaling_profile = var.cluster_autoscaling.autoscaling_profile != null ? var.cluster_autoscaling.autoscaling_profile : "BALANCED"
dynamic "resource_limits" {
Expand Down
5 changes: 5 additions & 0 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ variable "cluster_autoscaling" {
max_cpu_cores = number
min_memory_gb = number
max_memory_gb = number
oauth_scopes = list(string)
})
default = {
enabled = false
Expand All @@ -224,6 +225,10 @@ variable "cluster_autoscaling" {
min_cpu_cores = 0
max_memory_gb = 0
min_memory_gb = 0
oauth_scopes = [
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring"
]
}
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
}
Expand Down

0 comments on commit f5e85e0

Please sign in to comment.