Skip to content

use anonymous volume for /var/lib/kubelet #773

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

Merged
merged 1 commit into from
Aug 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cluster/nodes/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func createNode(name, image, clusterLabel, role string, mounts []cri.Mount, port
"--tmpfs", "/run", // systemd wants a writable /run
// some k8s things want /lib/modules
"-v", "/lib/modules:/lib/modules:ro",
// ensure pods etc. are not on container filesystem
// TODO: we could do this in the image instead
// However this would leave old images with this issue
"-v", "/var/lib/kubelet",
Copy link
Member

@neolit123 neolit123 Aug 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, this would expose the kind nodes to the host /var/lib/kubelet that may already contain kubelet data, which may result in:

  • the kubelet on the node re-using the existing kubelet certificates
  • the kubelet on the node stomping kubelet data on the host

EDIT: 771

Copy link
Member Author

@BenTheElder BenTheElder Aug 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, this would expose the kind nodes to the host /var/lib/kubelet that may already contain kubelet data, which may result in: ...

no, that's not what this does. this is an anonymous volume, not a bind mount.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mistake.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this flag format does a lot of in-band signaling 😅
soon moving this to higher level logic... going to need to re-work that a bit now 🙃

"--hostname", name, // make hostname match container name
"--name", name, // ... and set the container name
// label the node with the cluster ID
Expand Down