Record Class KubernetesDiscoveryProperties

java.lang.Object
java.lang.Record
org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties
Record Components:
enabled - if kubernetes discovery is enabled
allNamespaces - if discovery is enabled for all namespaces
namespaces - If set and allNamespaces is false, then only the services and endpoints matching these namespaces will be fetched from the Kubernetes API server.
waitCacheReady - wait for the discovery cache (service and endpoints) to be fully loaded, otherwise aborts the application on starting
cacheLoadingTimeoutSeconds - timeout for initializing discovery cache, will abort the application if exceeded.
includeNotReadyAddresses - include as discovered if endpoint addresses is not marked with 'ready' by kubernetes
filter - SpEL expression to filter services after they have been retrieved from the Kubernetes API server.
knownSecurePorts - set of known secure ports
serviceLabels - if set, then only the services matching these labels will be fetched from the Kubernetes API server.
primaryPortName - If set then the port with a given name is used as primary when multiple ports are defined for a service.
useEndpointSlices - use EndpointSlice instead of Endpoints
includeExternalNameServices - should the discovery also search for services that have "type: ExternalName" in their spec.

@ConfigurationProperties("spring.cloud.kubernetes.discovery") public record KubernetesDiscoveryProperties(boolean enabled, boolean allNamespaces, Set<String> namespaces, boolean waitCacheReady, long cacheLoadingTimeoutSeconds, boolean includeNotReadyAddresses, String filter, Set<Integer> knownSecurePorts, Map<String,String> serviceLabels, String primaryPortName, KubernetesDiscoveryProperties.Metadata metadata, int order, boolean useEndpointSlices, boolean includeExternalNameServices, String discoveryServerUrl) extends Record
  • Field Details

  • Constructor Details

    • KubernetesDiscoveryProperties

      @ConstructorBinding public KubernetesDiscoveryProperties(@DefaultValue("true") boolean enabled, boolean allNamespaces, @DefaultValue Set<String> namespaces, @DefaultValue("true") boolean waitCacheReady, @DefaultValue("60") long cacheLoadingTimeoutSeconds, boolean includeNotReadyAddresses, String filter, @DefaultValue({"443","8443"}) Set<Integer> knownSecurePorts, @DefaultValue Map<String,String> serviceLabels, String primaryPortName, @DefaultValue KubernetesDiscoveryProperties.Metadata metadata, @DefaultValue("0") int order, boolean useEndpointSlices, boolean includeExternalNameServices, String discoveryServerUrl)
      Creates an instance of a KubernetesDiscoveryProperties record class.
      Parameters:
      enabled - the value for the enabled record component
      allNamespaces - the value for the allNamespaces record component
      namespaces - the value for the namespaces record component
      waitCacheReady - the value for the waitCacheReady record component
      cacheLoadingTimeoutSeconds - the value for the cacheLoadingTimeoutSeconds record component
      includeNotReadyAddresses - the value for the includeNotReadyAddresses record component
      filter - the value for the filter record component
      knownSecurePorts - the value for the knownSecurePorts record component
      serviceLabels - the value for the serviceLabels record component
      primaryPortName - the value for the primaryPortName record component
      metadata - the value for the metadata record component
      order - the value for the order record component
      useEndpointSlices - the value for the useEndpointSlices record component
      includeExternalNameServices - the value for the includeExternalNameServices record component
      discoveryServerUrl - the value for the discoveryServerUrl record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • allNamespaces

      public boolean allNamespaces()
      Returns the value of the allNamespaces record component.
      Returns:
      the value of the allNamespaces record component
    • namespaces

      public Set<String> namespaces()
      Returns the value of the namespaces record component.
      Returns:
      the value of the namespaces record component
    • waitCacheReady

      public boolean waitCacheReady()
      Returns the value of the waitCacheReady record component.
      Returns:
      the value of the waitCacheReady record component
    • cacheLoadingTimeoutSeconds

      public long cacheLoadingTimeoutSeconds()
      Returns the value of the cacheLoadingTimeoutSeconds record component.
      Returns:
      the value of the cacheLoadingTimeoutSeconds record component
    • includeNotReadyAddresses

      public boolean includeNotReadyAddresses()
      Returns the value of the includeNotReadyAddresses record component.
      Returns:
      the value of the includeNotReadyAddresses record component
    • filter

      public String filter()
      Returns the value of the filter record component.
      Returns:
      the value of the filter record component
    • knownSecurePorts

      public Set<Integer> knownSecurePorts()
      Returns the value of the knownSecurePorts record component.
      Returns:
      the value of the knownSecurePorts record component
    • serviceLabels

      public Map<String,String> serviceLabels()
      Returns the value of the serviceLabels record component.
      Returns:
      the value of the serviceLabels record component
    • primaryPortName

      public String primaryPortName()
      Returns the value of the primaryPortName record component.
      Returns:
      the value of the primaryPortName record component
    • metadata

      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • order

      public int order()
      Returns the value of the order record component.
      Returns:
      the value of the order record component
    • useEndpointSlices

      public boolean useEndpointSlices()
      Returns the value of the useEndpointSlices record component.
      Returns:
      the value of the useEndpointSlices record component
    • includeExternalNameServices

      public boolean includeExternalNameServices()
      Returns the value of the includeExternalNameServices record component.
      Returns:
      the value of the includeExternalNameServices record component
    • discoveryServerUrl

      public String discoveryServerUrl()
      Returns the value of the discoveryServerUrl record component.
      Returns:
      the value of the discoveryServerUrl record component