astronomer.providers.google.cloud.operators.kubernetes_engine
¶
This module contains Google GKE operators.
Module Contents¶
Classes¶
Executes a task in a Kubernetes pod in the specified Google Kubernetes |
- class astronomer.providers.google.cloud.operators.kubernetes_engine.GKEStartPodOperatorAsync(*, location, cluster_name, use_internal_ip=False, project_id=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, regional=False, poll_interval=5, logging_interval=None, do_xcom_push=True, **kwargs)[source]¶
Bases:
airflow.providers.cncf.kubernetes.operators.kubernetes_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
, andimage
.. seealso: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
- 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 the pod should be spawned in
use_internal_ip (bool) – Use the internal IP address as the endpoint
project_id (Optional[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 (Optional[Union[str, Sequence[str]]]) – 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) – The location param is whether a region or a zone
is_delete_operator_pod – 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.
- trigger_reentry(context, event)[source]¶
Point of re-entry from trigger.
If
logging_interval
is None, then at this point the pod should be done and we’ll just fetch the logs and exit.If
logging_interval
is not None, it could be that the pod is still running and we’ll just grab the latest logs and defer back to the trigger again.