Skip to content

Commit

Permalink
Set auto_provisioning_defaults.service_account
Browse files Browse the repository at this point in the history
This sets the Service Account that should be used by node VMs created by
node auto-provisioning. This should cause the auto-provisioned nodes to
have the same permissions as the nodes that are manually provisioned.
  • Loading branch information
dpetersen committed Aug 24, 2020
1 parent 7fc3b48 commit 4bed7e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ resource "google_container_cluster" "primary" {

{% if beta_cluster %}
cluster_autoscaling {
enabled = var.cluster_autoscaling.enabled
enabled = var.cluster_autoscaling.enabled
auto_provisioning_defaults {
service_account = local.service_account
}
autoscaling_profile = var.cluster_autoscaling.autoscaling_profile != null ? var.cluster_autoscaling.autoscaling_profile : "BALANCED"
dynamic "resource_limits" {
for_each = local.autoscalling_resource_limits
Expand Down
2 changes: 1 addition & 1 deletion autogen/main/sa.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ locals {
["dummy"],
),
)
// if user set var.service_accont it will be used even if var.create_service_account==true, so service account will be created but not used
// if user set var.service_account it will be used even if var.create_service_account==true, so service account will be created but not used
service_account = (var.service_account == "" || var.service_account == "create") && var.create_service_account ? local.service_account_list[0] : var.service_account
}

Expand Down

0 comments on commit 4bed7e6

Please sign in to comment.