airflow.providers.google.cloud.operators.kubernetes_engine

This module contains Google Kubernetes Engine operators.

Module Contents

Classes

GKEClusterAuthDetails

Helper for fetching information about cluster for connecting.

GKEOperatorMixin

Mixin for GKE operators provides proper unified hooks creation.

GKEDeleteClusterOperator

Deletes the cluster, including the Kubernetes endpoint and all worker nodes.

GKECreateClusterOperator

Create a Google Kubernetes Engine Cluster of specified dimensions and wait until the cluster is created.

GKEStartKueueInsideClusterOperator

Installs Kueue of specific version inside Cluster.

GKEStartPodOperator

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

GKEStartJobOperator

Executes a Kubernetes job in the specified Google Kubernetes Engine cluster.

GKEDescribeJobOperator

Retrieve information about Job by given name.

GKEListJobsOperator

Retrieve list of Jobs.

GKECreateCustomResourceOperator

Create a resource in the specified Google Kubernetes Engine cluster.

GKEDeleteCustomResourceOperator

Delete a resource in the specified Google Kubernetes Engine cluster.

GKEStartKueueJobOperator

Executes a Kubernetes Job in Kueue in the specified Google Kubernetes Engine cluster.

GKEDeleteJobOperator

Delete a Kubernetes job in the specified Google Kubernetes Engine cluster.

GKESuspendJobOperator

Suspend Job by given name.

GKEResumeJobOperator

Resume Job by given name.

Attributes

KUBE_CONFIG_ENV_VAR

airflow.providers.google.cloud.operators.kubernetes_engine.KUBE_CONFIG_ENV_VAR = 'KUBECONFIG'[source]
class airflow.providers.google.cloud.operators.kubernetes_engine.GKEClusterAuthDetails(cluster_name, project_id, use_internal_ip, cluster_hook)[source]

Helper for fetching information about cluster for connecting.

Parameters
fetch_cluster_info()[source]

Fetch cluster info for connecting to it.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKEOperatorMixin[source]

Mixin for GKE operators provides proper unified hooks creation.

property cluster_url: str[source]
property ssl_ca_cert: str[source]
enable_tcp_keepalive = False[source]
template_fields: collections.abc.Sequence[str] = ('location', 'cluster_name', 'use_internal_ip', 'project_id', 'gcp_conn_id', 'impersonation_chain')[source]
cluster_hook()[source]
hook()[source]
cluster_info()[source]

Fetch cluster info for connecting to it.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKEDeleteClusterOperator(location, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, cluster_name=None, name=None, api_version='v2', deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), poll_interval=10, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Deletes the cluster, including the Kubernetes endpoint and all worker nodes.

To delete a certain cluster, you must specify the project_id, the cluster_name of the cluster, the location that the cluster is in, and the task_id.

Operator Creation:

operator = GKEClusterDeleteOperator(
            task_id='cluster_delete',
            project_id='my-project',
            location='cluster-location'
            cluster_name='cluster-name')

See also

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

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str | None) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

  • name (str | None) – (Deprecated) The name of the resource to delete, in this case cluster name

  • api_version (str) – The api version to use

  • deferrable (bool) – Run operator in the deferrable mode.

  • poll_interval (int) – Interval size which defines how often operation status is checked.

property name: str | None[source]
template_fields: collections.abc.Sequence[str][source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

execute_complete(context, event)[source]

Execute after trigger job is done.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKECreateClusterOperator(body, location, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, api_version='v2', deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), poll_interval=10, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Create a Google Kubernetes Engine Cluster of specified dimensions and wait until the cluster is created.

The minimum required to define a cluster to create is:

dict() ::

cluster_def = {“name”: “my-cluster-name”, “initial_node_count”: 1}

or

Cluster proto ::

from google.cloud.container_v1.types import Cluster

cluster_def = Cluster(name=”my-cluster-name”, initial_node_count=1)

Operator Creation:

operator = GKEClusterCreateOperator(
            task_id='cluster_create',
            project_id='my-project',
            location='my-location'
            body=cluster_def)

See also

For more detail on about creating clusters have a look at the reference: google.cloud.container_v1.types.Cluster

See also

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

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

  • body (dict | google.cloud.container_v1.types.Cluster) – The Cluster definition to create, can be protobuf or python dict, if dict it must match protobuf message Cluster

  • api_version (str) – The api version to use

  • deferrable (bool) – Run operator in the deferrable mode.

  • poll_interval (int) – Interval size which defines how often operation status is checked.

template_fields: collections.abc.Sequence[str][source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

execute_complete(context, event)[source]
class airflow.providers.google.cloud.operators.kubernetes_engine.GKEStartKueueInsideClusterOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.cncf.kubernetes.operators.kueue.KubernetesInstallKueueOperator

Installs Kueue of specific version inside Cluster.

See also

For more information on how to use this operator, take a look at the guide: Install Kueue of specific version inside Cluster

See also

For more details about Kueue have a look at the reference: https://kueue.sigs.k8s.io/docs/overview/

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

enable_tcp_keepalive = True[source]
template_fields[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKEStartPodOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, regional=None, on_finish_action=None, is_delete_operator_pod=None, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.cncf.kubernetes.operators.pod.KubernetesPodOperator

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

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

  • regional (bool | None) – (Deprecated) The location param is region name.

  • on_finish_action (str | None) – What to do when the pod reaches its final state, or the execution is interrupted. If “delete_pod”, the pod will be deleted regardless its state; if “delete_succeeded_pod”, only succeeded pod will be deleted. You can set to “keep_pod” to keep the pod. Current default is keep_pod, but this will be changed in the next major release of this provider.

  • is_delete_operator_pod (bool | None) – (Deprecated) What 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. Deprecated - use on_finish_action instead.

  • deferrable (bool) – Run operator in the deferrable mode.

property is_delete_operator_pod: bool | None[source]
property regional: bool | None[source]
template_fields: collections.abc.Sequence[str][source]
invoke_defer_method(last_log_time=None)[source]

Redefine triggers which are being used in child classes.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKEStartJobOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), job_poll_interval=10.0, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.cncf.kubernetes.operators.job.KubernetesJobOperator

Executes a Kubernetes job 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 Job on a GKE cluster

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

  • deferrable (bool) – Run operator in the deferrable mode.

  • poll_interval – (Deferrable mode only) polling period in seconds to check for the status of job.

template_fields: collections.abc.Sequence[str][source]
execute(context)[source]

Execute process of creating Job.

execute_deferrable()[source]
class airflow.providers.google.cloud.operators.kubernetes_engine.GKEDescribeJobOperator(job_name, namespace, location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Retrieve information about Job by given name.

See also

For more information on how to use this operator, take a look at the guide: Retrieve information about Job by given name

Parameters
  • job_name (str) – The name of the Job to delete

  • namespace (str) – The name of the Google Kubernetes Engine namespace.

  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

template_fields: collections.abc.Sequence[str][source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKEListJobsOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, namespace=None, do_xcom_push=True, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Retrieve list of Jobs.

If namespace parameter is specified, the list of Jobs from dedicated namespace will be retrieved. If no namespace specified, it will output Jobs from all namespaces.

See also

For more information on how to use this operator, take a look at the guide: Retrieve list of Jobs

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

  • namespace (str | None) – The name of the Google Kubernetes Engine namespace.

  • do_xcom_push (bool) – If set to True the result list of Jobs will be pushed to the task result.

template_fields: collections.abc.Sequence[str][source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKECreateCustomResourceOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.cncf.kubernetes.operators.resource.KubernetesCreateResourceOperator

Create a resource 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.

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: Create a resource in a GKE cluster

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

template_fields: collections.abc.Sequence[str][source]
class airflow.providers.google.cloud.operators.kubernetes_engine.GKEDeleteCustomResourceOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.cncf.kubernetes.operators.resource.KubernetesDeleteResourceOperator

Delete a resource 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.

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: Delete a resource in a GKE cluster

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

template_fields: collections.abc.Sequence[str][source]
class airflow.providers.google.cloud.operators.kubernetes_engine.GKEStartKueueJobOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.cncf.kubernetes.operators.kueue.KubernetesStartKueueJobOperator

Executes a Kubernetes Job in Kueue in the specified Google Kubernetes Engine cluster.

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

template_fields[source]
class airflow.providers.google.cloud.operators.kubernetes_engine.GKEDeleteJobOperator(location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.cncf.kubernetes.operators.job.KubernetesDeleteJobOperator

Delete a Kubernetes job 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

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: Delete a Job on a GKE cluster

Parameters
  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

template_fields: collections.abc.Sequence[str][source]
class airflow.providers.google.cloud.operators.kubernetes_engine.GKESuspendJobOperator(name, namespace, location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Suspend Job by given name.

See also

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

Parameters
  • name (str) – The name of the Job to suspend

  • namespace (str) – The name of the Google Kubernetes Engine namespace.

  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

template_fields: collections.abc.Sequence[str][source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.kubernetes_engine.GKEResumeJobOperator(name, namespace, location, cluster_name, use_internal_ip=False, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: GKEOperatorMixin, airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Resume Job by given name.

See also

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

Parameters
  • name (str) – The name of the Job to resume

  • namespace (str) – The name of the Google Kubernetes Engine namespace.

  • location (str) – The name of the Google Kubernetes Engine zone or region in which the cluster resides, e.g. ‘us-central1-a’

  • cluster_name (str) – The name of the Google Kubernetes Engine cluster.

  • use_internal_ip (bool) – Use the internal IP address as the endpoint.

  • project_id (str) – The Google Developers Console project id

  • gcp_conn_id (str) – The Google cloud connection id to use. This allows for users to specify a service account.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional 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).

template_fields: collections.abc.Sequence[str][source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?