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

Create Google Container Registry if specified #153

Closed
Closed
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
12 changes: 12 additions & 0 deletions google/_modules/gke/container_registry.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "google_container_registry" "registry" {
count = var.disable_container_registry ? 0 : 1

project = var.project
location = var.location
}

resource "google_storage_bucket_iam_member" "viewer" {
bucket = google_container_registry.registry.id
role = "roles/storage.objectViewer"
member = "serviceAccount:${google_service_account.current.email}"
}
2 changes: 2 additions & 0 deletions google/cluster/configuration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@ locals {

# by default include cloud_nat when private nodes are enabled
enable_cloud_nat = lookup(local.cfg, "enable_cloud_nat", local.enable_private_nodes)

disable_container_registry = lookup(local.cfg, "disable_container_registry", true)
}
8 changes: 5 additions & 3 deletions google/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ module "cluster" {

disable_default_ingress = local.disable_default_ingress

enable_private_nodes = local.enable_private_nodes
master_cidr_block = local.master_cidr_block
enable_cloud_nat = local.enable_cloud_nat
enable_private_nodes = local.enable_private_nodes
master_cidr_block = local.master_cidr_block
enable_cloud_nat = local.enable_cloud_nat

disable_container_registry = local.disable_container_registry
}