Skip to content
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

Proposal for disk accounting #16889

Merged
merged 1 commit into from
Jan 22, 2016
Merged

Conversation

vishh
Copy link
Contributor

@vishh vishh commented Nov 5, 2015

@kubernetes/goog-node @bgrant0607 @thockin @smarterclayton

@vishh vishh added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Nov 5, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/XL

@k8s-github-robot k8s-github-robot added kind/design Categorizes issue or PR as related to design. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 5, 2015
@dchen1107 dchen1107 assigned dchen1107 and unassigned brendandburns Nov 6, 2015
@k8s-bot
Copy link

k8s-bot commented Nov 6, 2015

GCE e2e build/test failed for commit 1957329ee110dcc46c52ef445c7f41b5228a2ac1.

@pmorie
Copy link
Member

pmorie commented Nov 6, 2015

@kubernetes/rh-cluster-infra @kubernetes/rh-storage

@k8s-bot
Copy link

k8s-bot commented Nov 6, 2015

GCE e2e test build/test passed for commit 07d246add8b62e7b991fbb216afbaeb55d54d5aa.


3. Container’s logs - when written to stdout/stderr and default logging backend in docker is used.

4. Local volumes - hostPath and emptyDir (TODO: Do git volumes consume local disk?)
Copy link
Member

Choose a reason for hiding this comment

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

The same questions exist for secrets, downward api, etc. I'd argue that hostPath is different from the others because it's necessarily 'outside' kubernetes. Also, what if you do a host mount of another pod's volume dir? The recycler does this, for example -- how do you count hostPath correctly in that scenario?

Copy link
Member

Choose a reason for hiding this comment

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

Also, theoretically you could have an image which has a docker volume. In openshift, we generate volumes for each of docker volume, but unless I'm mistaken the possibility of containers using docker-created volumes exists in kubernetes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pmorie: What is the kubernetes equivalent representation for auto-generated volumes in openshift? I'm only concerned about volumes that consume local disk in this proposal. If there are such volumes that I have not included here, let me know and I will update the proposal.

Copy link
Member

Choose a reason for hiding this comment

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

Get rid of TODO here since GitRepo does consume local disk, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

On Mon, Nov 16, 2015 at 1:28 PM, Dawn Chen notifications@github.com wrote:

In docs/proposals/disk-accounting.md
#16889 (comment)
:

+2. Support for filesystems other than ext4.
+
+### Introduction
+
+Disk accounting in Kubernetes cluster running with docker is complex because of the plethora of ways in which disk gets utilized by a container.
+
+Disk can be consumed for,
+
+1. Container images
+
+2. Container’s writable layer
+
+3. Container’s logs - when written to stdout/stderr and default logging backend in docker is used.
+
+4. Local volumes - hostPath and emptyDir (TODO: Do git volumes consume local disk?)

Get rid of TODO here since GitRepo does consume local disk, right?


Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/16889/files#r44985742.

@pmorie
Copy link
Member

pmorie commented Nov 7, 2015

@vishh Will there be any API changes for quotas or status?

@vishh
Copy link
Contributor Author

vishh commented Nov 8, 2015

No. New metrics API is being added to kubelet. Accounting will use those
APIs.
Quota is an implementation detail. I'm hoping to reserve a set of gids for
use by the kubelets. This range should not be available for users.
Scheduling might require API changes.

On Fri, Nov 6, 2015 at 11:22 PM, Paul Morie notifications@github.com
wrote:

@vishh https://github.com/vishh Will there be any API changes for
quotas or status?


Reply to this email directly or view it on GitHub
#16889 (comment)
.


1. Compatibility with all storage backends. The matrix is pretty large already and the priority is to get disk accounting to on most widely deployed platforms.

2. Support for filesystems other than ext4.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hrm - we're starting to move customers to XFS in other domains - can you describe why you think this is a non-goal (?

Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

I think supporting xfs is important. Just now we are discovering that ext4 is having issues with thin devices specially in AWS. Preallocating metadata on large thin devices can take a long time and systemd times out and docker folks are investigating the possibility of switching to xfs by default as container rootfs.

moby/moby#17464
moby/moby#17701

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the info @smarterclayton @mrunalp and @rhvgoyal. Can someone help me scope out the changes required for xfs? The first step might be to enhance this proposal to include changes required for xfs.

Choose a reason for hiding this comment

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

Now docker PR got merged which makes xfs default container fs for devicemapper graph driver.

moby/moby#17903

So far I can't anything special required for xfs. Whatever we were doing to make sure ext4 works, we need to repeat same for xfs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the update. This change will affect the writable layer and the image layers. Since we depend on devicemapper semantics here, this change shouldn't affect this proposal.
I assume that the primary filesystem where volumes and logs will be stored will continue to be ext4? This is important because, the current plan is to use quota for those use cases. Quota configuration is slightly different between ext4 and xfs.

Choose a reason for hiding this comment

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

When you say primary file system, are you referring to filesystem on host? I think there also we need to support both ext4 and xfs. RHEL has xfs as default host filesystem. And I am assuming that users will like all this to work on RHEL too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah! ok. That's what I was looking for. So yes, we need to support xfs by default. I plan to get this rolling with ext4 support to start with. I'd appreciate some help with xfs integration once the internal implementation is finalized as part of implementing ext4 support.

@vishh
Copy link
Contributor Author

vishh commented Dec 28, 2015

@pwittrock: Can you review this proposal?

@pwittrock
Copy link
Member

@vishh yes, taking a look now


1. Account for disk usage on the nodes.

2. Compatibility with the most important docker storage backends - devicemapper, aufs and overlayfs
Copy link
Member

Choose a reason for hiding this comment

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

nit: consider important -> common

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@pwittrock pwittrock added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2016
@pwittrock
Copy link
Member

@vishh Looks good. Just a couple of minor comments.

Signed-off-by: Vishnu Kannan <vishnuk@google.com>
@vishh
Copy link
Contributor Author

vishh commented Jan 8, 2016

@pwittrock: Thanks for the review. Fixed your comments. I might need another LGTM since I updated the patch.

@k8s-github-robot
Copy link

PR changed after LGTM, removing LGTM.

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2016
@k8s-bot
Copy link

k8s-bot commented Jan 8, 2016

GCE e2e test build/test passed for commit 0b43037.

@pwittrock pwittrock added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 12, 2016
@pwittrock
Copy link
Member

@k8s-bot test this please

@k8s-bot
Copy link

k8s-bot commented Jan 20, 2016

GCE e2e test build/test passed for commit 0b43037.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jan 20, 2016

GCE e2e test build/test passed for commit 0b43037.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jan 20, 2016

GCE e2e test build/test passed for commit 0b43037.

@alex-mohr
Copy link
Contributor

@k8s-bot unit test this

@k8s-github-robot
Copy link

@k8s-bot test this

Tests are more than 48 hours old. Re-running tests.

@k8s-bot
Copy link

k8s-bot commented Jan 22, 2016

GCE e2e test build/test passed for commit 0b43037.

zmerlynn added a commit that referenced this pull request Jan 22, 2016
@zmerlynn zmerlynn merged commit a5f4f3b into kubernetes:master Jan 22, 2016

* `chown -R :9000 /var/lib/docker/**container**/b8cc9fae3851f9bcefe922952b7bca0eb33aa31e68e9203ce0639fc9d3f3c61b/*`

##### Testing titbits

Choose a reason for hiding this comment

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

s/titbits/tidbits

xingzhou pushed a commit to xingzhou/kubernetes that referenced this pull request Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/design Categorizes issue or PR as related to design. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet