Skip to content

Long Startup Times When Many Configmaps Exist #1681

@patrick-shinn-infor

Description

@patrick-shinn-infor

Describe the bug
After upgrading to Spring Boot 3.3.0 (spring-cloud-starter-kubernetes-fabric8-config:3.1.2) from Spring Boot 2, I noticed that our application startup times in Kubernetes increased nearly 5-fold.

My team uses Kapp to manage our CI/CD development environment, which results in a large number of configmaps being created as historical changes are tracked. Because of this, we have been experiencing extremely long startup delays while the KubernetesClientEventBasedConfigMapChangeDetector does its initial load of all configmaps in the current namespace. I have tried several configurations including verbosely passing the name of the desired configmap and applying a label selector; however, the result is that all configmaps in the namespace are always read.

I realize that our situation is an extreme case in that we have something close to 2,000 configmaps in our namespace due to how Kapp handles configmap changes, but in my mind, it does not make sense that every configmap in the namespace is loaded when I explicitly specify which configmap or which labels should be used to select the configmaps I wish to pass to the application. I have not dug deeply into why the configmaps are loaded in this way, and I am sure there is a good reason for it, but I wanted to raise awareness that in namespaces that have a large number of configmaps the current implementation results in extremely slow startup times.

Additionally, I was not able to find anything in the documentation that describes this behavior. I believe there should be some clarification as the documentation can be currently interpreted as all other configurations will not be read.

The current implementation appears to be related to 1176.

Sample
There is no sample to provide here, the long load times can be easily recreated by creating a number of configmaps in the namespace of the application.

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