Skip to content

vpa_recommender_vpa_objects_count metric not initialized properly #8749

@cmtly

Description

@cmtly

Which component are you using?:
vertical-pod-autoscaler

What version of the component are you using?:

Component version: 1.5.1

What k8s version are you using (kubectl version)?:

kubectl version Output
$ kubectl version
Client Version: v1.32.7
Kustomize Version: v5.5.0
Server Version: v1.29.3

What environment is this in?: local dev with kind and cloud

What did you expect to happen?:
The vpa_recommender_vpa_objects_count metric does not properly initialize the InPlaceOrRecreate update mode. The metric correctly incremented when VPAs of this type were added. When they were removed, however, the metric did not decrement.

What happened instead?: Counter did not reflect the removal of the VPA resources.

How to reproduce it (as minimally and precisely as possible):

  1. Add VPAs with update mode of InPlaceOrRecreate
  2. Observe metric vpa_recommender_vpa_objects_count{update_mode="InPlaceOrRecreate"}
  3. Remove VPAs with update mode of InPlaceOrRecreate
  4. Observe the metric did not reflect removal of VPA resources

Anything else we need to know?:
Simple oversight in the code that was due to the InPlaceOrRecreate update mode being added after the other update modes.

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