diff --git a/Changelog.md b/Changelog.md index 8a5f39d..7d5378d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 diff --git a/python-clusters/create-gke-cluster/cluster.json b/python-clusters/create-gke-cluster/cluster.json index 28838dc..18c8663 100644 --- a/python-clusters/create-gke-cluster/cluster.json +++ b/python-clusters/create-gke-cluster/cluster.json @@ -131,6 +131,12 @@ "mandatory": false, "visibilityCondition": "model.isVpcNative" }, + { + "name": "enableGatewayAPI", + "label": "Enable Gateway API", + "type": "BOOLEAN", + "defaultValue" : false + }, { "name": "s-nodes", "type":"SEPARATOR", diff --git a/python-clusters/create-gke-cluster/cluster.py b/python-clusters/create-gke-cluster/cluster.py index 03f1a61..eabdaeb 100644 --- a/python-clusters/create-gke-cluster/cluster.py +++ b/python-clusters/create-gke-cluster/cluster.py @@ -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", ""), diff --git a/python-lib/dku_google/clusters.py b/python-lib/dku_google/clusters.py index 6e99783..f283e8a 100644 --- a/python-lib/dku_google/clusters.py +++ b/python-lib/dku_google/clusters.py @@ -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 @@ -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 @@ -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: @@ -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,