-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Define 'resource' in glossary #49706
Define 'resource' in glossary #49706
Conversation
|
Welcome @gjenkins8! |
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.
One question, but otherwise this looks good to me.
/lgtm
- fundamental | ||
--- | ||
An entity in the Kubernetes type system, typically representing {{< glossary_tooltip text="objects" term_id="object" >}}. | ||
But sometime representing an operation on objects, such as a permission check. |
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.
Is there somewhere "resource" is used like this? Seems odd to me to consider a permission check as a resource.
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.
From: https://kubernetes.io/docs/reference/using-api/api-concepts/#standard-api-terminology
smaller number of API resource types are virtual in that they often represent operations on objects, rather than objects, such as a permission check
I added this for completeness. It also isn't typically what I would think of as a "resource". But I did want to try and capture the definitions from existing material.
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.
It's apparently because we use "object" specifically when referring to concrete resource types like pods (i.e. resources that "exist" in the cluster), whereas something like a CreateEviction
, while still a resource, wouldn't be an object
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.
So, a Pod is an object (it has spec, it has metadata). But the eviction subresource of a Pod is not an object. Both are (HTTP) resources - see https://datatracker.ietf.org/doc/html/rfc7231#page-7
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -0,0 +1,17 @@ | |||
--- | |||
title: Resource |
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 think that we should make this term "API resource". There's already an overlap of the term resource in the context of the API and in the context of CPU and memory resources. If we're talking about an API resource in a document, especially the first time that we use the term, we should be calling it "API resource" to eliminate that ambiguity.
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 really appreciate the work, but: we should improve it before we merge it.
/lgtm cancel
date: 2025-02-09 | ||
full_link: https://kubernetes.io/docs/reference/using-api/api-concepts/#standard-api-terminology | ||
short_description: > | ||
A Kubernetes entity, representing a RESTful endpoint on the Kubernetes API server |
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.
Kubernetes' API architecture is heavily inspired by ReST, but we can't be sure that all resources are part of ReST-like APIs. For example, Pods have various subresources that are more like RPC or streaming services (they don't have defined representations).
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.
fair, I think best to simply remove "RESTful" then.
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.
There are multiple meanings of resource. Unlike most entries, this one needs to list at least the two most common meaning of resource. If not, we should make a separate entry for "HTTP resource" - very similar to the suggestion in https://github.com/kubernetes/website/pull/49706/files#r1949684500 - and ensure the two entries reference each other.
Here are the meanings I can think of:
- Resource as in "something you might consume"; limits and requests are resource limits and resource requests
- Web resources; for HTTP, a resource is something with a URI where the scheme is
http
orhttps
. Especially, part of the Kubernetes HTTP API. Custom resources are resources in this sense. - sometimes, rarely: an API kind (eg thinking of Deployment as a resource)
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.
Thanks, yes. I was originally targeting this toward the second meaning (of course). And I agree, ensuring it is clear both (or perhaps all three) of these concepts exist. And disambiguating between them should be done.
Thinking out loud -- perhaps there could be entries for "resource" and e.g. "compute resource" terms?
It might be confusing to have the second defined as "HTTP Resource", as a lot of existing terms already refer resource directly e.g.
https://kubernetes.io/docs/reference/glossary/?extension=true#term-CustomResourceDefinition
https://kubernetes.io/docs/reference/glossary/?all=true#term-helm-chart
https://kubernetes.io/docs/reference/glossary/?all=true#term-name
Personally, when someone mentions "resource" in the context of Kubernetes, I think of the API. Typically resource would need to be mentioned in the context of e.g. a Pod or compute to think of the first definition.
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 think it will confuse people if we refer to memory as a compute resource.
…
Some people will think of the "amount of hardware" meaning and some will think of web architecture.
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.
For the moment, I'll write both of these definitions into the PR. Then can split into separate glossary terms if/as desired.
I think it will confuse people if we refer to memory as a compute resource.
To note "compute resources" is used here with respect to :
https://kubernetes.io/docs/reference/glossary/?all=true#term-limitrange
https://kubernetes.io/docs/reference/glossary/?all=true#term-resource-quota
c4e3355
to
d21c1f9
Compare
@sftim -- I've split API resource vs Compute resource. Hopefully the definitions read well. Feedback appreciated! (not sure if my definition of compute resource is the best. Its tricky to define these fundamental things from basic terminology!) |
31d1fd6
to
da32ca6
Compare
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 try not to merge changes where one part is not correct, and unfortunately the part about resources always being node-local needs to change before I'd be happy to say Yes.
I do want this to merge and I think the next iteration will be good to go.
An entity in the Kubernetes type system, corresponding to an API endpoint on the {{< glossary_tooltip text="Kubernetes API" term_id="kubernetes-api" >}}. | ||
A resource typically represents an {{< glossary_tooltip text="objects" term_id="object" >}}. | ||
But sometime represents an operation on objects, such as a permission check. | ||
<!--more--> | ||
API resources compromise the Kubernetes type system which makes up the majority of the Kubernetes API. | ||
Each resource represents an endpoint on the Kubernetes API server, defining the schema for the objects or operations on that resource. |
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.
Would be great to mention that these are resources in the HTTP sense.
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.
good point, I've added in HTTP and URI terms
tags: | ||
- fundamental | ||
--- | ||
Capability of {{< glossary_tooltip text="nodes" term_id="node" >}} available for consumption (CPU, memory, etc) by processes or users of those nodes. |
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.
Because of dynamic resource allocation these capabilities may not be node local.
For example, you can allocate an attachable GPU as a resource, even though 8 different nodes are all able to request attachment.
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.
fair: s/of/provided by/
Thanks again @sftim ! (API) Resources vs objects was an itch I've wanted to scratch for some time :). I appreciate the help / guidance for the PR, and helping me make the contribution. Two final thoughts from a final proof read on my part: |
@sftim -- final cleanups done. I think all good to merge now. Thanks! |
/lgtm If you know how to squash commits on a pull request, please do that @gjenkins8 (it's tidier). If you've never used Next step is PR approval. Because this is a change to the live site, I'll only approve it if another org member adds their |
LGTM label has been added. Git tree hash: ef13b53fcf2c84c3e0ae145a04728c78b8193ed2
|
Signed-off-by: George Jenkins <[email protected]> Co-authored-by: Shannon Kularathna <[email protected]> Co-authored-by: Tim Bannister <[email protected]>
e63e4ca
to
acb85c3
Compare
Certainly, squashed commits |
/lgtm |
LGTM label has been added. Git tree hash: 2fa068af073a06468102a7e3d4a51a85a171d3cb
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: natalisucks The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@gjenkins8, you've made a really positive improvement to our docs. Thank you. See https://kubernetes.io/docs/reference/glossary/?all=true#term-infrastructure-resource for example. |
Building on this, I opened #49852 |
Description
Add a definitions of 'API resource' and 'resource (infrastructure)' to the glossary. As the term "resource" is frequently used in the docs, the Kubernetes API itself, and in the community (but not actually defined).
Inspiration / definitions taken from:
https://kubernetes.io/docs/reference/using-api/api-concepts/#standard-api-terminology
https://stackoverflow.com/questions/52309496/difference-between-kubernetes-objects-and-resources
https://datatracker.ietf.org/doc/html/rfc7231#section-2
https://en.wikipedia.org/wiki/System_resource
Issue
Closes: #25903