Class FileBasedKubernetesProbe

java.lang.Object
com.nt.udc.kubernetes.probes.providers.FileBasedKubernetesProbe
All Implemented Interfaces:
KubernetesProbeIfc

public class FileBasedKubernetesProbe extends Object implements KubernetesProbeIfc
Implementation of KubernetesProbeIfc that manages Kubernetes probes using files. The status of a probe is tracked by the presence or absence of a file on the filesystem.
  • Constructor Details

    • FileBasedKubernetesProbe

      public FileBasedKubernetesProbe(Path file)
  • Method Details

    • updateProbe

      public boolean updateProbe(boolean status)
      Updates the probe status by creating or deleting the probe file based on the input status. If the status is true, the file is created if it doesn't exist. If the status is false, the file is deleted if it exists.
      Specified by:
      updateProbe in interface KubernetesProbeIfc
      Parameters:
      status - The new status for the probe. If true, the probe is healthy and the file is created. If false, the file is deleted.
      Returns:
      true if the probe status was successfully updated, false otherwise.