Skip to content

Commit c932262

Browse files
authored
Merge pull request #35119 from Rishit-dagli/Rishit-dagli-api-resources-style
Add clarification about API resources to the Style Guide
2 parents 723ae44 + 989e8ac commit c932262

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

content/en/docs/contribute/style/style-guide.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ When you refer specifically to interacting with an API object, use [UpperCamelCa
4646

4747
When you are generally discussing an API object, use [sentence-style capitalization](https://docs.microsoft.com/en-us/style-guide/text-formatting/using-type/use-sentence-style-capitalization).
4848

49-
You may use the word "resource", "API", or "object" to clarify a Kubernetes resource type in a sentence.
50-
51-
Don't split an API object name into separate words. For example, use PodTemplateList, not Pod Template List.
52-
5349
The following examples focus on capitalization. For more information about formatting API object names, review the related guidance on [Code Style](#code-style-inline-code).
5450

5551
{{< table caption = "Do and Don't - Use Pascal case for API objects" >}}
@@ -187,6 +183,36 @@ Set the value of `image` to nginx:1.16. | Set the value of `image` to `nginx:1.1
187183
Set the value of the `replicas` field to 2. | Set the value of the `replicas` field to `2`.
188184
{{< /table >}}
189185

186+
## Referring to Kubernetes API resources
187+
188+
This section talks about how we reference API resources in the documentation.
189+
190+
### Clarification about "resource"
191+
192+
Kubernetes uses the word "resource" to refer to API resources, such as `pod`, `deployment`, and so on. We also use "resource" to talk about CPU and memory requests and limits. Always refer to API resources as "API resources" to avoid confusion with CPU and memory resources.
193+
194+
### When to use Kubernetes API terminologies
195+
196+
The different Kubernetes API terminologies are:
197+
198+
- Resource type: the name used in the API URL (such as `pods`, `namespaces`)
199+
- Resource: a single instance of a resource type (such as `pod`, `secret`)
200+
- Object: a resource that serves as a "record of intent". An object is a desired state for a specific part of your cluster, which the Kubernetes control plane tries to maintain.
201+
202+
Always use "resource" or "object" when referring to an API resource in docs. For example, use "a `Secret` object" over just "a `Secret`".
203+
204+
### API resource names
205+
206+
Always format API resource names using [UpperCamelCase](https://en.wikipedia.org/wiki/Camel_case), also known as PascalCase, and code formatting.
207+
208+
For inline code in an HTML document, use the `<code>` tag. In a Markdown document, use the backtick (`` ` ``).
209+
210+
Don't split an API object name into separate words. For example, use `PodTemplateList`, not Pod Template List.
211+
212+
For more information about PascalCase and code formatting, please review the related guidance on [Use upper camel case for API objects](/docs/contribute/style/style-guide/#use-upper-camel-case-for-api-objects) and [Use code style for inline code, commands, and API objects](/docs/contribute/style/style-guide/#code-style-inline-code).
213+
214+
For more information about Kubernetes API terminologies, please review the related guidance on [Kubernetes API terminology](/docs/reference/using-api/api-concepts/#standard-api-terminology).
215+
190216
## Code snippet formatting
191217

192218
### Don't include the command prompt

0 commit comments

Comments
 (0)