Skip to content

Commit 0ac165a

Browse files
authored
Merge pull request terraform-google-modules#216 from Dev25/beta-v1
Add IntraNode Visibility/VerticalPodAutoscaling
2 parents 1394bde + 6de8710 commit 0ac165a

20 files changed

+158
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
Extending the adopted spec, each change should have a link to its corresponding pull request appended.
88

99
## [Unreleased]
10+
### Added
11+
12+
* Support for Intranode Visbiility (IV) and Veritical Pod Autoscaling (VPA) beta features [#216]
1013

1114
## [v4.1.0] 2019-07-24
1215

@@ -164,6 +167,7 @@ Extending the adopted spec, each change should have a link to its corresponding
164167
[v0.3.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.2.0...v0.3.0
165168
[v0.2.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.1.0...v0.2.0
166169

170+
[#216]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/216
167171
[#214]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/214
168172
[#210]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/210
169173
[#207]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/207

autogen/cluster_regional.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ resource "google_container_cluster" "primary" {
5858

5959
{% if beta_cluster %}
6060
enable_binary_authorization = var.enable_binary_authorization
61+
enable_intranode_visibility = var.enable_intranode_visibility
62+
63+
vertical_pod_autoscaling {
64+
enabled = var.enable_vertical_pod_autoscaling
65+
}
6166

6267
dynamic "pod_security_policy_config" {
6368
for_each = var.pod_security_policy_config

autogen/cluster_zonal.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ resource "google_container_cluster" "zonal_primary" {
5454

5555
{% if beta_cluster %}
5656
enable_binary_authorization = var.enable_binary_authorization
57+
enable_intranode_visibility = var.enable_intranode_visibility
58+
59+
vertical_pod_autoscaling {
60+
enabled = var.enable_vertical_pod_autoscaling
61+
}
5762

5863
dynamic "pod_security_policy_config" {
5964
for_each = var.pod_security_policy_config

autogen/main.tf

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,16 @@ locals {
251251
regional = element(concat(google_container_cluster.primary.*.pod_security_policy_config.0.enabled, [""]), 0)
252252
zonal = element(concat(google_container_cluster.zonal_primary.*.pod_security_policy_config.0.enabled, [""]), 0)
253253
}
254+
255+
cluster_type_output_intranode_visbility_enabled = {
256+
regional = element(concat(google_container_cluster.primary.*.enable_intranode_visibility, [""]), 0)
257+
zonal = element(concat(google_container_cluster.zonal_primary.*.enable_intranode_visibility, [""]), 0)
258+
}
259+
260+
cluster_type_output_vertical_pod_autoscaling_enabled = {
261+
regional = element(concat(google_container_cluster.primary.*.vertical_pod_autoscaling.0.enabled, [""]), 0)
262+
zonal = element(concat(google_container_cluster.zonal_primary.*.vertical_pod_autoscaling.0.enabled, [""]), 0)
263+
}
254264
# /BETA features
255265
{% endif %}
256266

@@ -286,9 +296,11 @@ locals {
286296
cluster_kubernetes_dashboard_enabled = !local.cluster_type_output_kubernetes_dashboard_enabled[local.cluster_type]
287297
{% if beta_cluster %}
288298
# BETA features
289-
cluster_istio_enabled = !local.cluster_type_output_istio_enabled[local.cluster_type]
290-
cluster_cloudrun_enabled = var.cloudrun
291-
cluster_pod_security_policy_enabled = local.cluster_type_output_pod_security_policy_enabled[local.cluster_type]
299+
cluster_istio_enabled = !local.cluster_type_output_istio_enabled[local.cluster_type]
300+
cluster_cloudrun_enabled = var.cloudrun
301+
cluster_pod_security_policy_enabled = local.cluster_type_output_pod_security_policy_enabled[local.cluster_type]
302+
cluster_intranode_visibility_enabled = local.cluster_type_output_intranode_visbility_enabled[local.cluster_type]
303+
cluster_vertical_pod_autoscaling_enabled = local.cluster_type_output_vertical_pod_autoscaling_enabled[local.cluster_type]
292304
# /BETA features
293305
{% endif %}
294306
}

autogen/outputs.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ output "endpoint" {
5151
* resources dependent on the cluster being up will fail to deploy. With
5252
* this explicit dependency, dependent resources can wait for the cluster
5353
* to be up.
54-
*/
54+
*/
5555
google_container_cluster.primary,
5656
google_container_node_pool.pools,
5757
google_container_cluster.zonal_primary,
@@ -142,4 +142,14 @@ output "pod_security_policy_enabled" {
142142
value = local.cluster_pod_security_policy_enabled
143143
}
144144

145+
output "intranode_visibility_enabled" {
146+
description = "Whether intra-node visibility is enabled"
147+
value = local.cluster_intranode_visibility_enabled
148+
}
149+
150+
output "vertical_pod_autoscaling_enabled" {
151+
description = "Whether veritical pod autoscaling is enabled"
152+
value = local.cluster_vertical_pod_autoscaling_enabled
153+
}
154+
145155
{% endif %}

autogen/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,4 +353,16 @@ variable "node_metadata" {
353353
description = "Specifies how node metadata is exposed to the workload running on the node"
354354
default = "UNSPECIFIED"
355355
}
356+
357+
variable "enable_intranode_visibility" {
358+
type = bool
359+
description = "Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network"
360+
default = false
361+
}
362+
363+
variable "enable_vertical_pod_autoscaling" {
364+
type = bool
365+
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
366+
default = false
367+
}
356368
{% endif %}

modules/beta-private-cluster/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
144144
| description | The description of the cluster | string | `""` | no |
145145
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | bool | `"true"` | no |
146146
| enable\_binary\_authorization | Enable BinAuthZ Admission controller | string | `"false"` | no |
147+
| 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 |
147148
| enable\_private\_endpoint | (Beta) Whether the master's internal IP address is used as the cluster endpoint | bool | `"false"` | no |
148149
| enable\_private\_nodes | (Beta) Whether nodes have internal IP addresses only | bool | `"false"` | no |
150+
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | bool | `"false"` | no |
149151
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | bool | `"true"` | no |
150152
| http\_load\_balancing | Enable httpload balancer addon | bool | `"true"` | no |
151153
| initial\_node\_count | The number of nodes to create in this cluster's default node pool. | number | `"0"` | no |
@@ -196,6 +198,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
196198
| endpoint | Cluster endpoint |
197199
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
198200
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
201+
| intranode\_visibility\_enabled | Whether intra-node visibility is enabled |
199202
| istio\_enabled | Whether Istio is enabled |
200203
| kubernetes\_dashboard\_enabled | Whether kubernetes dashboard enabled |
201204
| location | Cluster location (region if regional cluster, zone if zonal cluster) |
@@ -212,6 +215,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
212215
| region | Cluster region |
213216
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
214217
| type | Cluster type (regional / zonal) |
218+
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |
215219
| zones | List of zones in which the cluster resides |
216220

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

modules/beta-private-cluster/cluster_regional.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ resource "google_container_cluster" "primary" {
5353
monitoring_service = var.monitoring_service
5454

5555
enable_binary_authorization = var.enable_binary_authorization
56+
enable_intranode_visibility = var.enable_intranode_visibility
57+
58+
vertical_pod_autoscaling {
59+
enabled = var.enable_vertical_pod_autoscaling
60+
}
5661

5762
dynamic "pod_security_policy_config" {
5863
for_each = var.pod_security_policy_config

modules/beta-private-cluster/cluster_zonal.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ resource "google_container_cluster" "zonal_primary" {
4949
monitoring_service = var.monitoring_service
5050

5151
enable_binary_authorization = var.enable_binary_authorization
52+
enable_intranode_visibility = var.enable_intranode_visibility
53+
54+
vertical_pod_autoscaling {
55+
enabled = var.enable_vertical_pod_autoscaling
56+
}
5257

5358
dynamic "pod_security_policy_config" {
5459
for_each = var.pod_security_policy_config

modules/beta-private-cluster/main.tf

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,16 @@ locals {
234234
regional = element(concat(google_container_cluster.primary.*.pod_security_policy_config.0.enabled, [""]), 0)
235235
zonal = element(concat(google_container_cluster.zonal_primary.*.pod_security_policy_config.0.enabled, [""]), 0)
236236
}
237+
238+
cluster_type_output_intranode_visbility_enabled = {
239+
regional = element(concat(google_container_cluster.primary.*.enable_intranode_visibility, [""]), 0)
240+
zonal = element(concat(google_container_cluster.zonal_primary.*.enable_intranode_visibility, [""]), 0)
241+
}
242+
243+
cluster_type_output_vertical_pod_autoscaling_enabled = {
244+
regional = element(concat(google_container_cluster.primary.*.vertical_pod_autoscaling.0.enabled, [""]), 0)
245+
zonal = element(concat(google_container_cluster.zonal_primary.*.vertical_pod_autoscaling.0.enabled, [""]), 0)
246+
}
237247
# /BETA features
238248

239249
cluster_type_output_node_pools_names = {
@@ -267,9 +277,11 @@ locals {
267277
cluster_horizontal_pod_autoscaling_enabled = ! local.cluster_type_output_horizontal_pod_autoscaling_enabled[local.cluster_type]
268278
cluster_kubernetes_dashboard_enabled = ! local.cluster_type_output_kubernetes_dashboard_enabled[local.cluster_type]
269279
# BETA features
270-
cluster_istio_enabled = ! local.cluster_type_output_istio_enabled[local.cluster_type]
271-
cluster_cloudrun_enabled = var.cloudrun
272-
cluster_pod_security_policy_enabled = local.cluster_type_output_pod_security_policy_enabled[local.cluster_type]
280+
cluster_istio_enabled = ! local.cluster_type_output_istio_enabled[local.cluster_type]
281+
cluster_cloudrun_enabled = var.cloudrun
282+
cluster_pod_security_policy_enabled = local.cluster_type_output_pod_security_policy_enabled[local.cluster_type]
283+
cluster_intranode_visibility_enabled = local.cluster_type_output_intranode_visbility_enabled[local.cluster_type]
284+
cluster_vertical_pod_autoscaling_enabled = local.cluster_type_output_vertical_pod_autoscaling_enabled[local.cluster_type]
273285
# /BETA features
274286
}
275287

modules/beta-private-cluster/outputs.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ output "endpoint" {
5151
* resources dependent on the cluster being up will fail to deploy. With
5252
* this explicit dependency, dependent resources can wait for the cluster
5353
* to be up.
54-
*/
54+
*/
5555
google_container_cluster.primary,
5656
google_container_node_pool.pools,
5757
google_container_cluster.zonal_primary,
@@ -141,3 +141,13 @@ output "pod_security_policy_enabled" {
141141
value = local.cluster_pod_security_policy_enabled
142142
}
143143

144+
output "intranode_visibility_enabled" {
145+
description = "Whether intra-node visibility is enabled"
146+
value = local.cluster_intranode_visibility_enabled
147+
}
148+
149+
output "vertical_pod_autoscaling_enabled" {
150+
description = "Whether veritical pod autoscaling is enabled"
151+
value = local.cluster_vertical_pod_autoscaling_enabled
152+
}
153+

modules/beta-private-cluster/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,15 @@ variable "node_metadata" {
350350
description = "Specifies how node metadata is exposed to the workload running on the node"
351351
default = "UNSPECIFIED"
352352
}
353+
354+
variable "enable_intranode_visibility" {
355+
type = bool
356+
description = "Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network"
357+
default = false
358+
}
359+
360+
variable "enable_vertical_pod_autoscaling" {
361+
type = bool
362+
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
363+
default = false
364+
}

modules/beta-public-cluster/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
138138
| description | The description of the cluster | string | `""` | no |
139139
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | bool | `"true"` | no |
140140
| enable\_binary\_authorization | Enable BinAuthZ Admission controller | string | `"false"` | no |
141+
| 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 |
142+
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | bool | `"false"` | no |
141143
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | bool | `"true"` | no |
142144
| http\_load\_balancing | Enable httpload balancer addon | bool | `"true"` | no |
143145
| initial\_node\_count | The number of nodes to create in this cluster's default node pool. | number | `"0"` | no |
@@ -187,6 +189,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
187189
| endpoint | Cluster endpoint |
188190
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
189191
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
192+
| intranode\_visibility\_enabled | Whether intra-node visibility is enabled |
190193
| istio\_enabled | Whether Istio is enabled |
191194
| kubernetes\_dashboard\_enabled | Whether kubernetes dashboard enabled |
192195
| location | Cluster location (region if regional cluster, zone if zonal cluster) |
@@ -203,6 +206,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
203206
| region | Cluster region |
204207
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
205208
| type | Cluster type (regional / zonal) |
209+
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |
206210
| zones | List of zones in which the cluster resides |
207211

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

modules/beta-public-cluster/cluster_regional.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ resource "google_container_cluster" "primary" {
5353
monitoring_service = var.monitoring_service
5454

5555
enable_binary_authorization = var.enable_binary_authorization
56+
enable_intranode_visibility = var.enable_intranode_visibility
57+
58+
vertical_pod_autoscaling {
59+
enabled = var.enable_vertical_pod_autoscaling
60+
}
5661

5762
dynamic "pod_security_policy_config" {
5863
for_each = var.pod_security_policy_config

modules/beta-public-cluster/cluster_zonal.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ resource "google_container_cluster" "zonal_primary" {
4949
monitoring_service = var.monitoring_service
5050

5151
enable_binary_authorization = var.enable_binary_authorization
52+
enable_intranode_visibility = var.enable_intranode_visibility
53+
54+
vertical_pod_autoscaling {
55+
enabled = var.enable_vertical_pod_autoscaling
56+
}
5257

5358
dynamic "pod_security_policy_config" {
5459
for_each = var.pod_security_policy_config

modules/beta-public-cluster/main.tf

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,16 @@ locals {
236236
regional = element(concat(google_container_cluster.primary.*.pod_security_policy_config.0.enabled, [""]), 0)
237237
zonal = element(concat(google_container_cluster.zonal_primary.*.pod_security_policy_config.0.enabled, [""]), 0)
238238
}
239+
240+
cluster_type_output_intranode_visbility_enabled = {
241+
regional = element(concat(google_container_cluster.primary.*.enable_intranode_visibility, [""]), 0)
242+
zonal = element(concat(google_container_cluster.zonal_primary.*.enable_intranode_visibility, [""]), 0)
243+
}
244+
245+
cluster_type_output_vertical_pod_autoscaling_enabled = {
246+
regional = element(concat(google_container_cluster.primary.*.vertical_pod_autoscaling.0.enabled, [""]), 0)
247+
zonal = element(concat(google_container_cluster.zonal_primary.*.vertical_pod_autoscaling.0.enabled, [""]), 0)
248+
}
239249
# /BETA features
240250

241251
cluster_type_output_node_pools_names = {
@@ -269,9 +279,11 @@ locals {
269279
cluster_horizontal_pod_autoscaling_enabled = ! local.cluster_type_output_horizontal_pod_autoscaling_enabled[local.cluster_type]
270280
cluster_kubernetes_dashboard_enabled = ! local.cluster_type_output_kubernetes_dashboard_enabled[local.cluster_type]
271281
# BETA features
272-
cluster_istio_enabled = ! local.cluster_type_output_istio_enabled[local.cluster_type]
273-
cluster_cloudrun_enabled = var.cloudrun
274-
cluster_pod_security_policy_enabled = local.cluster_type_output_pod_security_policy_enabled[local.cluster_type]
282+
cluster_istio_enabled = ! local.cluster_type_output_istio_enabled[local.cluster_type]
283+
cluster_cloudrun_enabled = var.cloudrun
284+
cluster_pod_security_policy_enabled = local.cluster_type_output_pod_security_policy_enabled[local.cluster_type]
285+
cluster_intranode_visibility_enabled = local.cluster_type_output_intranode_visbility_enabled[local.cluster_type]
286+
cluster_vertical_pod_autoscaling_enabled = local.cluster_type_output_vertical_pod_autoscaling_enabled[local.cluster_type]
275287
# /BETA features
276288
}
277289

modules/beta-public-cluster/outputs.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ output "endpoint" {
5151
* resources dependent on the cluster being up will fail to deploy. With
5252
* this explicit dependency, dependent resources can wait for the cluster
5353
* to be up.
54-
*/
54+
*/
5555
google_container_cluster.primary,
5656
google_container_node_pool.pools,
5757
google_container_cluster.zonal_primary,
@@ -141,3 +141,13 @@ output "pod_security_policy_enabled" {
141141
value = local.cluster_pod_security_policy_enabled
142142
}
143143

144+
output "intranode_visibility_enabled" {
145+
description = "Whether intra-node visibility is enabled"
146+
value = local.cluster_intranode_visibility_enabled
147+
}
148+
149+
output "vertical_pod_autoscaling_enabled" {
150+
description = "Whether veritical pod autoscaling is enabled"
151+
value = local.cluster_vertical_pod_autoscaling_enabled
152+
}
153+

modules/beta-public-cluster/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,15 @@ variable "node_metadata" {
326326
description = "Specifies how node metadata is exposed to the workload running on the node"
327327
default = "UNSPECIFIED"
328328
}
329+
330+
variable "enable_intranode_visibility" {
331+
type = bool
332+
description = "Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network"
333+
default = false
334+
}
335+
336+
variable "enable_vertical_pod_autoscaling" {
337+
type = bool
338+
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
339+
default = false
340+
}

modules/private-cluster/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ output "endpoint" {
5151
* resources dependent on the cluster being up will fail to deploy. With
5252
* this explicit dependency, dependent resources can wait for the cluster
5353
* to be up.
54-
*/
54+
*/
5555
google_container_cluster.primary,
5656
google_container_node_pool.pools,
5757
google_container_cluster.zonal_primary,

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ output "endpoint" {
5151
* resources dependent on the cluster being up will fail to deploy. With
5252
* this explicit dependency, dependent resources can wait for the cluster
5353
* to be up.
54-
*/
54+
*/
5555
google_container_cluster.primary,
5656
google_container_node_pool.pools,
5757
google_container_cluster.zonal_primary,

0 commit comments

Comments
 (0)