Skip to content

Add support for spring.cloud.kubernetes.discovery.service-labels filter in Fabric8ServicesListSupplier #1965

@Vsevolod123

Description

@Vsevolod123

Description

The current implementation of Fabric8ServicesListSupplier does not take into account the service labels filter specified in the spring.cloud.kubernetes.discovery.service-labels property. This feature would enhance the service discovery mechanism by allowing users to filter services based on their labels.

Motivation

  • Enhanced Filtering Capabilities: Allow users to selectively discover services based on specific labels, improving the flexibility of service discovery.
  • Improved Configuration Management: Provide a more granular way to manage and discover services within a Kubernetes cluster.
  • Better Integration: Align with existing Spring Cloud Kubernetes configuration properties for a consistent user experience.

Proposed Solution

Modify the Fabric8ServicesListSupplier to:

  • Apply labels from property spring.cloud.kubernetes.discovery.service-labels as filters when querying services from Kubernetes.

Example Usage

Configuration in application.properties:

spring:
  cloud:
    kubernetes:
      discovery:
        service-labels:
          environment: production
          team: dev

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions