Skip to content

Commit

Permalink
Merge branch 'master' into add-dual-stack-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jmymy authored Sep 21, 2023
2 parents 140ab0e + 74d612f commit 603e571
Show file tree
Hide file tree
Showing 103 changed files with 572 additions and 184 deletions.
8 changes: 4 additions & 4 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
":rebaseStalePrs"
],
"minimumReleaseAge": "7 days",
"ignorePaths": [],
"ignorePaths": [".github/workflows/lint.yaml", ".github/workflows/stale.yml"],
"labels": ["dependencies"],
"vulnerabilityAlerts": {
"labels": ["type:security"],
Expand All @@ -17,11 +17,11 @@
"packageRules": [
{
"matchFileNames": ["examples/**", "test/**", ".github/**"],
"extends": [":semanticCommitTypeAll(chore)"]
"commitMessagePrefix": "chore(deps):"
},
{
"matchFileNames": ["*", "modules/**"],
"extends": [":semanticCommitTypeAll(fix)"]
"commitMessagePrefix": "fix(deps):"
},
{
"matchFileNames": ["*", "modules/**"],
Expand All @@ -41,7 +41,7 @@
"postUpdateOptions": ["gomodTidy"]
},
{
"matchPackageNames": ["google", "google-beta"],
"matchDepNames": ["google", "google-beta"],
"groupName": "Terraform Google Provider"
}
],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: 'lint'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'
- id: variables
run: |
MAKEFILE=$(find . -name Makefile -print -quit)
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Extending the adopted spec, each change should have a link to its corresponding pull request appended.

## [28.0.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v27.0.0...v28.0.0) (2023-09-20)


### ⚠ BREAKING CHANGES

* support gcs fuse addon ([#1722](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1722))
* Add support for disk_size and disk_type for cluster_autoscaling. ([#1693](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1693))

### Features

* add project and location output to fleet-membership ([#1740](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1740)) ([825bda6](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/825bda616c6bb28cf56a0b59f5833e3fecdd9eb5))
* Add support for disk_size and disk_type for cluster_autoscaling. ([#1693](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1693)) ([fd233e5](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/fd233e5cddd9098b6e6520b0671eb16f77a5c187))
* Add support for Logging Variant to enable max throughput option ([#1616](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1616)) ([acd2d41](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/acd2d410c550a3fbca0cac400d1d07e2d3dc5cd8))
* mesh_certificates support ([#1712](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1712)) ([8913ef2](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/8913ef27d6c97ae2c57d747ff29ca175a15833e7))
* promote config_connector_config to ga ([#1559](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1559)) ([ae63848](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/ae6384899909cea52f1f50a140d7c85b335b64eb))
* support configuring ACM git service account email ([#1685](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1685)) ([426f06f](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/426f06f4ecbc4816cac5cad4e2a0b35a58d426b3))
* support gcs fuse addon ([#1722](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1722)) ([2f5a276](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/2f5a2769fada01333b178d0bc9ec1e8192535043))


### Bug Fixes

* random zones only when zones are not provided ([#1709](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1709)) ([50ea965](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/50ea96505135c390e64482e4af053ee1191697a7))
* regenerate docs ([#1733](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1733)) ([6b927e5](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/6b927e5a918efc681e4ca8705360ed3a05577f96))

## [27.0.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v26.1.1...v27.0.0) (2023-06-29)


Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module "gke" {
image_type = "COS_CONTAINERD"
enable_gcfs = false
enable_gvnic = false
logging_variant = "DEFAULT"
auto_repair = true
auto_upgrade = true
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
Expand Down Expand Up @@ -154,6 +155,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 @@ -238,6 +240,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 Expand Up @@ -278,6 +281,7 @@ The node_pools variable takes the following parameters:
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
| key | The key required for the taint | | Required |
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
| min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional |
Expand Down
2 changes: 2 additions & 0 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ module "gke" {
image_type = "COS_CONTAINERD"
enable_gcfs = false
enable_gvnic = false
logging_variant = "DEFAULT"
auto_repair = true
auto_upgrade = true
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
Expand Down Expand Up @@ -208,6 +209,7 @@ The node_pools variable takes the following parameters:
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
| key | The key required for the taint | | Required |
| logging_variant | The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. | DEFAULT | Optional |
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |
{% if beta_cluster %}
| local_ssd_ephemeral_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
Expand Down
14 changes: 14 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ resource "google_container_cluster" "primary" {
lookup(local.node_pools_tags, var.node_pools[0].name, []),
)

logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")

dynamic "workload_metadata_config" {
for_each = local.cluster_node_metadata_config

Expand Down Expand Up @@ -518,6 +520,16 @@ resource "google_container_cluster" "primary" {
}
{% endif %}

{% if autopilot_cluster != true %}
dynamic "mesh_certificates" {
for_each = local.cluster_mesh_certificates_config

content {
enable_certificates = mesh_certificates.value.enable_certificates
}
}
{% endif %}

dynamic "authenticator_groups_config" {
for_each = local.cluster_authenticator_security_group
content {
Expand Down Expand Up @@ -787,6 +799,8 @@ resource "google_container_node_pool" "windows_pools" {
local.node_pools_tags[each.value["name"]],
)

logging_variant = lookup(each.value, "logging_variant", "DEFAULT")

local_ssd_count = lookup(each.value, "local_ssd_count", 0)
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
disk_type = lookup(each.value, "disk_type", "pd-standard")
Expand Down
6 changes: 6 additions & 0 deletions autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ 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
}]
{% if autopilot_cluster != true %}
cluster_mesh_certificates_config = local.workload_identity_enabled ? [{
enable_certificates = var.enable_mesh_certificates
}] : []
{% endif %}

{% if beta_cluster %}
# BETA features
cluster_istio_enabled = ! local.cluster_output_istio_disabled
Expand Down
11 changes: 11 additions & 0 deletions autogen/main/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ output "identity_namespace" {
google_container_cluster.primary
]
}

{% if autopilot_cluster != true %}
output "mesh_certificates_config" {
description = "Mesh certificates configuration"
value = local.cluster_mesh_certificates_config
depends_on = [
google_container_cluster.primary
]
}
{% endif %}

{% if private_cluster %}

output "master_ipv4_cidr_block" {
Expand Down
9 changes: 8 additions & 1 deletion autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,14 @@ variable "identity_namespace" {
default = "enabled"
}

{% if autopilot_cluster != true %}
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."
}
{% endif %}

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 @@ -769,7 +777,6 @@ variable "enable_pod_security_policy" {
default = false
}


variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster"
Expand Down
4 changes: 2 additions & 2 deletions autogen/main/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ terraform {
}
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v27.0.0"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v28.0.0"
}
{% else %}
required_providers {
Expand All @@ -58,7 +58,7 @@ terraform {
}
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v27.0.0"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v28.0.0"
}
{% endif %}
}
3 changes: 3 additions & 0 deletions autogen/safer-cluster/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ module "gke" {
// We enable Workload Identity by default.
identity_namespace = "${var.project_id}.svc.id.goog"

// Enabling mesh certificates requires Workload Identity
enable_mesh_certificates = var.enable_mesh_certificates

authenticator_security_group = var.authenticator_security_group

enable_shielded_nodes = var.enable_shielded_nodes
Expand Down
5 changes: 5 additions & 0 deletions autogen/safer-cluster/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = module.gke.peering_name
}

output "enable_mesh_certificates" {
description = "Mesh certificate configuration value"
value = var.enable_mesh_certificates
}
6 changes: 6 additions & 0 deletions autogen/safer-cluster/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,9 @@ variable "timeouts" {
error_message = "Only create, update, delete timeouts can be specified."
}
}

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."
}
2 changes: 1 addition & 1 deletion autogen/safer-cluster/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ terraform {
required_version = ">=1.3"

provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v27.0.0"
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v28.0.0"
}
}
4 changes: 2 additions & 2 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestSimpleRegional --stage verify --verbose']
- id: destroy simple-regional-local
waitFor:
- apply simple-regional-local
- verify simple-regional-local
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestSimpleRegional --stage teardown --verbose']
- id: init simple-regional-private-local
Expand Down Expand Up @@ -443,7 +443,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivate --stage verify --verbose']
- id: destroy simple-autopilot-private-local
waitFor:
- apply simple-autopilot-private-local
- verify simple-autopilot-private-local
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivate --stage teardown --verbose']
- id: init simple-autopilot-public-local
Expand Down
14 changes: 14 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ resource "google_container_cluster" "primary" {
lookup(local.node_pools_tags, var.node_pools[0].name, []),
)

logging_variant = lookup(var.node_pools[0], "logging_variant", "DEFAULT")

dynamic "workload_metadata_config" {
for_each = local.cluster_node_metadata_config

Expand Down Expand Up @@ -360,6 +362,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 Expand Up @@ -493,6 +503,8 @@ resource "google_container_node_pool" "pools" {
local.node_pools_tags[each.value["name"]],
)

logging_variant = lookup(each.value, "logging_variant", "DEFAULT")

local_ssd_count = lookup(each.value, "local_ssd_count", 0)
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
disk_type = lookup(each.value, "disk_type", "pd-standard")
Expand Down Expand Up @@ -679,6 +691,8 @@ resource "google_container_node_pool" "windows_pools" {
local.node_pools_tags[each.value["name"]],
)

logging_variant = lookup(each.value, "logging_variant", "DEFAULT")

local_ssd_count = lookup(each.value, "local_ssd_count", 0)
disk_size_gb = lookup(each.value, "disk_size_gb", 100)
disk_type = lookup(each.value, "disk_type", "pd-standard")
Expand Down
23 changes: 11 additions & 12 deletions examples/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,17 @@ module "gke" {
auto_upgrade = true
},
{
name = "pool-02"
machine_type = "a2-highgpu-1g"
min_count = 1
max_count = 2
local_ssd_count = 0
disk_size_gb = 30
disk_type = "pd-standard"
accelerator_count = 1
accelerator_type = "nvidia-tesla-a100"
gpu_partition_size = "1g.5gb"
auto_repair = false
service_account = var.compute_engine_service_account
name = "pool-02"
machine_type = "n1-standard-2"
min_count = 1
max_count = 2
local_ssd_count = 0
disk_size_gb = 30
disk_type = "pd-standard"
accelerator_count = 1
accelerator_type = "nvidia-tesla-p4"
auto_repair = false
service_account = var.compute_engine_service_account
},
{
name = "pool-03"
Expand Down
2 changes: 1 addition & 1 deletion examples/safer_cluster_iap_bastion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ To deploy this example:
| router\_name | Name of the router that was created |
| subnet\_name | The name of the VPC subnet being created |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Loading

0 comments on commit 603e571

Please sign in to comment.