Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support of VCluster (https://www.vcluster.com/) (resolve my issue : #415)
VCluster (VC) work on top of physical cluster with workload sync between virtual cluster and physical cluster. During the sync, VC rename the pod to avoid naming collision. VC only sync the pod, not the other stuff like RS, Deployment, ... The sync is done on the physical namespace where vcluster is present.
Summarize design :
The renaming is done following algo present in added function get_vcluster_pod_real_name.
To reduce pod number and cluster load, usually metrics are read read from physical cluster (avoid to have all exporter pod inside VC).
Because of VC only sync pod, KRR need to run connected to the VC (to detect DP, STS,..). But the pod name and pod namespace in prometheus are the one present in physical cluster.
This PR add 2 new arguments that are mandatory to calculate the pod name and pod namespace for prom query and function to use it.
I also add debug logger on prom query (can be remove if you think is useless :) )
Readme is update
Test done with success on my VC (with VC args) and without (like before this change).