spring-cloud/spring-cloud-kubernetes

Configuration Watcher - Add The Ability To Notify Apps Based On Labels

已關閉

#1,816 建立於 2024年12月9日

 (11 則留言) (0 個反應) (0 位負責人)Java (1,015 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (3,375 顆星)
PR 合併指標
 (平均合併 18小時 51分鐘) (30 天內合併 17 個 PR)

描述

Is your feature request related to a problem? Please describe. Currently, the configuration uses a list of service names to specify which services needs to be notified when a configmap change. This approach requires manual updates whenever services are added, removed, or renamed, leading to potential maintenance overhead and errors.

Describe the solution you'd like Modify the configuration to use label selectors instead of a list of service names. This can be done by specifying the desired labels in a selector field. For example:

apiVersion: v1
kind: ConfigMap
metadata:
  name: feature-config
  namespace: your-namespace
  annotations:
    spring.cloud.kubernetes.configmap.label.selector: |
      { labelA: "a", labelB: "b" }
data:
  ....

Using label selectors instead of explicitly listing service names can make it more flexible and scalable. This approach allow to dynamically select services based on their labels, which can be particularly useful in environments where services are frequently added, removed, or changed.

貢獻者指南