GKEStartPodOperator

Google

Executes a task in a Kubernetes pod in the specified Google Kubernetes Engine cluster

View on GitHub

Last Updated: Apr. 8, 2023

Access Instructions

Install the Google provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

locationRequiredThe name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’
cluster_nameRequiredThe name of the Google Kubernetes Engine cluster the pod should be spawned in
use_internal_ipUse the internal IP address as the endpoint.
project_idThe Google Developers Console project id
gcp_conn_idThe google cloud connection id to use. This allows for users to specify a service account.
impersonation_chainOptional service account to impersonate using short-term credentials, or list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).
regionalThe location param is region name.
is_delete_operator_podWhat to do when the pod reaches its final state, or the execution is interrupted. If True, delete the pod; if False, leave the pod. Current default is False, but this will be changed in the next major release of this provider.

Documentation

Executes a task in a Kubernetes pod in the specified Google Kubernetes Engine cluster

This Operator assumes that the system has gcloud installed and has configured a connection id with a service account.

The minimum required to define a cluster to create are the variables task_id, project_id, location, cluster_name, name, namespace, and image

See also

For more detail about Kubernetes Engine authentication have a look at the reference: https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#internal_ip

See also

For more information on how to use this operator, take a look at the guide: Run a Pod on a GKE cluster

Was this page helpful?