Skip to content

Commit b1637d4

Browse files
authored
Set gke_product_type:xpk cluster label (#659)
* Set gke_product_type:xpk cluster label * Update goldens and test data.
1 parent 8464ce2 commit b1637d4

File tree

11 files changed

+16
-5
lines changed

11 files changed

+16
-5
lines changed

goldens/Basic_cluster_create.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gcloud container get-server-config --project=golden-project --region=us-central1
99
[XPK] Task: `Find if Cluster Exists` is implemented by the following command not running since it is a dry run.
1010
gcloud container clusters list --project=golden-project --region=us-central1 --format="csv[no-heading](name)"
1111
[XPK] Task: `GKE Cluster Create` is implemented by the following command not running since it is a dry run.
12-
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --location-policy=BALANCED --scopes=storage-full,gke-default
12+
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --labels=gke_product_type=xpk --location-policy=BALANCED --scopes=storage-full,gke-default
1313
[XPK] Task: `Check if Private Nodes is enabled in cluster.` is implemented by the following command not running since it is a dry run.
1414
gcloud container clusters describe golden-cluster --project=golden-project --region=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)"
1515
[XPK] Private Nodes is not enabled on the cluster.

goldens/Cluster_create_private.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gcloud container get-server-config --project=golden-project --region=us-central1
99
[XPK] Task: `Find if Cluster Exists` is implemented by the following command not running since it is a dry run.
1010
gcloud container clusters list --project=golden-project --region=us-central1 --format="csv[no-heading](name)"
1111
[XPK] Task: `GKE Cluster Create` is implemented by the following command not running since it is a dry run.
12-
gcloud beta container clusters create golden-cluster-private --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=n1-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 4 --enable-dns-access --autoscaling-profile=optimize-utilization --enable-master-authorized-networks --enable-private-nodes --location-policy=BALANCED --scopes=storage-full,gke-default --enable-ip-alias
12+
gcloud beta container clusters create golden-cluster-private --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=n1-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 4 --enable-dns-access --autoscaling-profile=optimize-utilization --labels=gke_product_type=xpk --enable-master-authorized-networks --enable-private-nodes --location-policy=BALANCED --scopes=storage-full,gke-default --enable-ip-alias
1313
[XPK] Task: `Check if Private Nodes is enabled in cluster.` is implemented by the following command not running since it is a dry run.
1414
gcloud container clusters describe golden-cluster-private --project=golden-project --region=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)"
1515
[XPK] Private Nodes is not enabled on the cluster.

goldens/Cluster_create_with_gb200-4.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gcloud container get-server-config --project=golden-project --region=us-central1
99
[XPK] Task: `Find if Cluster Exists` is implemented by the following command not running since it is a dry run.
1010
gcloud container clusters list --project=golden-project --region=us-central1 --format="csv[no-heading](name)"
1111
[XPK] Task: `GKE Cluster Create` is implemented by the following command not running since it is a dry run.
12-
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --enable-dataplane-v2 --enable-multi-networking --no-enable-autoupgrade --enable-ip-alias
12+
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --labels=gke_product_type=xpk --enable-dataplane-v2 --enable-multi-networking --no-enable-autoupgrade --enable-ip-alias
1313
[XPK] Task: `Check if Private Nodes is enabled in cluster.` is implemented by the following command not running since it is a dry run.
1414
gcloud container clusters describe golden-cluster --project=golden-project --region=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)"
1515
[XPK] Private Nodes is not enabled on the cluster.

goldens/NAP_cluster-create.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gcloud container get-server-config --project=golden-project --region=us-central1
99
[XPK] Task: `Find if Cluster Exists` is implemented by the following command not running since it is a dry run.
1010
gcloud container clusters list --project=golden-project --region=us-central1 --format="csv[no-heading](name)"
1111
[XPK] Task: `GKE Cluster Create` is implemented by the following command not running since it is a dry run.
12-
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --location-policy=BALANCED --scopes=storage-full,gke-default
12+
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --labels=gke_product_type=xpk --location-policy=BALANCED --scopes=storage-full,gke-default
1313
[XPK] Task: `Check if Private Nodes is enabled in cluster.` is implemented by the following command not running since it is a dry run.
1414
gcloud container clusters describe golden-cluster --project=golden-project --region=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)"
1515
[XPK] Private Nodes is not enabled on the cluster.

goldens/NAP_cluster-create_with_pathways.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gcloud container get-server-config --project=golden-project --region=us-central1
99
[XPK] Task: `Find if Cluster Exists` is implemented by the following command not running since it is a dry run.
1010
gcloud container clusters list --project=golden-project --region=us-central1 --format="csv[no-heading](name)"
1111
[XPK] Task: `GKE Cluster Create` is implemented by the following command not running since it is a dry run.
12-
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --location-policy=BALANCED --scopes=storage-full,gke-default --enable-ip-alias
12+
gcloud beta container clusters create golden-cluster --project=golden-project --region=us-central1 --node-locations=us-central1-a --cluster-version=0 --machine-type=e2-standard-16 --enable-autoscaling --total-min-nodes 1 --total-max-nodes 1000 --num-nodes 6 --enable-dns-access --autoscaling-profile=optimize-utilization --labels=gke_product_type=xpk --location-policy=BALANCED --scopes=storage-full,gke-default --enable-ip-alias
1313
[XPK] Task: `Check if Private Nodes is enabled in cluster.` is implemented by the following command not running since it is a dry run.
1414
gcloud container clusters describe golden-cluster --project=golden-project --region=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)"
1515
[XPK] Private Nodes is not enabled on the cluster.

src/xpk/commands/cluster.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ def run_gke_cluster_create_command(
10881088
f' {rapid_release_cmd}'
10891089
' --enable-dns-access'
10901090
' --autoscaling-profile=optimize-utilization'
1091+
' --labels=gke_product_type=xpk'
10911092
)
10921093

10931094
enable_ip_alias = False

src/xpk/core/blueprint/blueprint_generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
cluster_toolkit_url = "github.com/GoogleCloudPlatform/cluster-toolkit"
5555
cluster_toolkit_version = "v1.62.2"
56+
common_cluster_labels = {"gke_product_type": "xpk"}
5657

5758

5859
class BlueprintGeneratorOutput:
@@ -298,6 +299,7 @@ def generate_a3_mega_blueprint(
298299
"deployment_name": blueprint_name,
299300
"region": region,
300301
"zone": zone,
302+
"labels": common_cluster_labels,
301303
},
302304
)
303305

@@ -676,6 +678,7 @@ def generate_a3_ultra_blueprint(
676678
"deployment_name": blueprint_name,
677679
"region": region,
678680
"zone": zone,
681+
"labels": common_cluster_labels,
679682
},
680683
)
681684

@@ -962,6 +965,7 @@ def generate_a4_blueprint(
962965
"deployment_name": blueprint_name,
963966
"region": region,
964967
"zone": zone,
968+
"labels": common_cluster_labels,
965969
},
966970
)
967971

src/xpk/core/blueprint/testing/data/a3_mega.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ vars:
2323
deployment_name: xpk-gke-a3-megagpu
2424
region: us-central1
2525
zone: us-central1-c
26+
labels: {gke_product_type: xpk}
2627

2728
deployment_groups:
2829
- !DeploymentGroup

src/xpk/core/blueprint/testing/data/a3_mega_spot.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ vars:
2323
deployment_name: xpk-gke-a3-megagpu
2424
region: us-central1
2525
zone: us-central1-c
26+
labels: {gke_product_type: xpk}
2627

2728
deployment_groups:
2829
- !DeploymentGroup

src/xpk/core/blueprint/testing/data/a3_ultra.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ toolkit_modules_url: github.com/GoogleCloudPlatform/cluster-toolkit
1717
toolkit_modules_version: v1.62.2
1818

1919
vars:
20+
labels: {gke_product_type: xpk}
21+
2022

2123
terraform_backend_defaults:
2224
type: gcs

0 commit comments

Comments
 (0)