Skip to content

Commit 2602579

Browse files
committed
Update Airflow 2 GKE sample to use regional clusters
1 parent 8064e13 commit 2602579

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

composer/workflows/gke_operator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
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+
CLUSTER_REGION = "us-west1"
4444
CLUSTER_NAME = "example-cluster"
4545
# [END composer_gkeoperator_minconfig]
4646
# [END composer_gkeoperator_templateconfig]
@@ -58,7 +58,7 @@
5858
create_cluster = GKECreateClusterOperator(
5959
task_id="create_cluster",
6060
project_id=PROJECT_ID,
61-
location=CLUSTER_ZONE,
61+
location=CLUSTER_REGION,
6262
body=CLUSTER,
6363
)
6464
# [END composer_gke_create_cluster]
@@ -70,7 +70,7 @@
7070
# Name of task you want to run, used to generate Pod ID.
7171
name="pod-ex-minimum",
7272
project_id=PROJECT_ID,
73-
location=CLUSTER_ZONE,
73+
location=CLUSTER_REGION,
7474
cluster_name=CLUSTER_NAME,
7575
# Entrypoint of the container, if not specified the Docker container's
7676
# entrypoint is used. The cmds parameter is templated.
@@ -93,7 +93,7 @@
9393
task_id="ex-kube-templates",
9494
name="ex-kube-templates",
9595
project_id=PROJECT_ID,
96-
location=CLUSTER_ZONE,
96+
location=CLUSTER_REGION,
9797
cluster_name=CLUSTER_NAME,
9898
namespace="default",
9999
image="bash",
@@ -120,7 +120,7 @@
120120
kubernetes_affinity_ex = GKEStartPodOperator(
121121
task_id="ex-pod-affinity",
122122
project_id=PROJECT_ID,
123-
location=CLUSTER_ZONE,
123+
location=CLUSTER_REGION,
124124
cluster_name=CLUSTER_NAME,
125125
name="ex-pod-affinity",
126126
namespace="default",
@@ -170,7 +170,7 @@
170170
task_id="ex-all-configs",
171171
name="full",
172172
project_id=PROJECT_ID,
173-
location=CLUSTER_ZONE,
173+
location=CLUSTER_REGION,
174174
cluster_name=CLUSTER_NAME,
175175
namespace="default",
176176
image="perl",
@@ -228,7 +228,7 @@
228228
task_id="delete_cluster",
229229
name=CLUSTER_NAME,
230230
project_id=PROJECT_ID,
231-
location=CLUSTER_ZONE,
231+
location=CLUSTER_REGION,
232232
)
233233
# [END composer_gkeoperator_delete_cluster]
234234

0 commit comments

Comments
 (0)