Class KubernetesClientFactory


  • public class KubernetesClientFactory
    extends Object
    Creates Kubernetes API clients from kubeconfig or default configuration.
    • Constructor Detail

      • KubernetesClientFactory

        public KubernetesClientFactory()
    • Method Detail

      • createDefaultClient

        public io.kubernetes.client.openapi.ApiClient createDefaultClient()
                                                                   throws IOException
        Creates a Kubernetes API client.

        If KUBECONFIG is provided as a Java system property or environment variable, that kubeconfig file is used. If the value is a relative path, this method first checks the working directory and then the test classpath. Otherwise, the default Kubernetes client configuration is used.

        Returns:
        configured Kubernetes API client
        Throws:
        IOException - if Kubernetes configuration cannot be loaded