Skip to content

Commit d1fbef4

Browse files
authored
feat: Add dataplane-v2 provisioning support (#753)
* add datapath_provider var for beta clusters * incorporate datapath_provider option * update tests for datapath_provider beta cluster * example README var updates * remove network_policy var usage * finish docs updates Co-authored-by: ryan-atkins <>
1 parent 3354205 commit d1fbef4

File tree

19 files changed

+57
-0
lines changed

19 files changed

+57
-0
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ resource "google_container_cluster" "primary" {
189189
}
190190
{% endif %}
191191
}
192+
{% if beta_cluster %}
193+
datapath_provider = var.datapath_provider
194+
{% endif %}
192195

193196
{% if beta_cluster %}
194197
networking_mode = "VPC_NATIVE"

autogen/main/variables.tf.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ variable "network_policy_provider" {
107107
description = "The network policy provider."
108108
default = "CALICO"
109109
}
110+
{% if beta_cluster %}
111+
variable "datapath_provider" {
112+
type = string
113+
description = "The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation."
114+
default = "DATAPATH_PROVIDER_UNSPECIFIED"
115+
}
116+
{% endif %}
110117

111118
variable "maintenance_start_time" {
112119
type = string

examples/simple_regional_beta/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This example illustrates how to create a simple cluster with beta features.
1111
| cluster\_name\_suffix | A suffix to append to the default cluster name | `string` | `""` | no |
1212
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | `any` | n/a | yes |
1313
| 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 |
14+
| datapath\_provider | The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation. | `string` | `"DATAPATH_PROVIDER_UNSPECIFIED"` | no |
1415
| dns\_cache | (Beta) The status of the NodeLocal DNSCache addon. | `bool` | `false` | no |
1516
| enable\_binary\_authorization | Enable BinAuthZ Admission controller | `bool` | `false` | no |
1617
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | `bool` | `false` | no |

examples/simple_regional_beta/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@ module "gke" {
6060
# Disable workload identity
6161
identity_namespace = null
6262
node_metadata = "UNSPECIFIED"
63+
64+
# Enable Dataplane Setup
65+
datapath_provider = "ADVANCED_DATAPATH"
6366
}

examples/simple_regional_beta/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,9 @@ variable "regional" {
123123
description = "Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!)"
124124
default = true
125125
}
126+
127+
variable "datapath_provider" {
128+
type = string
129+
description = "The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation."
130+
default = "DATAPATH_PROVIDER_UNSPECIFIED"
131+
}

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ Then perform the following commands on the root folder:
170170
| 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 |
171171
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
172172
| 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 |
173+
| datapath\_provider | The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation. | `string` | `"DATAPATH_PROVIDER_UNSPECIFIED"` | no |
173174
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
174175
| deploy\_using\_private\_endpoint | (Beta) A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
175176
| description | The description of the cluster | `string` | `""` | no |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ resource "google_container_cluster" "primary" {
172172
enabled = var.config_connector
173173
}
174174
}
175+
datapath_provider = var.datapath_provider
175176

176177
networking_mode = "VPC_NATIVE"
177178
ip_allocation_policy {

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ variable "network_policy_provider" {
107107
description = "The network policy provider."
108108
default = "CALICO"
109109
}
110+
variable "datapath_provider" {
111+
type = string
112+
description = "The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation."
113+
default = "DATAPATH_PROVIDER_UNSPECIFIED"
114+
}
110115

111116
variable "maintenance_start_time" {
112117
type = string

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Then perform the following commands on the root folder:
148148
| 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 |
149149
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
150150
| 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 |
151+
| datapath\_provider | The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation. | `string` | `"DATAPATH_PROVIDER_UNSPECIFIED"` | no |
151152
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
152153
| deploy\_using\_private\_endpoint | (Beta) A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
153154
| description | The description of the cluster | `string` | `""` | no |

modules/beta-private-cluster/cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ resource "google_container_cluster" "primary" {
172172
enabled = var.config_connector
173173
}
174174
}
175+
datapath_provider = var.datapath_provider
175176

176177
networking_mode = "VPC_NATIVE"
177178
ip_allocation_policy {

0 commit comments

Comments
 (0)