Skip to content

Commit

Permalink
Merge branch 'master' into loggingvariant
Browse files Browse the repository at this point in the history
  • Loading branch information
billyfoss authored Aug 28, 2023
2 parents 0a29207 + 2f5a276 commit e5bd9d3
Show file tree
Hide file tree
Showing 137 changed files with 1,915 additions and 496 deletions.
5 changes: 4 additions & 1 deletion .github/conventional-commit-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2022-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,5 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is automatically generated from:
# https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/blob/master/infra/terraform/test-org/github

enabled: true
always_check_pr_title: true
39 changes: 22 additions & 17 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,65 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"config:recommended",
":semanticCommits",
":preserveSemverRanges",
":rebaseStalePrs"
],
"stabilityDays":7,
"minimumReleaseAge": "7 days",
"ignorePaths": [],
"labels": ["dependencies"],
"vulnerabilityAlerts":{
"labels":[
"type:security"
],
"stabilityDays":0
"vulnerabilityAlerts": {
"labels": ["type:security"],
"minimumReleaseAge": null
},
"separateMajorMinor":false,
"constraints": {"go": "1.20"},
"packageRules": [
{
"matchPaths": ["examples/**", "test/**", ".github/**"],
"matchFileNames": ["examples/**", "test/**", ".github/**"],
"extends": [":semanticCommitTypeAll(chore)"]
},
{
"matchPaths": ["*", "modules/**"],
"matchFileNames": ["*", "modules/**"],
"extends": [":semanticCommitTypeAll(fix)"]
},
{
"matchDepTypes": ["module"],
"groupName": "TF modules"
"matchFileNames": ["*", "modules/**"],
"matchUpdateTypes": "major",
"commitMessagePrefix": "fix(deps)!:"
},
{"matchDepTypes": ["module"], "groupName": "TF modules"},
{
"matchDepTypes": ["require"],
"groupName": "GO modules",
"postUpdateOptions": ["gomodTidy"]
},
{
"matchPackageNames": ["go"],
"allowedVersions": "<1.19.0",
"matchDatasources": ["golang-version"],
"rangeStrategy": "bump",
"allowedVersions": "<1.21.0",
"postUpdateOptions": ["gomodTidy"]
},
{
"matchPackageNames": ["google", "google-beta"],
"groupName": "terraform googles"
"groupName": "Terraform Google Provider"
}
],
"regexManagers": [
{
"fileMatch": ["(^|/)Makefile$"],
"matchStrings": ["DOCKER_TAG_VERSION_DEVELOPER_TOOLS := (?<currentValue>.*?)\\n"],
"matchStrings": [
"DOCKER_TAG_VERSION_DEVELOPER_TOOLS := (?<currentValue>.*?)\\n"
],
"datasourceTemplate": "docker",
"registryUrlTemplate": "https://gcr.io/cloud-foundation-cicd",
"depNameTemplate": "cft/developer-tools"
},
{
"fileMatch": ["(^|/)build/(int|lint)\\.cloudbuild\\.yaml$"],
"matchStrings": [" _DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '(?<currentValue>.*?)'\\n"],
"matchStrings": [
" _DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '(?<currentValue>.*?)'\\n"
],
"datasourceTemplate": "docker",
"registryUrlTemplate": "https://gcr.io/cloud-foundation-cicd",
"depNameTemplate": "cft/developer-tools"
Expand Down
3 changes: 3 additions & 0 deletions .github/trusted-contribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is automatically generated from:
# https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/blob/master/infra/terraform/test-org/github

annotations:
- type: comment
text: "/gcbrun"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- id: variables
run: |
MAKEFILE=$(find . -name Makefile -print -quit)
if [ ! -z "$MAKEFILE" ]; then
if [ -z "$MAKEFILE" ]; then
echo dev-tools=gcr.io/cloud-foundation-cicd/cft/developer-tools:1 >> "$GITHUB_OUTPUT"
else
VERSION=$(grep "DOCKER_TAG_VERSION_DEVELOPER_TOOLS := " $MAKEFILE | cut -d\ -f3)
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2022-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,18 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is automatically generated from:
# https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/blob/master/infra/terraform/test-org/github

name: "Close stale issues"
on:
schedule:
- cron: "0 23 * * *"

jobs:
stale:
if: github.repository_owner == 'GoogleCloudPlatform' || github.repository_owner == 'terraform-google-modules'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
exempt-issue-labels: triaged
exempt-issue-labels: triaged,dependencies
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,46 @@ 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.

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


### ⚠ BREAKING CHANGES

* **TPG>=4.32.0:** Support enabling Policy Controller mutations ([#1665](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1665))

### Features

* Add protect_config beta feature ([#1617](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1617)) ([d252579](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/d252579613ca44e11ad28a59f930cdb42dea2c29))
* **cluster.tf:** add support to set initial release channel version ([#1625](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1625)) ([e522073](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/e522073f24067359f8af1bd2ddc9092b594fb945))
* **TPG>=4.32.0:** Support enabling Policy Controller mutations ([#1665](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1665)) ([1173518](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/11735188d5f8890363344924992d2d0dd97642e1))


### Bug Fixes

* extend acm wait when policy bundles are present ([#1657](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1657)) ([e51804e](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/e51804ed4849fa85748a95ca169b92445d258d91))
* set max firewall name to 36 ([#1645](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1645)) ([29d9259](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/29d925997ec0fd5ecbd6dd5792f220fc48a5725b))
* update policy-essentials hash 59f4695 using ref ([#1659](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1659)) ([2fe1715](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/2fe171500c3496eb88b9fdf83318b0927d225e4b))

## [26.1.1](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v26.1.0...v26.1.1) (2023-05-22)


### Bug Fixes

* correct TPG version constraint ([#1637](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1637)) ([#1640](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1640)) ([14eac9f](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/14eac9f91a90245d3e00d05a8653f334eb8966ec))

## [26.1.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v26.0.0...v26.1.0) (2023-05-16)


### Features

* Add timeouts variable for safer cluster module ([#1613](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1613)) ([146b2e7](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/146b2e7b0a3385a5f0864a003abd8bee8bec2bc7))


### Bug Fixes

* allow ACM module to work w/o metrics sa ([#1634](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1634)) ([83a8be2](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/83a8be24ee1bf84371714f49f8c904d3d94492d6))
* avoid TPG 4.65.0 and 4.65.1 ([#1637](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1637)) ([ea3e374](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/ea3e374bbf99c86189b5ca428d6c2a2f07bd1e16))

## [26.0.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v25.0.0...v26.0.0) (2023-05-10)


Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# NOTE: This file is automatically generated from values at:
# https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/blob/master/infra/terraform/test-org/org/locals.tf

* @terraform-google-modules/cft-admins @Jberlinsky @ericyz
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ Sub modules are provided for creating private clusters, beta private clusters, a

## Compatibility

This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform `>=0.13`, please open an issue.
This module is meant for use with Terraform 1.3+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform `>=1.3`, please open an issue.

If you haven't [upgraded][terraform-0.13-upgrade] and need a Terraform
If you haven't [upgraded to 1.3][terraform-1.3-upgrade] and need a Terraform
0.13.x-compatible version of this module, the last released version
intended for Terraform 0.13.x is [27.0.0].

If you haven't [upgraded to 0.13][terraform-0.13-upgrade] and need a Terraform
0.12.x-compatible version of this module, the last released version
intended for Terraform 0.12.x is [12.3.0].

Expand Down Expand Up @@ -132,12 +136,13 @@ Then perform the following commands on the root folder:
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `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 [email protected] | `string` | `null` | no |
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
| cluster\_dns\_scope | The scope of access to cluster DNS records. DNS\_SCOPE\_UNSPECIFIED (default) or CLUSTER\_SCOPE or VPC\_SCOPE. | `string` | `"DNS_SCOPE_UNSPECIFIED"` | no |
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
Expand All @@ -159,6 +164,7 @@ Then perform the following commands on the root folder:
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
| gcs\_fuse\_csi\_driver | Whether GCE FUSE CSI driver is enabled for this cluster. | `bool` | `false` | no |
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
Expand Down Expand Up @@ -319,7 +325,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
#### Kubectl
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 0.13+
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP][terraform-provider-google] v4.51
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
Expand Down Expand Up @@ -348,3 +354,4 @@ In order to operate with the Service Account you must activate the following API
[terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html
[terraform-1.3-upgrade]: https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides
13 changes: 9 additions & 4 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ The implications of this are that:
{% endif %}
## Compatibility

This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform `>=0.13`, please open an issue.
This module is meant for use with Terraform 1.3+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform `>=1.3`, please open an issue.

If you haven't [upgraded][terraform-0.13-upgrade] and need a Terraform
If you haven't [upgraded to 1.3][terraform-1.3-upgrade] and need a Terraform
0.13.x-compatible version of this module, the last released version
intended for Terraform 0.13.x is [27.0.0].

If you haven't [upgraded to 0.13][terraform-0.13-upgrade] and need a Terraform
0.12.x-compatible version of this module, the last released version
intended for Terraform 0.12.x is [12.3.0].

Expand Down Expand Up @@ -266,7 +270,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
#### Kubectl
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 0.13+
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
{% if beta_cluster %}
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51
{% else %}
Expand Down Expand Up @@ -303,3 +307,4 @@ In order to operate with the Service Account you must activate the following API
{% endif %}
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html
[terraform-1.3-upgrade]: https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides
28 changes: 23 additions & 5 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ resource "google_container_cluster" "primary" {
disabled = var.disable_default_snat
}

min_master_version = var.release_channel == null || var.release_channel == "UNSPECIFIED" ? local.master_version : null
min_master_version = var.release_channel == null || var.release_channel == "UNSPECIFIED" ? local.master_version : var.kubernetes_version == "latest" ? null : var.kubernetes_version

{% if beta_cluster and autopilot_cluster != true %}
dynamic "cluster_telemetry" {
Expand Down Expand Up @@ -141,6 +141,9 @@ resource "google_container_cluster" "primary" {
auto_upgrade = lookup(var.cluster_autoscaling, "auto_upgrade",true)
}

disk_size = lookup(var.cluster_autoscaling, "disk_size", 100)
disk_type = lookup(var.cluster_autoscaling, "disk_type", "pd-standard")

{% if beta_cluster %}
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
{% endif %}
Expand Down Expand Up @@ -283,6 +286,18 @@ resource "google_container_cluster" "primary" {
enabled = gke_backup_agent_config.value.enabled
}
}

dynamic "gcs_fuse_csi_driver_config" {
for_each = local.gcs_fuse_csi_driver_config

content {
enabled = gcs_fuse_csi_driver_config.value.enabled
}
}

config_connector_config {
enabled = var.config_connector
}
{% endif %}
{% if beta_cluster and autopilot_cluster != true %}

Expand All @@ -302,10 +317,6 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = var.kalm_config
}

config_connector_config {
enabled = var.config_connector
}
{% endif %}
}
{% if autopilot_cluster != true %}
Expand All @@ -315,6 +326,13 @@ resource "google_container_cluster" "primary" {

{% if beta_cluster %}
networking_mode = "VPC_NATIVE"

protect_config {
workload_config {
audit_mode = var.workload_config_audit_mode
}
workload_vulnerability_mode = var.workload_vulnerability_mode
}
{% endif %}
ip_allocation_policy {
cluster_secondary_range_name = var.ip_range_pods
Expand Down
Loading

0 comments on commit e5bd9d3

Please sign in to comment.