Skip to content

Commit

Permalink
revert: Fix attribution for safer cluster modules (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb committed Mar 11, 2021
1 parent 25cf367 commit 31bd14b
Show file tree
Hide file tree
Showing 38 changed files with 34 additions and 151 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ Then perform the following commands on the root folder:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| basic\_auth\_password | The password to be used with Basic Authentication. | `string` | `""` | no |
Expand Down
6 changes: 0 additions & 6 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,3 @@ variable "enable_tpu" {
default = false
}
{% endif %}

variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
8 changes: 2 additions & 6 deletions autogen/main/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
{% set module_path_str = module_path|string %}
{% set module_registry_name = module_path_str.split('/')[-1] %}

locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

Expand All @@ -36,7 +32,7 @@ terraform {
}
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v13.0.0"
}
{% else %}
required_providers {
Expand All @@ -50,7 +46,7 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v13.0.0"
}
{% endif %}
}
2 changes: 0 additions & 2 deletions autogen/safer-cluster/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,4 @@ module "gke" {
gce_pd_csi_driver = var.gce_pd_csi_driver

notification_config_topic = var.notification_config_topic

_parent_module = local.blueprint_name
}
6 changes: 0 additions & 6 deletions autogen/safer-cluster/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,3 @@ variable "notification_config_topic" {
description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}."
default = ""
}

variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions autogen/safer-cluster/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@
{% set module_path_str = module_path|string %}
{% set module_registry_name = module_path_str.split('/')[-1] %}

locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

provider_meta "google-beta" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v13.0.0"
}
}
1 change: 1 addition & 0 deletions examples/safer_cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This example illustrates how to instantiate the opinionated Safer Cluster module

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | `string` | n/a | yes |
| project\_id | The project ID to host the cluster in | `string` | n/a | yes |
| region | The region to host the cluster in | `string` | `"us-central1"` | no |

Expand Down
25 changes: 13 additions & 12 deletions examples/safer_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,19 @@ provider "kubernetes" {
}

module "gke" {
source = "../../modules/safer-cluster/"
project_id = var.project_id
name = "${local.cluster_type}-cluster-${random_string.suffix.result}"
regional = true
region = var.region
network = module.gcp-network.network_name
subnetwork = local.subnet_names[index(module.gcp-network.subnets_names, local.subnet_name)]
ip_range_pods = local.pods_range_name
ip_range_services = local.svc_range_name
master_ipv4_cidr_block = "172.16.0.0/28"
add_cluster_firewall_rules = true
firewall_inbound_ports = ["9443", "15017"]
source = "../../modules/safer-cluster/"
project_id = var.project_id
name = "${local.cluster_type}-cluster-${random_string.suffix.result}"
regional = true
region = var.region
network = module.gcp-network.network_name
subnetwork = local.subnet_names[index(module.gcp-network.subnets_names, local.subnet_name)]
ip_range_pods = local.pods_range_name
ip_range_services = local.svc_range_name
compute_engine_service_account = var.compute_engine_service_account
master_ipv4_cidr_block = "172.16.0.0/28"
add_cluster_firewall_rules = true
firewall_inbound_ports = ["9443", "15017"]

master_authorized_networks = [
{
Expand Down
5 changes: 5 additions & 0 deletions examples/safer_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ variable "region" {
description = "The region to host the cluster in"
default = "us-central1"
}

variable "compute_engine_service_account" {
type = string
description = "Service account to associate to the nodes in the cluster"
}
1 change: 0 additions & 1 deletion modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ Then perform the following commands on the root folder:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com | `string` | `null` | no |
Expand Down
6 changes: 0 additions & 6 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,3 @@ variable "enable_tpu" {
description = "Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive!"
default = false
}

variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions modules/beta-private-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/


locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine:beta-private-cluster-update-variant/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

Expand All @@ -33,6 +29,6 @@ terraform {
}
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine:beta-private-cluster-update-variant/v13.0.0"
}
}
1 change: 0 additions & 1 deletion modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ Then perform the following commands on the root folder:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com | `string` | `null` | no |
Expand Down
6 changes: 0 additions & 6 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,3 @@ variable "enable_tpu" {
description = "Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive!"
default = false
}

variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions modules/beta-private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/


locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine:beta-private-cluster/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

Expand All @@ -33,6 +29,6 @@ terraform {
}
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine:beta-private-cluster/v13.0.0"
}
}
1 change: 0 additions & 1 deletion modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ Then perform the following commands on the root folder:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com | `string` | `null` | no |
Expand Down
6 changes: 0 additions & 6 deletions modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,3 @@ variable "enable_tpu" {
description = "Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive!"
default = false
}

variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions modules/beta-public-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/


locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine:beta-public-cluster-update-variant/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

Expand All @@ -33,6 +29,6 @@ terraform {
}
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine:beta-public-cluster-update-variant/v13.0.0"
}
}
1 change: 0 additions & 1 deletion modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ Then perform the following commands on the root folder:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com | `string` | `null` | no |
Expand Down
6 changes: 0 additions & 6 deletions modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,3 @@ variable "enable_tpu" {
description = "Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive!"
default = false
}

variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions modules/beta-public-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/


locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine:beta-public-cluster/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

Expand All @@ -33,6 +29,6 @@ terraform {
}
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine:beta-public-cluster/v13.0.0"
}
}
1 change: 0 additions & 1 deletion modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ Then perform the following commands on the root folder:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| basic\_auth\_password | The password to be used with Basic Authentication. | `string` | `""` | no |
Expand Down
6 changes: 0 additions & 6 deletions modules/private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,3 @@ variable "impersonate_service_account" {
default = ""
}


variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions modules/private-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/


locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine:private-cluster-update-variant/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

Expand All @@ -33,6 +29,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine:private-cluster-update-variant/v13.0.0"
}
}
1 change: 0 additions & 1 deletion modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ Then perform the following commands on the root folder:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| basic\_auth\_password | The password to be used with Basic Authentication. | `string` | `""` | no |
Expand Down
6 changes: 0 additions & 6 deletions modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,3 @@ variable "impersonate_service_account" {
default = ""
}


variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions modules/private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/


locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine:private-cluster/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

Expand All @@ -33,6 +29,6 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine:private-cluster/v13.0.0"
}
}
1 change: 0 additions & 1 deletion modules/safer-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ For simplicity, we suggest using `roles/container.admin` and

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com | `string` | `null` | no |
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
Expand Down
2 changes: 0 additions & 2 deletions modules/safer-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,4 @@ module "gke" {
gce_pd_csi_driver = var.gce_pd_csi_driver

notification_config_topic = var.notification_config_topic

_parent_module = local.blueprint_name
}
6 changes: 0 additions & 6 deletions modules/safer-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,3 @@ variable "notification_config_topic" {
description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}."
default = ""
}

variable "_parent_module" {
type = string
description = "(Internal) Parent module which should be referenced in API calls."
default = ""
}
6 changes: 1 addition & 5 deletions modules/safer-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@
// This file was automatically generated from a template in ./autogen/safer-cluster


locals {
blueprint_name = join("/", compact([var._parent_module, "terraform-google-kubernetes-engine:safer-cluster-update-variant/v14.0.0"]))
}

terraform {
required_version = ">=0.13"

provider_meta "google-beta" {
module_name = "blueprints/terraform/${local.blueprint_name}"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine:safer-cluster-update-variant/v13.0.0"
}
}
1 change: 0 additions & 1 deletion modules/safer-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ For simplicity, we suggest using `roles/container.admin` and

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| \_parent\_module | (Internal) Parent module which should be referenced in API calls. | `string` | `""` | no |
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com | `string` | `null` | no |
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
Expand Down
Loading

0 comments on commit 31bd14b

Please sign in to comment.