Class KubectlClient

java.lang.Object
io.quarkus.test.bootstrap.inject.KubectlClient

public final class KubectlClient extends Object
  • Field Details

  • Method Details

    • create

      public static KubectlClient create(String scenarioName)
    • namespace

      public String namespace()
      Returns:
      the current namespace
    • apply

      public void apply(Service service, Path file)
      Apply the file into Kubernetes.
      Parameters:
      file -
    • applyServicePropertiesUsingDeploymentConfig

      public void applyServicePropertiesUsingDeploymentConfig(Service service)
      Update the deployment config using the service properties.
      Parameters:
      service -
    • applyServiceProperties

      public void applyServiceProperties(Service service, String file, UnaryOperator<String> update, Path target)
      Update the file and then apply the file into Kubernetes. A copy of the end template will be placed in the target location.
    • applyServiceProperties

      public void applyServiceProperties(Service service, String file, UnaryOperator<String> update, Map<String,String> extraTemplateProperties, Path target)
      Update the file with extra template properties and then apply the file into Kubernetes. A copy of the end template will be placed in the target location.
    • expose

      public void expose(Service service, Integer port)
      Expose the service and port defined.
      Parameters:
      service -
      port -
    • scaleTo

      public void scaleTo(Service service, int replicas)
      Scale the service to the replicas.
      Parameters:
      service -
      replicas -
    • podsInService

      public List<io.fabric8.kubernetes.api.model.Pod> podsInService(Service service)
      Get the running pods in the current service.
    • logs

      public Map<String,String> logs()
      Get all the logs for all the pods within the current namespace.
      Returns:
    • logs

      public Map<String,String> logs(Service service)
      Get all the logs for all the pods within one service.
      Parameters:
      service -
      Returns:
    • host

      public String host()
      Get node host IP.
    • port

      public int port(Service service)
      Resolve the port by the service.
      Parameters:
      service -
      Returns:
    • deleteNamespace

      public void deleteNamespace()
      Delete the namespace and all the resources.
    • getScenarioId

      public String getScenarioId()