You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vlagent: replace the default tmpDataPath hostPath volume with emptyDir #2544
In vlagent, when k8sCollector.enabled: true is set, the operator backs -tmpDataPath with a hostPath volume at the fixed node path /var/lib/vlagent-data by default. This can cause the following issues:
Kubelet’s fsGroup ownership management does not apply to hostPath volumes. The directory is created on the node with 0755 root:root permissions and ownership, which can cause permission issues when runAsNonRoot: true is configured or on platforms such as OpenShift, where SCC admission can assign the container UID and fsGroup from the namespace’s permitted ranges, leaving the process unable to write to the root-owned host directory.
Since the path is fixed rather than unique to each CR, two VLAgent CRs with k8sCollector enabled and scheduled on the same node may write to the same directory.
Deleting the VLAgent still leaves its data on the node.
For comparison, VMAgent does not have these issues. By default, its persistent queue uses an emptyDir volume mounted at /tmp/vmagent-remotewrite-data.
To reproduce
Create a VLAgent with a non-root security context:
Since the path is fixed rather than unique to each CR, two VLAgent CRs with k8sCollector enabled and scheduled on the same node may write to the same directory.
what is a use case for two VLAgent with k8sCollector enabled on the same node?
Kubelet’s fsGroup ownership management does not apply to hostPath volumes. The directory is created on the node with 0755 root:root permissions and ownership, which can cause permission issues when runAsNonRoot: true is configured or on platforms such as OpenShift, where SCC admission can assign the container UID and fsGroup from the namespace’s permitted ranges, leaving the process unable to write to the root-owned host directory.
would rather add init container that configures directories permissions instead of using emptyDir, which may lead to data loss
Would rather add an init container that configures directory permissions instead of using emptyDir, which may lead to data loss.
I think an init container would be only a workaround and an unnecessary detour in this case. Users could instead set tmpDataPath to an actual /tmp path or mount a volume. As I understand it, this approach would also not work easily on OpenShift because the init container would still lack the permissions.
I think data loss during restarts is expected for the default temporary data path(the name already indicates that the data is temporary:)).
VMAgent also loses this data by default unless users explicitly configure persistent storage, so this behavior seems acceptable.
What is a use case for two VLAgent instances with k8sCollector enabled on the same node?
I just wanted to list the potential issues I see with the current default temporary data path.
The main question is, is there a specific reason why VLAgent uses the fixed node path /var/lib/vlagent-data by default, unlike VMAgent?
Activity
AndrewChubatiuk commentedon Aug 26, 2026
what is a use case for two VLAgent with k8sCollector enabled on the same node?
would rather add init container that configures directories permissions instead of using emptyDir, which may lead to data loss
Haleygo commentedon Aug 26, 2026
@AndrewChubatiuk
I think an init container would be only a workaround and an unnecessary detour in this case. Users could instead set
tmpDataPathto an actual/tmppath or mount a volume. As I understand it, this approach would also not work easily on OpenShift because the init container would still lack the permissions.I think data loss during restarts is expected for the default temporary data path(the name already indicates that the data is temporary:)).
VMAgent also loses this data by default unless users explicitly configure persistent storage, so this behavior seems acceptable.
I just wanted to list the potential issues I see with the current default temporary data path.
The main question is, is there a specific reason why VLAgent uses the fixed node path
/var/lib/vlagent-databy default, unlike VMAgent?