diff --git a/composer/workflows/gke_operator.py b/composer/workflows/gke_operator.py index 7db6a5c184b..da19728c3bf 100644 --- a/composer/workflows/gke_operator.py +++ b/composer/workflows/gke_operator.py @@ -40,7 +40,9 @@ # [START composer_gkeoperator_fullconfig] # TODO(developer): update with your values PROJECT_ID = "my-project-id" - CLUSTER_ZONE = "us-west1-a" + # It is recommended to use regional clusters for increased reliability + # though passing a zone in the location parameter is also valid + CLUSTER_REGION = "us-west1" CLUSTER_NAME = "example-cluster" # [END composer_gkeoperator_minconfig] # [END composer_gkeoperator_templateconfig] @@ -58,7 +60,7 @@ create_cluster = GKECreateClusterOperator( task_id="create_cluster", project_id=PROJECT_ID, - location=CLUSTER_ZONE, + location=CLUSTER_REGION, body=CLUSTER, ) # [END composer_gke_create_cluster] @@ -70,7 +72,7 @@ # Name of task you want to run, used to generate Pod ID. name="pod-ex-minimum", project_id=PROJECT_ID, - location=CLUSTER_ZONE, + location=CLUSTER_REGION, cluster_name=CLUSTER_NAME, # Entrypoint of the container, if not specified the Docker container's # entrypoint is used. The cmds parameter is templated. @@ -93,7 +95,7 @@ task_id="ex-kube-templates", name="ex-kube-templates", project_id=PROJECT_ID, - location=CLUSTER_ZONE, + location=CLUSTER_REGION, cluster_name=CLUSTER_NAME, namespace="default", image="bash", @@ -120,7 +122,7 @@ kubernetes_affinity_ex = GKEStartPodOperator( task_id="ex-pod-affinity", project_id=PROJECT_ID, - location=CLUSTER_ZONE, + location=CLUSTER_REGION, cluster_name=CLUSTER_NAME, name="ex-pod-affinity", namespace="default", @@ -170,7 +172,7 @@ task_id="ex-all-configs", name="full", project_id=PROJECT_ID, - location=CLUSTER_ZONE, + location=CLUSTER_REGION, cluster_name=CLUSTER_NAME, namespace="default", image="perl", @@ -228,7 +230,7 @@ task_id="delete_cluster", name=CLUSTER_NAME, project_id=PROJECT_ID, - location=CLUSTER_ZONE, + location=CLUSTER_REGION, ) # [END composer_gkeoperator_delete_cluster]