Skip to content

Commit

Permalink
Allow using K8s SAs as Google IAM SAs
Browse files Browse the repository at this point in the history
  • Loading branch information
pst committed Jun 28, 2019
1 parent 3c54b66 commit 584f5c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
7 changes: 6 additions & 1 deletion google/_modules/gke/cluster.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
resource "google_container_cluster" "current" {
provider = "google-beta"

project = var.project
name = var.metadata_name

Expand All @@ -21,6 +23,10 @@ resource "google_container_cluster" "current" {
}
}

workload_identity_config {
identity_namespace = "${var.project}.svc.id.goog"
}

network = google_compute_network.current.self_link

#
Expand Down Expand Up @@ -54,4 +60,3 @@ resource "google_container_cluster" "current" {
}
}
}

7 changes: 6 additions & 1 deletion google/_modules/gke/node_pool/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
resource "google_container_node_pool" "current" {
provider = "google-beta"

name = var.pool_name
project = var.project
cluster = var.metadata_name
Expand Down Expand Up @@ -29,11 +31,14 @@ resource "google_container_node_pool" "current" {
labels = var.metadata_labels

tags = var.metadata_tags

workload_metadata_config {
node_metadata = "GKE_METADATA_SERVER"
}
}

management {
auto_repair = var.auto_repair
auto_upgrade = var.auto_upgrade
}
}

7 changes: 5 additions & 2 deletions google/cluster/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ provider "external" {
}

provider "google" {
version = "~> 2.8"
version = "~> 2.9"
}

provider "google-beta" {
version = "~> 2.9"
}

provider "kubernetes" {
Expand All @@ -17,4 +21,3 @@ provider "null" {
provider "template" {
version = "~> 2.1"
}

0 comments on commit 584f5c4

Please sign in to comment.