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

Define 'resource' in glossary #49706

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

gjenkins8
Copy link
Contributor

@gjenkins8 gjenkins8 commented Feb 10, 2025

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

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Feb 10, 2025
Copy link

linux-foundation-easycla bot commented Feb 10, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: gjenkins8 / name: George Jenkins (acb85c3)

@k8s-ci-robot
Copy link
Contributor

Welcome @gjenkins8!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 10, 2025
@gjenkins8 gjenkins8 changed the title Define 'resource' in glossry Define 'resource' in glossary Feb 10, 2025
Copy link
Contributor

@stmcginnis stmcginnis left a 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 10, 2025
Copy link

netlify bot commented Feb 10, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit acb85c3
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67b156dc7fa81d00084d51ca
😎 Deploy Preview https://deploy-preview-49706--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -0,0 +1,17 @@
---
title: Resource
Copy link
Contributor

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.

Copy link
Contributor

@sftim sftim left a 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
Copy link
Contributor

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).

Copy link
Contributor Author

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.

Copy link
Contributor

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:

  1. Resource as in "something you might consume"; limits and requests are resource limits and resource requests
  2. Web resources; for HTTP, a resource is something with a URI where the scheme is http or https. Especially, part of the Kubernetes HTTP API. Custom resources are resources in this sense.
  3. sometimes, rarely: an API kind (eg thinking of Deployment as a resource)

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, 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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 10, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 12, 2025
@gjenkins8 gjenkins8 force-pushed the define_resource_glossary branch 4 times, most recently from c4e3355 to d21c1f9 Compare February 12, 2025 06:12
@gjenkins8
Copy link
Contributor Author

gjenkins8 commented Feb 12, 2025

@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!)

@gjenkins8 gjenkins8 force-pushed the define_resource_glossary branch 2 times, most recently from 31d1fd6 to da32ca6 Compare February 12, 2025 06:27
Copy link
Contributor

@sftim sftim left a 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.

Comment on lines 13 to 18
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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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/

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 14, 2025
@k8s-ci-robot k8s-ci-robot requested a review from sftim February 14, 2025 17:03
@gjenkins8
Copy link
Contributor Author

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:

  1. https://github.com/kubernetes/website/pull/49706/files#r1956493408
  2. https://github.com/kubernetes/website/pull/49706/files#r1956479300
    OR
    https://github.com/kubernetes/website/pull/49706/files#r1956493813

@gjenkins8
Copy link
Contributor Author

@sftim -- final cleanups done. I think all good to merge now. Thanks!

@sftim
Copy link
Contributor

sftim commented Feb 15, 2025

/lgtm

If you know how to squash commits on a pull request, please do that @gjenkins8 (it's tidier). If you've never used git rebase before, that's OK - doing that squash is optional. We can get Tide to trigger a similar but less tidy thing automatically (and I've already added the label to request this).

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 on behalf of SIG Docs. Alternatively, a different approver can approve it right away.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2025
@k8s-ci-robot
Copy link
Contributor

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]>
@gjenkins8 gjenkins8 force-pushed the define_resource_glossary branch from e63e4ca to acb85c3 Compare February 16, 2025 03:09
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 16, 2025
@k8s-ci-robot k8s-ci-robot requested a review from sftim February 16, 2025 03:09
@gjenkins8
Copy link
Contributor Author

If you know how to squash commits on a pull request, please do that @gjenkins8 (it's tidier).

Certainly, squashed commits

@sftim
Copy link
Contributor

sftim commented Feb 16, 2025

/lgtm
/remove-label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. labels Feb 16, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2fa068af073a06468102a7e3d4a51a85a171d3cb

@natalisucks
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 21, 2025
@k8s-ci-robot k8s-ci-robot merged commit 914faaa into kubernetes:main Feb 21, 2025
6 checks passed
@sftim
Copy link
Contributor

sftim commented Feb 21, 2025

@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.

@sftim
Copy link
Contributor

sftim commented Feb 21, 2025

Building on this, I opened #49852

@gjenkins8 gjenkins8 deleted the define_resource_glossary branch February 23, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "resource" to glossary
6 participants