com.coralogix.zio.k8s.client.config

Contains data structures, ZIO layers and zio-config descriptors for configuring the zio-k8s client.

Each zio-k8s client module depends on two ZIO modules: com.coralogix.zio.k8s.client.model.K8sCluster and an sttp.client3.SttpBackend. To use the default configuration (use kubeconfig if available, otherwise fallback to service account token), use either asynchttpclient.k8sDefault or httpclient.k8sDefault depending on your chosen sttp backend.

Manual configuration is possible by providing a K8sClusterConfig value to both the k8sCluster layer and either asynchttpclient.k8sSttpClient or httpclient.k8sSttpClient.

Instead of manually providing the configuration, zio-config descriptors are available to load them from any supported source.

Attributes

Members list

Packages

HTTP client implementation based on the async-http-client-zio backend

HTTP client implementation based on the async-http-client-zio backend

Attributes

HTTP client implementation based on the httpclient-zio backend

HTTP client implementation based on the httpclient-zio backend

Attributes

Type members

Classlikes

trait Descriptors

Defines ZIO Config descriptors for all the configuration data types of zio-k8s

Defines ZIO Config descriptors for all the configuration data types of zio-k8s

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class ExecConfig(apiVersion: String, command: String, env: Option[Set[ExecEnv]], args: Option[List[String]], installHint: Option[String], provideClusterInfo: Option[Boolean])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ExecConfig

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ExecConfig.type
final case class ExecCredentialStatus(token: Option[String], certificate: Option[ClientCertificates])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ExecCredentials(kind: String, apiVersion: String, status: ExecCredentialStatus)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class ExecEnv(name: String, value: String)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ExecEnv

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ExecEnv.type

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait K8sAuthentication

Type of authentication to use with the Kubernetes cluster

Type of authentication to use with the Kubernetes cluster

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class K8sClientConfig(debug: Boolean, serverCertificate: K8sServerCertificate)

Configuration for the HTTP connection towards the Kubernetes API

Configuration for the HTTP connection towards the Kubernetes API

Value parameters

debug

Enables detailed debug logging

serverCertificate

The server certificate to use

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class K8sClusterConfig(host: Uri, authentication: K8sAuthentication, client: K8sClientConfig)

Configures the zio-k8s client

Configures the zio-k8s client

This is the top level configuration class.

Value parameters

authentication

Authentication method to use

client

HTTP client configuration

host

URL of the Kubernetes API

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait K8sServerCertificate

Configured Kubernetes server certifications

Configured Kubernetes server certifications

K8sServerCertificate.Insecure should only be used for testing purposes.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Insecure.type
class Secure
object KeySource

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
KeySource.type
sealed trait KeySource

Abstraction for configuring keys

Abstraction for configuring keys

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class FromBase64
class FromFile
class FromString
case class Kubeconfig(clusters: List[KubeconfigCluster], contexts: List[KubeconfigContext], users: List[KubeconfigUser], current-context: String)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Kubeconfig

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Kubeconfig.type
case class KubeconfigCluster(name: String, cluster: KubeconfigClusterInfo)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class KubeconfigClusterInfo(server: String, certificate-authority: Option[String], certificate-authority-data: Option[String])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class KubeconfigContext(name: String, context: KubeconfigContextInfo)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class KubeconfigContextInfo(cluster: String, user: String, namespace: Option[String])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class KubeconfigUser(name: String, user: KubeconfigUserInfo)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class KubeconfigUserInfo(client-certificate: Option[String], client-certificate-data: Option[String], client-key: Option[String], client-key-data: Option[String], token: Option[String], username: Option[String], password: Option[String], exec: Option[ExecConfig])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object SSL

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
SSL.type

Value members

Concrete methods

def fromKubeconfig(kubeconfig: Kubeconfig, configPath: Option[Path], context: Option[String], debug: Boolean, disableHostnameVerification: Boolean): ZIO[Any, Throwable, K8sClusterConfig]
def kubeconfig(context: Option[String], debug: Boolean, disableHostnameVerification: Boolean): Layer[Throwable, K8sClusterConfig]

Layer producing a K8sClusterConfig by loading a kubeconfig file

Layer producing a K8sClusterConfig by loading a kubeconfig file

If the KUBECONFIG environment variable is set, that will be used as the kubeconfig file's path, otherwise ~/.kube/config based on the current user's home directory.

To use a specific kubeconfig file path, use kubeconfigFile.

Value parameters

context

Override the current context in the configuration file and use another one

debug

Enable debug request/response logging

disableHostnameVerification

Disables hostname verification on the SSL connection

Attributes

def kubeconfigFile(configPath: Path, context: Option[String], debug: Boolean, disableHostnameVerification: Boolean): ZLayer[Any, Throwable, K8sClusterConfig]

Layer setting up a com.coralogix.zio.k8s.client.model.K8sCluster by loading a specific kubeconfig file

Layer setting up a com.coralogix.zio.k8s.client.model.K8sCluster by loading a specific kubeconfig file

Value parameters

configPath

Path to the kubeconfig file to load

context

Override the current context in the configuration file and use another one

debug

Enable debug request/response logging

disableHostnameVerification

Disables hostname verification on the SSL connection

Attributes

def kubeconfigFromString(configString: String, context: Option[String], debug: Boolean, disableHostnameVerification: Boolean): ZIO[Any, Throwable, K8sClusterConfig]
def serviceAccount(debug: Boolean): ZLayer[Any, Nothing, K8sClusterConfig]

Layer producing a K8sClusterConfig using the default service account when running from inside a pod.

Layer producing a K8sClusterConfig using the default service account when running from inside a pod.

Value parameters

debug

Enable debug request/response logging

Attributes

Concrete fields

Layer producing a K8sClusterConfig that first tries to load a kubeconfig and if it cannot find one fallbacks to using the default service account token.

Layer producing a K8sClusterConfig that first tries to load a kubeconfig and if it cannot find one fallbacks to using the default service account token.

For more customization see kubeconfig and serviceAccount or provide a K8sClusterConfig manually.

Attributes

Layer producing a com.coralogix.zio.k8s.client.model.K8sCluster from a K8sClusterConfig

Layer producing a com.coralogix.zio.k8s.client.model.K8sCluster from a K8sClusterConfig

This can be used to either set up from a configuration source with zio-config or provide the hostname and token programmatically for the Kubernetes client.

Attributes

Inherited fields

ZIO Config descriptor for K8sClusterConfig

ZIO Config descriptor for K8sClusterConfig

Attributes

Inherited from:
Descriptors