-
Notifications
You must be signed in to change notification settings - Fork 5
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
Change data_home default to avoid Flexvolume plugin conflict in GKE #32
base: master
Are you sure you want to change the base?
Conversation
The current "/home/kubernetes/flexvolume/agent-k8s" default is a directory that the GKE distribution of Kubernetes uses as its Flexvolume plugin directory. https://github.com/kubernetes/community/blob/master/contributors/devel/sig-storage/flexvolume.md
Hi @twilfong, thank you for pointing this out. We wasn't aware that using flexvolume was causing issues in kubelet services. The problem with GKE's hostPath is that it's currently the only directory with the executable permissions required for tofu/terraform to execute its plugins. Other directories on the root node disk like
A more robust solution for GKE is to use external per-node data stores like https://cloud.google.com/kubernetes-engine/docs/concepts/local-ssd. The Using flexvolume is more of a workaround than a permanent solution, and moving away from hostPath usage is definitely a long-term goal. |
I am having an issue related to this as well, I'm running it on EKS, but I've tried a few different paths without success. Also I agree with @mermoldy that this should not be a long term solution. |
I have tested this on our GKE clusters, by changing the value of agent.data_home to "/home/scalr/agent-k8s" in our helm chart installation, and did run into this error. As you suggest, this is a volume that is mounted with |
Unlike "/home", the "/home/kubernetes/bin" directory should not be mounted with noexec, so this should work. This is tested with GKE, but not with other K8s providers.
@gabrielrinaldi: We've decided to use "/home/kubernetes/bin/scalr/agent-k8s" (as in my recent commit to the PR). In GKE this is mounted on a volume without the
|
It occurs during the execution of the run, not just at the start of the services. The behavior may also vary depending on the root node image. Indeed, There are also other things we planned to do regarding the You can close this PR for now, or convert it to a GitHub issue and I can post the status later, if you want to track the progress. I assume you're able to change |
We are able to change the "agent.data_home" value without it being a problem for us, but I think the larger community using this helm chart ought to be aware of the issue that the default value causes for the kubelet. At a minimum this causes a large increase in log volume (and thus increased cost). I'll switch this to an issue instead of a PR since it is apparently not a trivial change to make. See: #33 |
The Scalr agent K8s Helm chart creates a DaemonSet in the worker template that makes use of a hostPath directory. Unfortunately, the default value for this is "/home/kubernetes/flexvolume/agent-k8s", which is a directory that the GKE distribution of Kubernetes uses as its Flexvolume plugin directory.
GKE changes the default Flexvolume plugin directory from /var/lib/kubelet/volumeplugins to /home/kubernetes/flexvolume, in its Kubelet configuration. (Flexvolume is deprecated but still supported.) If this directory exists, Kubelet automatically scans it for new custom volume driver plugins, which causes (non-critical) errors to be constantly logged by the kubelet on every node in the cluster where this chart is installed.
This directory should be changed to something that no service running on the host should expect to be used for any other purpose. This is a simple one line change to do this, but a longer-term fix might be to move away from using a hostPath directly.