# Kubernetes Tasks
Tasks for interacting with various Kubernetes API objects.
Note that depending on how you choose to authenticate, tasks in this collection might require
a Prefect Secret called "KUBERNETES_API_KEY"
that stores your Kubernetes API Key;
this Secret must be a string and in BearerToken format.
# CreateNamespacedDeployment
class
prefect.tasks.kubernetes.deployment.CreateNamespacedDeployment
(body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for creating a namespaced deployment on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
body (dict, optional)
: A dictionary representation of a Kubernetes ExtensionsV1beta1Deployment specificationnamespace (str, optional)
: The Kubernetes namespace to create this deployment in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.deployment.CreateNamespacedDeployment.run (body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# DeleteNamespacedDeployment
class
prefect.tasks.kubernetes.deployment.DeleteNamespacedDeployment
(deployment_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for deleting a namespaced deployment on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
deployment_name (str, optional)
: The name of a deployment to deletenamespace (str, optional)
: The Kubernetes namespace to delete this deployment from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.deployment.DeleteNamespacedDeployment.run (deployment_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", delete_option_kwargs=None)[source] |
Task run method.
|
# ListNamespacedDeployment
class
prefect.tasks.kubernetes.deployment.ListNamespacedDeployment
(namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for listing namespaced deployments on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
namespace (str, optional)
: The Kubernetes namespace to list deployments from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"field_selector": "...", "label_selector": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.deployment.ListNamespacedDeployment.run (namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# PatchNamespacedDeployment
class
prefect.tasks.kubernetes.deployment.PatchNamespacedDeployment
(deployment_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for patching a namespaced deployment on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
deployment_name (str, optional)
: The name of a deployment to patchbody (dict, optional)
: A dictionary representation of a Kubernetes ExtensionsV1beta1Deployment patch specificationnamespace (str, optional)
: The Kubernetes namespace to patch this deployment in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.deployment.PatchNamespacedDeployment.run (deployment_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReadNamespacedDeployment
class
prefect.tasks.kubernetes.deployment.ReadNamespacedDeployment
(deployment_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for reading a namespaced deployment on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
deployment_name (str, optional)
: The name of a deployment to readnamespace (str, optional)
: The Kubernetes namespace to read this deployment from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "exact": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.deployment.ReadNamespacedDeployment.run (deployment_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReplaceNamespacedDeployment
class
prefect.tasks.kubernetes.deployment.ReplaceNamespacedDeployment
(deployment_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for replacing a namespaced deployment on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
deployment_name (str, optional)
: The name of a deployment to replacebody (dict, optional)
: A dictionary representation of a Kubernetes ExtensionsV1beta1Deployment specificationnamespace (str, optional)
: The Kubernetes namespace to patch this deployment in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.deployment.ReplaceNamespacedDeployment.run (deployment_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# CreateNamespacedJob
class
prefect.tasks.kubernetes.job.CreateNamespacedJob
(body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for creating a namespaced job on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
body (dict, optional)
: A dictionary representation of a Kubernetes V1Job specificationnamespace (str, optional)
: The Kubernetes namespace to create this job in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.job.CreateNamespacedJob.run (body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# DeleteNamespacedJob
class
prefect.tasks.kubernetes.job.DeleteNamespacedJob
(job_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for deleting a namespaced job on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
job_name (str, optional)
: The name of a job to deletenamespace (str, optional)
: The Kubernetes namespace to delete this job from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.job.DeleteNamespacedJob.run (job_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", delete_option_kwargs=None)[source] |
Task run method.
|
# ListNamespacedJob
class
prefect.tasks.kubernetes.job.ListNamespacedJob
(namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for listing namespaced jobs on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
namespace (str, optional)
: The Kubernetes namespace to list jobs from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"field_selector": "...", "label_selector": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.job.ListNamespacedJob.run (namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# PatchNamespacedJob
class
prefect.tasks.kubernetes.job.PatchNamespacedJob
(job_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for patching a namespaced job on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
job_name (str, optional)
: The name of a job to patchbody (dict, optional)
: A dictionary representation of a Kubernetes V1Job patch specificationnamespace (str, optional)
: The Kubernetes namespace to patch this job in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.job.PatchNamespacedJob.run (job_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReadNamespacedJob
class
prefect.tasks.kubernetes.job.ReadNamespacedJob
(job_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for reading a namespaced job on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
job_name (str, optional)
: The name of a job to readnamespace (str, optional)
: The Kubernetes namespace to read this job from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "exact": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.job.ReadNamespacedJob.run (job_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReplaceNamespacedJob
class
prefect.tasks.kubernetes.job.ReplaceNamespacedJob
(job_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for replacing a namespaced job on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
job_name (str, optional)
: The name of a job to replacebody (dict, optional)
: A dictionary representation of a Kubernetes V1Job specificationnamespace (str, optional)
: The Kubernetes namespace to patch this job in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.job.ReplaceNamespacedJob.run (job_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# CreateNamespacedPod
class
prefect.tasks.kubernetes.pod.CreateNamespacedPod
(body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for creating a namespaced pod on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
body (dict, optional)
: A dictionary representation of a Kubernetes V1Pod specificationnamespace (str, optional)
: The Kubernetes namespace to create this pod in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.pod.CreateNamespacedPod.run (body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# DeleteNamespacedPod
class
prefect.tasks.kubernetes.pod.DeleteNamespacedPod
(pod_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for deleting a namespaced pod on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
pod_name (str, optional)
: The name of a pod to deletenamespace (str, optional)
: The Kubernetes namespace to delete this pod from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.pod.DeleteNamespacedPod.run (pod_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", delete_option_kwargs=None)[source] |
Task run method.
|
# ListNamespacedPod
class
prefect.tasks.kubernetes.pod.ListNamespacedPod
(namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for listing namespaced pods on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
namespace (str, optional)
: The Kubernetes namespace to list pods from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"field_selector": "...", "label_selector": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.pod.ListNamespacedPod.run (namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# PatchNamespacedPod
class
prefect.tasks.kubernetes.pod.PatchNamespacedPod
(pod_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for patching a namespaced pod on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
pod_name (str, optional)
: The name of a pod to patchbody (dict, optional)
: A dictionary representation of a Kubernetes V1Pod patch specificationnamespace (str, optional)
: The Kubernetes namespace to patch this pod in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.pod.PatchNamespacedPod.run (pod_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReadNamespacedPod
class
prefect.tasks.kubernetes.pod.ReadNamespacedPod
(pod_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for reading a namespaced pod on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
pod_name (str, optional)
: The name of a pod to readnamespace (str, optional)
: The Kubernetes namespace to read this pod from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "exact": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.pod.ReadNamespacedPod.run (pod_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReplaceNamespacedPod
class
prefect.tasks.kubernetes.pod.ReplaceNamespacedPod
(pod_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for replacing a namespaced pod on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Pod in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
pod_name (str, optional)
: The name of a pod to replacebody (dict, optional)
: A dictionary representation of a Kubernetes V1Pod specificationnamespace (str, optional)
: The Kubernetes namespace to patch this pod in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.pod.ReplaceNamespacedPod.run (pod_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# CreateNamespacedService
class
prefect.tasks.kubernetes.service.CreateNamespacedService
(body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for creating a namespaced service on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Service in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
body (dict, optional)
: A dictionary representation of a Kubernetes V1Service specificationnamespace (str, optional)
: The Kubernetes namespace to create this service in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.service.CreateNamespacedService.run (body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# DeleteNamespacedService
class
prefect.tasks.kubernetes.service.DeleteNamespacedService
(service_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for deleting a namespaced service on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Service in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
service_name (str, optional)
: The name of a service to deletenamespace (str, optional)
: The Kubernetes namespace to delete this service from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.service.DeleteNamespacedService.run (service_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", delete_option_kwargs=None)[source] |
Task run method.
|
# ListNamespacedService
class
prefect.tasks.kubernetes.service.ListNamespacedService
(namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for listing namespaced services on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Service in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
namespace (str, optional)
: The Kubernetes namespace to list services from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"field_selector": "...", "label_selector": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.service.ListNamespacedService.run (namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# PatchNamespacedService
class
prefect.tasks.kubernetes.service.PatchNamespacedService
(service_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for patching a namespaced service on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Service in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
service_name (str, optional)
: The name of a service to patchbody (dict, optional)
: A dictionary representation of a Kubernetes V1Service patch specificationnamespace (str, optional)
: The Kubernetes namespace to patch this service in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.service.PatchNamespacedService.run (service_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReadNamespacedService
class
prefect.tasks.kubernetes.service.ReadNamespacedService
(service_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for reading a namespaced service on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Service in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The argument kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide kube_kwargs = {"info": "here"}
at instantiation and then provide kube_kwargs = {"more": "info"}
at run time which will make kube_kwargs = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
service_name (str, optional)
: The name of a service to readnamespace (str, optional)
: The Kubernetes namespace to read this service from, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "exact": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.service.ReadNamespacedService.run (service_name=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
# ReplaceNamespacedService
class
prefect.tasks.kubernetes.service.ReplaceNamespacedService
(service_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY", **kwargs)[source]Task for replacing a namespaced service on Kubernetes. Note that all initialization arguments can optionally be provided or overwritten at runtime.
This task will attempt to connect to a Kubernetes cluster in three steps with the first successful connection attempt becoming the mode of communication with a cluster.
- Attempt to use a Prefect Secret that contains a Kubernetes API Key. If
kubernetes_api_key_secret
=None
then it will attempt the next two connection mathods. By default the value isKUBERNETES_API_KEY
so providingNone
acts as an override for the remote connection. 2. Attempt in-cluster connection (will only work when running on a Service in a cluster) 3. Attempt out-of-cluster connection using the default location for a kube config file
The arguments body
and kube_kwargs
will perform an in-place update when the task is run. This means that it is possible to provide body = {"info": "here"}
at instantiation and then provide body = {"more": "info"}
at run time which will make body = {"info": "here", "more": "info"}
. Note: Keys present in both instantiation and runtime will be replaced with the runtime value.
Args:
service_name (str, optional)
: The name of a service to replacebody (dict, optional)
: A dictionary representation of a Kubernetes V1Service specificationnamespace (str, optional)
: The Kubernetes namespace to patch this service in, defaults to thedefault
namespacekube_kwargs (dict, optional)
: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty": "...", "dry_run": "..."}
)kubernetes_api_key_secret (str, optional)
: the name of the Prefect Secret which stored your Kubernetes API Key; this Secret must be a string and in BearerToken format**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.kubernetes.service.ReplaceNamespacedService.run (service_name=None, body=None, namespace="default", kube_kwargs=None, kubernetes_api_key_secret="KUBERNETES_API_KEY")[source] |
Task run method.
|
This documentation was auto-generated from commit n/a
on June 17, 2020 at 17:27 UTC