Add vsock support for serving metrics to hypervisors#649
Closed
machadovilaca wants to merge 1 commit into
Closed
Conversation
Signed-off-by: machadovilaca <machadovilaca@gmail.com>
Author
Collaborator
|
Can you rebases this on the latest in main |
nccurry
reviewed
Apr 7, 2026
| } | ||
|
|
||
| if c.Uint(CLIVSOCKPort) > math.MaxUint32 { | ||
| return nil, fmt.Errorf("vsock port must be in range 1-65535") |
Collaborator
There was a problem hiding this comment.
Is this the right error message for Uint32?
Maybe something like return nil, fmt.Errorf("vsock port must fit in 32 bits")
Collaborator
|
Can you look in to using a socat sidecar, or one of the other methods for proxying to vock, for this? containers:
- name: dcgm-exporter
image: nvcr.io/nvidia/k8s/dcgm-exporter:...
ports:
- containerPort: 9400
- name: vsock-proxy
image: alpine/socat
command: ["socat", "VSOCK-LISTEN:9400,reuseaddr,fork", "TCP:localhost:9400"]DCGM Exporter is really intended to channel DCGM input into Prometheus output. Adding an entire VSOCK endpoint is not an insignificant change to the API for something that could be done externally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 an optional AF_VSOCK listener that serves the same metrics endpoint over virtio-vsock, enabling guest to host metrics collection without network dependencies.
In GPU passthrough and vGPU use cases on KubeVirt (and other hypervisors), the guest VM is often not configured with a network path to the host, but needs GPU telemetry from dcgm-exporter running inside the guest.