Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Next version
- Support for enabling Gateway API

## Version 1.4.1 - Feature and bugfix release
- Add DNS endpoint support when attaching clusters
- Improve Nvidia driver installation support
Expand Down
6 changes: 6 additions & 0 deletions python-clusters/create-gke-cluster/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
"mandatory": false,
"visibilityCondition": "model.isVpcNative"
},
{
"name": "enableGatewayAPI",
"label": "Enable Gateway API",
"type": "BOOLEAN",
"defaultValue" : false
},
{
"name": "s-nodes",
"type":"SEPARATOR",
Expand Down
3 changes: 3 additions & 0 deletions python-clusters/create-gke-cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def start(self):
cluster_builder.with_network(self.config.get("inheritFromDSSHost", True),
self.config.get("network", "").strip(),
self.config.get("subNetwork", "").strip())

cluster_builder.with_gateway_api(self.config.get("enableGatewayAPI", False))

vpc_native = is_autopilot or self.config.get("isVpcNative", None)
cluster_builder.with_vpc_native_settings(vpc_native,
self.config.get("podIpRange", ""),
Expand Down
14 changes: 11 additions & 3 deletions python-lib/dku_google/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def __init__(self, clusters):
self.release_channel_enrollment = True
self.settings_valve = None
self.partner_google_urn = None
self.gateway_api_enabled = False

def with_name(self, name):
self.name = name
Expand All @@ -231,6 +232,10 @@ def with_release_channel(self, release_channel):
self.release_channel = release_channel
return self

def with_gateway_api(self, enable):
self.gateway_api_enabled = enable
return self

def with_release_channel_enrollment(self, release_channel_enrollment):
self.release_channel_enrollment = release_channel_enrollment
return self
Expand Down Expand Up @@ -321,10 +326,10 @@ def build(self):
"name": cluster_name,
"initialClusterVersion": cluster_version,
"description": "Created from plugin",
"network": cluster_network,
"subnetwork": cluster_subnetwork,
"resourceLabels": cluster_labels,
"nodePools": []
"nodePools": [],
"network": cluster_network,
"subnetwork": cluster_subnetwork
}
}
if self.is_regional:
Expand All @@ -334,6 +339,9 @@ def build(self):
else:
create_cluster_request_body["parent"] = self.clusters.get_zonal_location()

if self.gateway_api_enabled:
create_cluster_request_body["cluster"]["networkConfig"] = {"gatewayApiConfig": {"channel":"CHANNEL_STANDARD"}}

if self.is_vpc_native:
ip_allocation_policy = {
"createSubnetwork": False,
Expand Down