Skip to content

Commit

Permalink
make build
Browse files Browse the repository at this point in the history
  • Loading branch information
bgvdiscord committed Aug 17, 2023
1 parent 24c4ed4 commit accd710
Show file tree
Hide file tree
Showing 54 changed files with 268 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Then perform the following commands on the root folder:
| enable\_binary\_authorization | Enable BinAuthZ Admission controller | `bool` | `false` | no |
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
Expand Down Expand Up @@ -231,6 +232,7 @@ Then perform the following commands on the root folder:
| logging\_service | Logging service used |
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
| master\_version | Current master kubernetes version |
| mesh\_certificates\_config | Mesh certificates configuration |
| min\_master\_version | Minimum master kubernetes version |
| monitoring\_service | Monitoring service used |
| name | Cluster name |
Expand Down
8 changes: 8 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "mesh_certificates" {
for_each = local.cluster_mesh_certificates_config

content {
enable_certificates = mesh_certificates.value.enable_certificates
}
}

dynamic "authenticator_groups_config" {
for_each = local.cluster_authenticator_security_group
content {
Expand Down
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ locals {
cluster_workload_identity_config = !local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
workload_pool = "${var.project_id}.svc.id.goog" }] : [{ workload_pool = var.identity_namespace
}]
cluster_mesh_certificates_config = !local.workload_identity_enabled ? [] : [{
enable_certificates = var.enable_mesh_certificates
}]


cluster_maintenance_window_is_recurring = var.maintenance_recurrence != "" && var.maintenance_end_time != "" ? [1] : []
cluster_maintenance_window_is_daily = length(local.cluster_maintenance_window_is_recurring) > 0 ? [] : [1]
Expand Down
2 changes: 1 addition & 1 deletion modules/acm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ data "google_client_config" "default" {}
| install\_template\_library | Whether to install the default Policy Controller template library | `bool` | `true` | no |
| location | GCP location used to reach cluster. | `string` | n/a | yes |
| metrics\_gcp\_sa\_name | The name of the Google service account for ACM metrics writing | `string` | `"acm-metrics-writer"` | no |
| policy\_bundles | A list of Policy Controller policy bundles git urls (example: <https://github.com/GoogleCloudPlatform/acm-policy-controller-library.git/bundles/policy-essentials-v2022>) to install on the cluster. | `list(string)` | `[]` | no |
| policy\_bundles | A list of Policy Controller policy bundles git urls (example: https://github.com/GoogleCloudPlatform/acm-policy-controller-library.git/bundles/policy-essentials-v2022) to install on the cluster. | `list(string)` | `[]` | no |
| policy\_dir | Subfolder containing configs in ACM Git repo. If un-set, uses Config Management default. | `string` | `""` | no |
| project\_id | GCP project\_id used to reach cluster. | `string` | n/a | yes |
| secret\_type | git authentication secret type, is passed through to ConfigManagement spec.git.secretType. Overriden to value 'ssh' if `create_ssh_key` is true | `string` | `"ssh"` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Then perform the following commands on the root folder:
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
| master\_ipv4\_cidr\_block | The IP range in CIDR notation used for the hosted master network |
| master\_version | Current master kubernetes version |
| mesh\_certificates\_config | Mesh certificates configuration |
| min\_master\_version | Minimum master kubernetes version |
| monitoring\_service | Monitoring service used |
| name | Cluster name |
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ resource "google_container_cluster" "primary" {
}



dynamic "authenticator_groups_config" {
for_each = local.cluster_authenticator_security_group
content {
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-autopilot-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ locals {
cluster_workload_identity_config = !local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
workload_pool = "${var.project_id}.svc.id.goog" }] : [{ workload_pool = var.identity_namespace
}]
cluster_mesh_certificates_config = !local.workload_identity_enabled ? [] : [{
enable_certificates = var.enable_mesh_certificates
}]

# BETA features
cluster_istio_enabled = !local.cluster_output_istio_disabled
cluster_dns_cache_enabled = var.dns_cache
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-autopilot-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ output "identity_namespace" {
]
}

output "mesh_certificates_config" {
description = "Mesh certificates configuration"
value = local.cluster_mesh_certificates_config
depends_on = [
google_container_cluster.primary
]
}

output "master_ipv4_cidr_block" {
description = "The IP range in CIDR notation used for the hosted master network"
value = var.master_ipv4_cidr_block
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ variable "identity_namespace" {
default = "enabled"
}


variable "release_channel" {
type = string
description = "The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`."
Expand Down Expand Up @@ -416,3 +417,4 @@ variable "timeouts" {
}
}


1 change: 1 addition & 0 deletions modules/beta-autopilot-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Then perform the following commands on the root folder:
| logging\_service | Logging service used |
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
| master\_version | Current master kubernetes version |
| mesh\_certificates\_config | Mesh certificates configuration |
| min\_master\_version | Minimum master kubernetes version |
| monitoring\_service | Monitoring service used |
| name | Cluster name |
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ resource "google_container_cluster" "primary" {
}



dynamic "authenticator_groups_config" {
for_each = local.cluster_authenticator_security_group
content {
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-autopilot-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ locals {
cluster_workload_identity_config = !local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
workload_pool = "${var.project_id}.svc.id.goog" }] : [{ workload_pool = var.identity_namespace
}]
cluster_mesh_certificates_config = !local.workload_identity_enabled ? [] : [{
enable_certificates = var.enable_mesh_certificates
}]

# BETA features
cluster_istio_enabled = !local.cluster_output_istio_disabled
cluster_dns_cache_enabled = var.dns_cache
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-autopilot-public-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ output "identity_namespace" {
]
}

output "mesh_certificates_config" {
description = "Mesh certificates configuration"
value = local.cluster_mesh_certificates_config
depends_on = [
google_container_cluster.primary
]
}

output "cloudrun_enabled" {
description = "Whether CloudRun enabled"
value = false
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ variable "identity_namespace" {
default = "enabled"
}


variable "release_channel" {
type = string
description = "The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`."
Expand Down Expand Up @@ -386,3 +387,4 @@ variable "timeouts" {
}
}


2 changes: 2 additions & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ Then perform the following commands on the root folder:
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. Pod Security Policy was removed from GKE clusters with version >= 1.25.0. | `bool` | `false` | no |
| enable\_private\_endpoint | (Beta) Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
Expand Down Expand Up @@ -290,6 +291,7 @@ Then perform the following commands on the root folder:
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
| master\_ipv4\_cidr\_block | The IP range in CIDR notation used for the hosted master network |
| master\_version | Current master kubernetes version |
| mesh\_certificates\_config | Mesh certificates configuration |
| min\_master\_version | Minimum master kubernetes version |
| monitoring\_service | Monitoring service used |
| name | Cluster name |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "mesh_certificates" {
for_each = local.cluster_mesh_certificates_config

content {
enable_certificates = mesh_certificates.value.enable_certificates
}
}

dynamic "authenticator_groups_config" {
for_each = local.cluster_authenticator_security_group
content {
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ locals {
cluster_workload_identity_config = !local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
workload_pool = "${var.project_id}.svc.id.goog" }] : [{ workload_pool = var.identity_namespace
}]
cluster_mesh_certificates_config = !local.workload_identity_enabled ? [] : [{
enable_certificates = var.enable_mesh_certificates
}]

# BETA features
cluster_istio_enabled = !local.cluster_output_istio_disabled
cluster_dns_cache_enabled = var.dns_cache
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ output "identity_namespace" {
]
}

output "mesh_certificates_config" {
description = "Mesh certificates configuration"
value = local.cluster_mesh_certificates_config
depends_on = [
google_container_cluster.primary
]
}

output "master_ipv4_cidr_block" {
description = "The IP range in CIDR notation used for the hosted master network"
value = var.master_ipv4_cidr_block
Expand Down
8 changes: 7 additions & 1 deletion modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@ variable "identity_namespace" {
default = "enabled"
}

variable "enable_mesh_certificates" {
type = bool
default = false
description = "Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity."
}

variable "release_channel" {
type = string
description = "The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`."
Expand Down Expand Up @@ -712,7 +718,6 @@ variable "enable_pod_security_policy" {
default = false
}


variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster"
Expand All @@ -736,3 +741,4 @@ variable "enable_identity_service" {
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
default = false
}

2 changes: 2 additions & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Then perform the following commands on the root folder:
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. Pod Security Policy was removed from GKE clusters with version >= 1.25.0. | `bool` | `false` | no |
| enable\_private\_endpoint | (Beta) Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
Expand Down Expand Up @@ -268,6 +269,7 @@ Then perform the following commands on the root folder:
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
| master\_ipv4\_cidr\_block | The IP range in CIDR notation used for the hosted master network |
| master\_version | Current master kubernetes version |
| mesh\_certificates\_config | Mesh certificates configuration |
| min\_master\_version | Minimum master kubernetes version |
| monitoring\_service | Monitoring service used |
| name | Cluster name |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "mesh_certificates" {
for_each = local.cluster_mesh_certificates_config

content {
enable_certificates = mesh_certificates.value.enable_certificates
}
}

dynamic "authenticator_groups_config" {
for_each = local.cluster_authenticator_security_group
content {
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ locals {
cluster_workload_identity_config = !local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
workload_pool = "${var.project_id}.svc.id.goog" }] : [{ workload_pool = var.identity_namespace
}]
cluster_mesh_certificates_config = !local.workload_identity_enabled ? [] : [{
enable_certificates = var.enable_mesh_certificates
}]

# BETA features
cluster_istio_enabled = !local.cluster_output_istio_disabled
cluster_dns_cache_enabled = var.dns_cache
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ output "identity_namespace" {
]
}

output "mesh_certificates_config" {
description = "Mesh certificates configuration"
value = local.cluster_mesh_certificates_config
depends_on = [
google_container_cluster.primary
]
}

output "master_ipv4_cidr_block" {
description = "The IP range in CIDR notation used for the hosted master network"
value = var.master_ipv4_cidr_block
Expand Down
8 changes: 7 additions & 1 deletion modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@ variable "identity_namespace" {
default = "enabled"
}

variable "enable_mesh_certificates" {
type = bool
default = false
description = "Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity."
}

variable "release_channel" {
type = string
description = "The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`."
Expand Down Expand Up @@ -712,7 +718,6 @@ variable "enable_pod_security_policy" {
default = false
}


variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster"
Expand All @@ -736,3 +741,4 @@ variable "enable_identity_service" {
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
default = false
}

2 changes: 2 additions & 0 deletions modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Then perform the following commands on the root folder:
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. Pod Security Policy was removed from GKE clusters with version >= 1.25.0. | `bool` | `false` | no |
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
Expand Down Expand Up @@ -278,6 +279,7 @@ Then perform the following commands on the root folder:
| logging\_service | Logging service used |
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
| master\_version | Current master kubernetes version |
| mesh\_certificates\_config | Mesh certificates configuration |
| min\_master\_version | Minimum master kubernetes version |
| monitoring\_service | Monitoring service used |
| name | Cluster name |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "mesh_certificates" {
for_each = local.cluster_mesh_certificates_config

content {
enable_certificates = mesh_certificates.value.enable_certificates
}
}

dynamic "authenticator_groups_config" {
for_each = local.cluster_authenticator_security_group
content {
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-public-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ locals {
cluster_workload_identity_config = !local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
workload_pool = "${var.project_id}.svc.id.goog" }] : [{ workload_pool = var.identity_namespace
}]
cluster_mesh_certificates_config = !local.workload_identity_enabled ? [] : [{
enable_certificates = var.enable_mesh_certificates
}]

# BETA features
cluster_istio_enabled = !local.cluster_output_istio_disabled
cluster_dns_cache_enabled = var.dns_cache
Expand Down
Loading

0 comments on commit accd710

Please sign in to comment.