Skip to main content

prefect_kubernetes.services

Tasks for working with Kubernetes services.

Functions

create_namespaced_service

Create a namespaced Kubernetes service. Args:
  • kubernetes_credentials: A KubernetesCredentials block used to generate a CoreV1Api client.
  • new_service: A V1Service object representing the service to create.
  • namespace: The namespace to create the service in.
  • **kube_kwargs: Additional keyword arguments to pass to the CoreV1Api method call.
Returns:
  • A V1Service representing the created service.

delete_namespaced_service

Delete a namespaced Kubernetes service. Args:
  • kubernetes_credentials: KubernetesCredentials block for creating authenticated Kubernetes API clients.
  • service_name: The name of the service to delete.
  • delete_options: A V1DeleteOptions object representing the options to delete the service with.
  • namespace: The namespace to delete the service from.
  • **kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
Returns:
  • A V1Service representing the deleted service.

list_namespaced_service

List namespaced Kubernetes services. Args:
  • kubernetes_credentials: KubernetesCredentials block for creating authenticated Kubernetes API clients.
  • namespace: The namespace to list services from.
  • **kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
Returns:
  • A V1ServiceList representing the list of services in the given namespace.

patch_namespaced_service

Patch a namespaced Kubernetes service. Args:
  • kubernetes_credentials: KubernetesCredentials block for creating authenticated Kubernetes API clients.
  • service_name: The name of the service to patch.
  • service_updates: A V1Service object representing patches to service_name.
  • namespace: The namespace to patch the service in.
  • **kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
Returns:
  • A V1Service representing the patched service.

read_namespaced_service

Read a namespaced Kubernetes service. Args:
  • kubernetes_credentials: KubernetesCredentials block for creating authenticated Kubernetes API clients.
  • service_name: The name of the service to read.
  • namespace: The namespace to read the service from.
  • **kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
Returns:
  • A V1Service object representing the service.

replace_namespaced_service

Replace a namespaced Kubernetes service. Args:
  • kubernetes_credentials: KubernetesCredentials block for creating authenticated Kubernetes API clients.
  • service_name: The name of the service to replace.
  • new_service: A V1Service object representing the new service.
  • namespace: The namespace to replace the service in.
  • **kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
Returns:
  • A V1Service representing the new service.