Packages

package 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.

Linear Supertypes
Descriptors, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. config
  2. Descriptors
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait Descriptors extends AnyRef

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

  2. final case class ExecConfig(apiVersion: String, command: String, env: Option[Set[ExecEnv]], args: Option[List[String]], installHint: Option[String], provideClusterInfo: Option[Boolean]) extends Product with Serializable
  3. final case class ExecCredentialStatus(token: Option[String], certificate: Option[ClientCertificates]) extends Product with Serializable
  4. final case class ExecCredentials(kind: String, apiVersion: String, status: ExecCredentialStatus) extends Product with Serializable
  5. final case class ExecEnv(name: String, value: String) extends Product with Serializable
  6. sealed trait K8sAuthentication extends AnyRef

    Type of authentication to use with the Kubernetes cluster

  7. case class K8sClientConfig(debug: Boolean, serverCertificate: K8sServerCertificate) extends Product with Serializable

    Configuration for the HTTP connection towards the Kubernetes API

    Configuration for the HTTP connection towards the Kubernetes API

    debug

    Enables detailed debug logging

    serverCertificate

    The server certificate to use

  8. case class K8sClusterConfig(host: Uri, authentication: K8sAuthentication, client: K8sClientConfig) extends Product with Serializable

    Configures the zio-k8s client

    Configures the zio-k8s client

    This is the top level configuration class.

    host

    URL of the Kubernetes API

    authentication

    Authentication method to use

    client

    HTTP client configuration

  9. sealed trait K8sServerCertificate extends AnyRef

    Configured Kubernetes server certifications

    Configured Kubernetes server certifications

    K8sServerCertificate.Insecure should only be used for testing purposes.

  10. sealed trait KeySource extends AnyRef

    Abstraction for configuring keys

  11. case class Kubeconfig(clusters: List[KubeconfigCluster], contexts: List[KubeconfigContext], users: List[KubeconfigUser], current-context: String) extends Product with Serializable
  12. case class KubeconfigCluster(name: String, cluster: KubeconfigClusterInfo) extends Product with Serializable
  13. case class KubeconfigClusterInfo(server: String, certificate-authority: Option[String], certificate-authority-data: Option[String]) extends Product with Serializable
  14. case class KubeconfigContext(name: String, context: KubeconfigContextInfo) extends Product with Serializable
  15. case class KubeconfigContextInfo(cluster: String, user: String, namespace: Option[String]) extends Product with Serializable
  16. case class KubeconfigUser(name: String, user: KubeconfigUserInfo) extends Product with Serializable
  17. 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]) extends Product with Serializable

Value Members

  1. val clusterConfigDescriptor: Config[K8sClusterConfig]

    ZIO Config descriptor for K8sClusterConfig

    ZIO Config descriptor for K8sClusterConfig

    Definition Classes
    Descriptors
  2. val defaultConfigChain: ZLayer[Any, Throwable, K8sClusterConfig]

    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.

  3. def fromKubeconfig(kubeconfig: Kubeconfig, configPath: Option[Path], context: Option[String], debug: Boolean, disableHostnameVerification: Boolean): ZIO[Any, Throwable, K8sClusterConfig]
  4. val k8sCluster: ZLayer[K8sClusterConfig, Throwable, K8sCluster]

    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.

  5. def kubeconfig(context: Option[String] = None, debug: Boolean = false, disableHostnameVerification: Boolean = false): 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.

    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

  6. def kubeconfigFile(configPath: Path, context: Option[String] = None, debug: Boolean = false, disableHostnameVerification: Boolean = false): 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

    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

  7. def kubeconfigFromString(configString: String, context: Option[String] = None, debug: Boolean = false, disableHostnameVerification: Boolean = false): ZIO[Any, Throwable, K8sClusterConfig]
  8. def serviceAccount(debug: Boolean = false): 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.

    debug

    Enable debug request/response logging

  9. object ExecConfig extends Serializable
  10. object ExecCredentials extends Serializable
  11. object ExecEnv extends Serializable
  12. object K8sAuthentication
  13. object K8sServerCertificate
  14. object KeySource
  15. object Kubeconfig extends Serializable
  16. object KubeconfigCluster extends Serializable
  17. object KubeconfigClusterInfo extends Serializable
  18. object KubeconfigContext extends Serializable
  19. object KubeconfigContextInfo extends Serializable
  20. object KubeconfigUser extends Serializable
  21. object KubeconfigUserInfo extends Serializable
  22. object SSL

Inherited from Descriptors

Inherited from AnyRef

Inherited from Any

Ungrouped