Skip to content

Feature/vcluster #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Feature/vcluster #421

wants to merge 2 commits into from

Conversation

mysiki
Copy link

@mysiki mysiki commented Mar 28, 2025

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 :

Physical cluster Namespace Physical cluster pod name Virtual cluster Namespace Virtual cluster pod name
vcluster-foo myappfront-1234-x-myappns-x-vclusterfooname myappns myappfront-1234
vcluster-foo myappback-123-x-myappns-x-vclusterfooname myappns myappback-123
vcluster-foo otherapp-1234-x-otherappns-x-vclusterfooname otherappns otherapp-1234
vcluster-foo otherapp-4567-x-otherappns-x-vclusterfooname otherappns otherapp-4567
vcluster-foo otherappwithreallylongnammmmme-1234567891234567891234-x-othera-f5fef5e6fe otherappns otherappwithreallylongnammmmme-1234567891234567891234

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).

@CLAassistant
Copy link

CLAassistant commented Mar 28, 2025

CLA assistant check
All committers have signed the CLA.

Use f-strings, rename variables, add doc strings
@mysiki mysiki force-pushed the feature/vcluster branch from b281597 to 8f5cbeb Compare March 28, 2025 15:51
@mysiki
Copy link
Author

mysiki commented May 21, 2025

some news ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants