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
Make kubelet work directory overridable via single chart parameter #410
Conversation
@rkrzewski |
#407 is indeed simpler in terms of implementation, but more complicated in usage. Helm offers path manipulation functions so generating correct mounts etc for a modified Before I delve into it I'd like to understand the requirements better
I thought it would be more natural to set Okay, after following through the paths and mounts carefully and writing the above I have a plan for improvement. I'll add a couple more commits to PR for your consideration. |
9aacaf5
to
673b2cb
Compare
@rkrzewski |
I am glad to hear that! Yes I will look into updating the e2e tests. I'll also look through the templates to check if the |
hostPath: | ||
path: /dev | ||
type: Directory | ||
lvmdSocket: /run/topolvm/daemonset_lvmd/lvmd.sock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We set /tmp/topolvm/daemonset_lvmd/lvmd.sock
to lvmd.socketName
, so node.lvmdSocket
is also needed to set as well, IMO.
Thanks for the review @daichimukai. I have applied the requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd passed tests locally with the following values. Would you change values accordingly?
diff --git a/e2e/manifests/values/daemonset-scheduler.yaml b/e2e/manifests/values/daemonset-scheduler.yaml
index 5fa3da84..2267486f 100644
--- a/e2e/manifests/values/daemonset-scheduler.yaml
+++ b/e2e/manifests/values/daemonset-scheduler.yaml
@@ -23,31 +23,7 @@ lvmd:
managed: false
node:
- volumes:
- - name: registration-dir
- hostPath:
- path: /var/lib/kubelet/plugins_registry/
- type: Directory
- - name: node-plugin-dir
- hostPath:
- path: /var/lib/kubelet/plugins/topolvm.cybozu.com/node
- type: DirectoryOrCreate
- - name: csi-plugin-dir
- hostPath:
- path: /var/lib/kubelet/plugins/kubernetes.io/csi
- type: DirectoryOrCreate
- - name: pod-volumes-dir
- hostPath:
- path: /var/lib/kubelet/pods/
- type: DirectoryOrCreate
- - name: lvmd-socket-dir
- hostPath:
- path: /tmp/topolvm
- type: Directory
- - name: device-dir
- hostPath:
- path: /dev
- type: Directory
+ lvmdSocket: /tmp/topolvm/lvmd.sock
storageClasses:
- name: topolvm-provisioner
@rkrzewski |
I've submitted the requested changes. Holding fingers crossed for the CI! Would you like me to squash the changes before merging? There is some back-and-forth in those commits that won't provide much value from historical perspective. There's one more thing that struck me while working with the CI manifests: there's a discrepancy between parameter names: |
Ok. I'll notify you to ready to squash.
Agreed. BTW, I think this PR already breaks backward compatibility because this changes lvmdSocket value, so if someone tweaks volumeMounts, topolvm-nodes may not work properly. Therefore, I intend to release this feature as major update, I think the renaming can be done in this PR too. @daichimukai Do you have any concerns about it? |
I thought about it for a while, but I think it would be better to separate the PRs to make the intent clearer. |
@rkrzewski |
Now the changes (with deletion of trailing white space) look good to me. I'll approve PR when a squashed commit is pushed. I have no objection on changing |
/var/lib/kubelet directory appears multiple times in node component configuration. node.kubeletWorkDirectory parameter allows overriding them all in concert, which is useful for deplyment on microk8s where /var/snap/microk8s/common/var/lib/kubelet directory needs to be used instead. volumes, volumeMounts and allowedHostPaths for node and lvmd components are now generated according to lvmd.socketName, node.lvmdSocket and node.kubeletWorkDirectory values but in case fine-tunning is needed they can still be overriden using lvmd.volumes, lvmd.volumeMounts, lvmd.psp.allowedHostPaths, node.volumes, node.volumeMounts.topolvmNode, node.psp.allowedHostPaths values like before.
a699aa9
to
738c6fd
Compare
I've squashed the changes to a single commit and amended the commit message. If you have any further suggestions, please let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. You did a great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @rkrzewski
Thank you, I really enjoyed working on this :) I'll post the PR for renaming |
/var/lib/kubelet directory appears multiple times in node component
configuration. node.kubeletWorkDirectory parameter allows overriding
them all in concert, which is useful for deplyment on microk8s where
/var/snap/microk8s/common/var/lib/kubelet directory needs to be used
instead.
This is an alternative to #407. Either one can be used to solve the problem of deployment on microk8s cluster described in #406. This PR is larger but provides more streamlined user experience: only 1 string property to override instead of 4, 3 of which require structured values.