AkkaKubernetesClient

skuber.akkaclient.AkkaKubernetesClient
trait AkkaKubernetesClient extends KubernetesClient

This trait extends the generic KubernetesClient trait with streaming operations. These streaming operations have signatures that have types from the underlying streaming library, in this case Akka streams. This is the interface for any skuber client that is returned by skuber.akkaclient.k8sInit calls

Attributes

Graph
Supertypes
trait KubernetesClient
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def exec(podName: String, command: Seq[String], maybeContainerName: Option[String], maybeStdin: Option[Source[String, _]], maybeStdout: Option[Sink[String, _]], maybeStderr: Option[Sink[String, _]], tty: Boolean, maybeClose: Option[Promise[Unit]])(implicit lc: LoggingContext): Future[Unit]

Execute a command in a pod (similar to kubectl exec ...)

Execute a command in a pod (similar to kubectl exec ...)

Value parameters

command

the command to execute

maybeClose

if set, this can be used to close the connection to the pod by completing the promise

maybeContainerName

an optional container name

maybeStderr

optional Akka Sink to receive output from stderr for the command

maybeStdin

optional Akka Source for sending input to stdin for the command

maybeStdout

optional Akka Sink to receive output from stdout for the command

podName

the name of the pod

tty

optionally set tty on

Attributes

Returns

A future indicating the exec command has been submitted

def getPodLogSource(name: String, queryParams: LogQueryParams, namespace: Option[String])(implicit lc: LoggingContext): Future[Source[ByteString, _]]

Get the logs from a pod (similar to kubectl logs ...). The logs are streamed using an Akka streams source

Get the logs from a pod (similar to kubectl logs ...). The logs are streamed using an Akka streams source

Value parameters

name

the name of the pod

namespace

if set this specifies the namespace of the pod (otherwise the configured namespace is used)

queryParams

optional parameters of the request (for example container name)

Attributes

Returns

A future containing a Source for the logs stream.

def watch[O <: ObjectResource](obj: O)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[Source[WatchEvent[O], _]]
def watch[O <: ObjectResource](name: String, sinceResourceVersion: Option[String], bufSize: Int)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[Source[WatchEvent[O], _]]
def watchAll[O <: ObjectResource](sinceResourceVersion: Option[String], bufSize: Int)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[Source[WatchEvent[O], _]]
def watchAllContinuously[O <: ObjectResource](sinceResourceVersion: Option[String], bufSize: Int, errorHandler: Option[String => ])(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Source[WatchEvent[O], _]
def watchContinuously[O <: ObjectResource](obj: O)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Source[WatchEvent[O], _]
def watchContinuously[O <: ObjectResource](name: String, sinceResourceVersion: Option[String], bufSize: Int, errorHandler: Option[String => ])(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Source[WatchEvent[O], _]
def watchWithOptions[O <: ObjectResource](options: ListOptions, bufsize: Int, errorHandler: Option[String => ])(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Source[WatchEvent[O], _]

Inherited methods

def close(): Unit

Closes the client. Any requests to the client after this is called will be rejected.

Closes the client. Any requests to the client after this is called will be rejected.

Attributes

Inherited from:
KubernetesClient
def create[O <: ObjectResource](obj: O)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[O]

Create a new object resource. If the namespace metadata field is set to a non-empty value then the object will be created in that namespace, otherwise it will be created in the configured namespace of the client.

Create a new object resource. If the namespace metadata field is set to a non-empty value then the object will be created in that namespace, otherwise it will be created in the configured namespace of the client.

Type parameters

O

the specific object resource type e.g. Pod, Deployment

Value parameters

obj

the resource to create on the cluster

Attributes

Returns

A future containing the created resource returned by Kubernetes

Inherited from:
KubernetesClient
def delete[O <: ObjectResource](name: String, gracePeriodSeconds: Int)(implicit rd: ResourceDefinition[O], lc: LoggingContext): Future[Unit]

Delete an existing object resource

Delete an existing object resource

Value parameters

gracePeriodSeconds

optional parameter specifying a grace period to be applied before hard killing the resource

name

the name of the resource to delete

Attributes

Returns

A future that will be set to success if the deletion request was accepted by Kubernetes, otherwise failure

Inherited from:
KubernetesClient
def deleteAll[L <: ListResource[_]]()(implicit fmt: Format[L], rd: ResourceDefinition[L], lc: LoggingContext): Future[L]

Delete all resources of specified type in current namespace

Delete all resources of specified type in current namespace

Type parameters

L

list resource type of resources to delete e.g. PodList, DeploymentList

Attributes

Returns

A future containing the list of all deleted resources

Inherited from:
KubernetesClient
def deleteAllSelected[L <: ListResource[_]](labelSelector: LabelSelector)(implicit fmt: Format[L], rd: ResourceDefinition[L], lc: LoggingContext): Future[L]

Delete all resources of specified type selected by a specified label selector in current namespace

Delete all resources of specified type selected by a specified label selector in current namespace

Type parameters

L

the list resource type of resources to delete e.g. PodList, DeploymentList

Value parameters

labelSelector

selects the resources to delete

Attributes

Returns

A future containing the list of all deleted resources

Inherited from:
KubernetesClient
def deleteWithOptions[O <: ObjectResource](name: String, options: DeleteOptions)(implicit rd: ResourceDefinition[O], lc: LoggingContext): Future[Unit]

Delete an existing object resource

Delete an existing object resource

Type parameters

O

the specific object resource type e.g. Pod, Deployment

Value parameters

name

the name of the resource to delete

options

contains various options that can be passed to the deletion operation, see Kubernetes documentation

Attributes

Returns

A future that will be set to success if the deletion request was accepted by Kubernetes, otherwise failure

Inherited from:
KubernetesClient
def get[O <: ObjectResource](name: String)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[O]

Retrieve the object resource with the specified name and type

Retrieve the object resource with the specified name and type

Type parameters

O

the specific object resource type e.g. Pod, Deployment

Value parameters

name

the name of the object resource

Attributes

Returns

A future containing the retrieved resource (or an exception if resource not found)

Inherited from:
KubernetesClient
def getInNamespace[O <: ObjectResource](name: String, namespace: String)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[O]

Retrieve the object resource with the specified name and type from the specified namespace

Retrieve the object resource with the specified name and type from the specified namespace

Type parameters

O

the specific object resource type e.g. Pod, Deployment

Value parameters

name

the name of the object resource

namespace

the namespace containing the object resource

Attributes

Returns

A future containing Some(resource) if the resource is found on the cluster otherwise None

Inherited from:
KubernetesClient
def getNamespaceNames(implicit lc: LoggingContext): Future[List[String]]

Return a list of the names of all namespaces in the cluster

Return a list of the names of all namespaces in the cluster

Attributes

Returns

a future containing the list of names of all namespaces in the cluster

Inherited from:
KubernetesClient
def getOption[O <: ObjectResource](name: String)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[Option[O]]

Retrieve the object resource with the specified name and type, returning None if resource does not exist

Retrieve the object resource with the specified name and type, returning None if resource does not exist

Type parameters

O

the specific object resource type e.g. Pod, Deployment

Value parameters

name

the name of the object resource

Attributes

Returns

A future containing Some(resource) if the resource is found on the cluster, or None if not found

Inherited from:
KubernetesClient
def getScale[O <: ObjectResource](objName: String)(implicit rd: ResourceDefinition[O], sc: SubresourceSpec[O], lc: LoggingContext): Future[Scale]

Get the scale subresource of the named object resource This can only be called on certain resource types that support scale subresources. Normally used in advanced use cases such as custom controllers

Get the scale subresource of the named object resource This can only be called on certain resource types that support scale subresources. Normally used in advanced use cases such as custom controllers

Type parameters

O

the type of the resource e.g. Pod

Value parameters

objName

the name of the resource

sc

this implicit parameter provides evidence that the resource type supports scale subresources. Normally defined in the companion object of the resource type if applicable so does not need to be imported.

Attributes

Returns

a future containing the scale subresource

Inherited from:
KubernetesClient
def getServerAPIVersions(implicit lc: LoggingContext): Future[List[String]]

Return list of API versions supported by the server

Return list of API versions supported by the server

Value parameters

lc

logging context

Attributes

Returns

a future containing the list of API versions

Inherited from:
KubernetesClient
def getStatus[O <: ObjectResource](name: String)(implicit fmt: Format[O], rd: ResourceDefinition[O], statusEv: HasStatusSubresource[O], lc: LoggingContext): Future[O]

Get the status subresource of a given object resource. Only supported by certain object resource kinds (which need to have defined an implicit HasStatusResource) This method is generally for advanced use cases such as custom controllers.

Get the status subresource of a given object resource. Only supported by certain object resource kinds (which need to have defined an implicit HasStatusResource) This method is generally for advanced use cases such as custom controllers.

Type parameters

O

the resource type e.g. Pod, Deployment

Value parameters

name

the name of the object resource

statusEv

this implicit provides evidence that the resource kind has status subresources, so supports this method

Attributes

Returns

A future containing the object resource including current status

Inherited from:
KubernetesClient
def list[L <: ListResource[_]]()(implicit fmt: Format[L], rd: ResourceDefinition[L], lc: LoggingContext): Future[L]

Get list of all resources of specified type in the configured namespace for the client

Get list of all resources of specified type in the configured namespace for the client

Type parameters

L

the list type to retrieve e.g. PodList, DeploymentList

Attributes

Returns

A future containing the resource list retrieved

Inherited from:
KubernetesClient
def listByNamespace[L <: ListResource[_]]()(implicit fmt: Format[L], rd: ResourceDefinition[L], lc: LoggingContext): Future[Map[String, L]]

Get list of all resources across all namespaces in the cluster of a specified list type, grouped by namespace

Get list of all resources across all namespaces in the cluster of a specified list type, grouped by namespace

Type parameters

L

the list resource type of resources to list e.g. PodList, DeploymentList

Attributes

Returns

A future with a map containing an entry for each namespace, each entry consists of a list of resources keyed by the name of their namesapce

Inherited from:
KubernetesClient
def listInNamespace[L <: ListResource[_]](theNamespace: String)(implicit fmt: Format[L], rd: ResourceDefinition[L], lc: LoggingContext): Future[L]

Get list of resources of a given type in a specified namespace

Get list of resources of a given type in a specified namespace

Type parameters

L

the list resource type of the objects to retrieve e.g. PodList, DeploymentList

Value parameters

theNamespace

the namespace to search

Attributes

Returns

A future containing the resource list retrieved

Inherited from:
KubernetesClient
def listSelected[L <: ListResource[_]](labelSelector: LabelSelector)(implicit fmt: Format[L], rd: ResourceDefinition[L], lc: LoggingContext): Future[L]

Get list of selected resources of specified type in the configured namespace for the client

Get list of selected resources of specified type in the configured namespace for the client

Type parameters

L

the list type of the resources to retrieve e.g. PodList, DeploymentList

Value parameters

labelSelector

the label selector to use to select the resources to return

Attributes

Returns

A future containing the resource list retrieved

Inherited from:
KubernetesClient
def listWithOptions[L <: ListResource[_]](options: ListOptions)(implicit fmt: Format[L], rd: ResourceDefinition[L], lc: LoggingContext): Future[L]

Get list of resources of specified type, applying the specified options to the list request

Get list of resources of specified type, applying the specified options to the list request

Type parameters

L

the list type of the resources to retrieve e.g. PodList, DeploymentList

Value parameters

options

a set of options to be added to the request that can modify how the request is handled by Kubernetes.

Attributes

Returns

A future containing the resource list retrieved

Inherited from:
KubernetesClient
def patch[P <: Patch, O <: ObjectResource](name: String, patchData: P, namespace: Option[String])(implicit patchfmt: Writes[P], fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[O]

Patch a resource

Patch a resource

Type parameters

O

the type of the resource to be patched

P

the patch type (specifies the patch strategy details)

Value parameters

name

The name of the resource to patch

namespace

the namespace (defaults to currently configured namespace)

patchData

The patch data to apply to the resource

patchfmt

an implicit parameter that knows how to serialise the patch data to Json

Attributes

Returns

a future containing the patched resource

Inherited from:
KubernetesClient
def update[O <: ObjectResource](obj: O)(implicit fmt: Format[O], rd: ResourceDefinition[O], lc: LoggingContext): Future[O]

Update an existing object resource

Update an existing object resource

Value parameters

obj

the resource with the desired updates

Attributes

Returns

A future containing the updated resource returned by Kubernetes

Inherited from:
KubernetesClient
def updateScale[O <: ObjectResource](objName: String, scale: Scale)(implicit rd: ResourceDefinition[O], sc: SubresourceSpec[O], lc: LoggingContext): Future[Scale]

Update the scale subresource of a specified resource This can only be called on certain resource types that support scale subresources. Normally used in advanced use cases such as custom controllers

Update the scale subresource of a specified resource This can only be called on certain resource types that support scale subresources. Normally used in advanced use cases such as custom controllers

Type parameters

O

the type of the resource

Value parameters

objName

the name of the resource

sc

this implicit parameter provides evidence that the resource type supports scale subresources. Normally defined in the companion object of the resource type if applicable so does not need to be imported

scale

the updated scale to set on the resource

Attributes

Returns

a future containing the successfully updated scale subresource

Inherited from:
KubernetesClient
def updateStatus[O <: ObjectResource](obj: O)(implicit fmt: Format[O], rd: ResourceDefinition[O], statusEv: HasStatusSubresource[O], lc: LoggingContext): Future[O]

Update the status subresource of a given object resource. Only supported by certain object resource kinds (which need to have defined an implicit HasStatusResource) This method is generally for advanced use cases such as custom controllers

Update the status subresource of a given object resource. Only supported by certain object resource kinds (which need to have defined an implicit HasStatusResource) This method is generally for advanced use cases such as custom controllers

Type parameters

O

The resource type

Value parameters

obj

the name of the object resource whose status subresource is to be updated

statusEv

this implicit provides evidence that the resource kind has status subresources, so supports this method

Attributes

Returns

A future containing the full updated object resource

Inherited from:
KubernetesClient
def usingNamespace(newNamespace: String): KubernetesClient

Create a new KubernetesClient instance that reuses this clients configuration and connection resources, but with a different target namespace. This is useful for applications that need a lightweight way to target multiple or dynamic namespaces.

Create a new KubernetesClient instance that reuses this clients configuration and connection resources, but with a different target namespace. This is useful for applications that need a lightweight way to target multiple or dynamic namespaces.

Value parameters

newNamespace

target namespace

Attributes

Returns

the new client instance

Inherited from:
KubernetesClient

Inherited fields

val clusterServer: String

Attributes

Inherited from:
KubernetesClient
val logConfig: LoggingConfig

Attributes

Inherited from:
KubernetesClient
val namespaceName: String

Attributes

Inherited from:
KubernetesClient