Skip to content

Commit 394be9f

Browse files
authored
Merge branch 'main' into topic/tests
2 parents 2346473 + 651c9cd commit 394be9f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

composer/workflows/gke_operator.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
# [START composer_gkeoperator_fullconfig]
4141
# TODO(developer): update with your values
4242
PROJECT_ID = "my-project-id"
43-
CLUSTER_ZONE = "us-west1-a"
43+
# It is recommended to use regional clusters for increased reliability
44+
# though passing a zone in the location parameter is also valid
45+
CLUSTER_REGION = "us-west1"
4446
CLUSTER_NAME = "example-cluster"
4547
# [END composer_gkeoperator_minconfig]
4648
# [END composer_gkeoperator_templateconfig]
@@ -58,7 +60,7 @@
5860
create_cluster = GKECreateClusterOperator(
5961
task_id="create_cluster",
6062
project_id=PROJECT_ID,
61-
location=CLUSTER_ZONE,
63+
location=CLUSTER_REGION,
6264
body=CLUSTER,
6365
)
6466
# [END composer_gke_create_cluster]
@@ -70,7 +72,7 @@
7072
# Name of task you want to run, used to generate Pod ID.
7173
name="pod-ex-minimum",
7274
project_id=PROJECT_ID,
73-
location=CLUSTER_ZONE,
75+
location=CLUSTER_REGION,
7476
cluster_name=CLUSTER_NAME,
7577
# Entrypoint of the container, if not specified the Docker container's
7678
# entrypoint is used. The cmds parameter is templated.
@@ -93,7 +95,7 @@
9395
task_id="ex-kube-templates",
9496
name="ex-kube-templates",
9597
project_id=PROJECT_ID,
96-
location=CLUSTER_ZONE,
98+
location=CLUSTER_REGION,
9799
cluster_name=CLUSTER_NAME,
98100
namespace="default",
99101
image="bash",
@@ -120,7 +122,7 @@
120122
kubernetes_affinity_ex = GKEStartPodOperator(
121123
task_id="ex-pod-affinity",
122124
project_id=PROJECT_ID,
123-
location=CLUSTER_ZONE,
125+
location=CLUSTER_REGION,
124126
cluster_name=CLUSTER_NAME,
125127
name="ex-pod-affinity",
126128
namespace="default",
@@ -170,7 +172,7 @@
170172
task_id="ex-all-configs",
171173
name="full",
172174
project_id=PROJECT_ID,
173-
location=CLUSTER_ZONE,
175+
location=CLUSTER_REGION,
174176
cluster_name=CLUSTER_NAME,
175177
namespace="default",
176178
image="perl",
@@ -228,7 +230,7 @@
228230
task_id="delete_cluster",
229231
name=CLUSTER_NAME,
230232
project_id=PROJECT_ID,
231-
location=CLUSTER_ZONE,
233+
location=CLUSTER_REGION,
232234
)
233235
# [END composer_gkeoperator_delete_cluster]
234236

0 commit comments

Comments
 (0)