Skip to content

Conversation

@Caesarsage
Copy link
Contributor

This PR implements the feature request from issue #51423 to create a dedicated Advanced Pod Configuration page and restructure the main Pod documentation for better user experience.

Changes:
Creates /docs/concepts/workloads/pods/advanced-pod-config/ with comprehensive coverage of:

  • Priority Classes
  • Runtime Classes
  • Advanced Security Context
  • Node Selection strategies
  • Pod Overhead

Simplifies main Pod page to focus on basic concepts
Adds cross-references between basic and advanced topics
Positions advanced page last in navigation (weight: 180)

Related Issues:

Addresses #51423: "Pod Restructuring: Create Advanced Pod Configuration page"
Supports broader Pod documentation restructuring effort (#38867)

Closes: #51423

… Configuration

Updated the Pods documentation to provide clearer examples of basic and advanced security context configurations. Added a new page for Advanced Pod Configuration covering priority classes, runtime classes, and node selection strategies, along with detailed YAML examples for each topic. This improves the clarity and usability of security settings in Kubernetes Pods.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language labels Jul 5, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 5, 2025
@Caesarsage
Copy link
Contributor Author

Hello @lmktfy

Kindly check this out on the pod restructuring issue

@netlify
Copy link

netlify bot commented Jul 5, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 0a3ab87
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/68d092890d12130008f310f6
😎 Deploy Preview https://deploy-preview-51519--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 project configuration.

Copy link
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

@Caesarsage thank you for working on this.

What you've done is a great first step, but it's not aligned enoug to our style guide for me to accept it as is.

Now, I've added a lot of suggestions. You don't have to accept any of them, but we do need the page we merge to mostly align with the style guide. All new pages should follow that style guide reasonably closely.

Would you be willing to revise this based on feedback?

{{< /caution >}}
granular control over what a Pod or individual containers can do.

For basic security configuration, you can set simple security contexts:
Copy link
Member

Choose a reason for hiding this comment

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

I would specifically recommend meeting the Baseline Pod security standard + running as non-root.

command: ["sh", "-c", "sleep 1h"]
```
For advanced security context configuration including capabilities, seccomp profiles, and detailed security options, see [Advanced Pod Configuration](/docs/concepts/workloads/pods/advanced-pod-config/#advanced-security-context-configuration).
Copy link
Member

Choose a reason for hiding this comment

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

Let's link to the security concepts section instead.

object definition describes the object in detail.
* [The Distributed System Toolkit: Patterns for Composite Containers](/blog/2015/06/the-distributed-system-toolkit-patterns/) explains common layouts for Pods with more than one container.
* Read about [Pod topology spread constraints](/docs/concepts/scheduling-eviction/topology-spread-constraints/)
* Explore [Advanced Pod Configuration](/docs/concepts/workloads/pods/advanced-pod-config/) for priority classes, runtime classes, and detailed node selection strategies.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Explore [Advanced Pod Configuration](/docs/concepts/workloads/pods/advanced-pod-config/) for priority classes, runtime classes, and detailed node selection strategies.
* Read [Advanced Pod Configuration](/docs/concepts/workloads/pods/advanced-pod-config/) to learn the topic in detail.
That page covers aspects of Pod configuration beyond the essentials, including:
* PriorityClasses
* RuntimeClasses
* advanced ways to configure _scheduling_: the way that Kubernetes decides which node a Pod should run on.

* Learn about the [lifecycle of a Pod](/docs/concepts/workloads/pods/pod-lifecycle/).
* Learn about [RuntimeClass](/docs/concepts/containers/runtime-class/) and how you can use it to
configure different Pods with different container runtime configurations.
* Read about [PodDisruptionBudget](/docs/concepts/workloads/pods/disruptions/)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should mention this later in the list than the first mention of PriorityClass.


<!-- body -->

## Priority Classes
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## Priority Classes
## PriorityClasses


Kubernetes provides several mechanisms to control which nodes your Pods are scheduled on.

### Node Selectors
Copy link
Member

Choose a reason for hiding this comment

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

nit: should be sentence case

image: nginx
```

For more information, see [Runtime Class](/docs/concepts/containers/runtime-class/).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For more information, see [Runtime Class](/docs/concepts/containers/runtime-class/).
For more information, see the [RuntimeClass](/docs/concepts/containers/runtime-class/) documentation.


<!-- overview -->

This page covers advanced Pod configuration topics including priority classes, runtime classes, detailed security context configuration, and node selection strategies.
Copy link
Member

Choose a reason for hiding this comment

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

If you make the other changes I suggest, then this would work well:

This page covers advanced Pod configuration topics including [PriorityClasses]{#priorityclasses}, [RuntimeClasses]{#runtimeclasses},
[security context](#security-context) within Pods, and introduces aspects of [scheduling](/docs/concepts/scheduling-eviction/#scheduling).


## Priority Classes

Priority classes allow you to set the importance of Pods relative to other Pods. When a Pod cannot be scheduled, the scheduler tries to preempt (evict) lower priority Pods to make scheduling of the higher priority Pod possible.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Priority classes allow you to set the importance of Pods relative to other Pods. When a Pod cannot be scheduled, the scheduler tries to preempt (evict) lower priority Pods to make scheduling of the higher priority Pod possible.
_PriorityClasses_ allow you to set the importance of Pods relative to other Pods.
If you assign a priority class to a Pod, Kubernetes sets the `.spec.priority` field for that Pod
based on the PriorityClass you specified (you cannot set `.spec.priority` directly).
If or when a Pod cannot be scheduled, and the problem is due to a lack of resources, the {{< glossary_tooltip term_id="kube-scheduler" text="kube-scheduler" >}}
tries to {{< glossary_tooltip text="preempt" term_id="preemption" >}} lower priority
Pods, in order to make scheduling of the higher priority Pod possible.

@Caesarsage
Copy link
Contributor Author

@Caesarsage thank you for working on this.

What you've done is a great first step, but it's not aligned enoug to our style guide for me to accept it as is.

Now, I've added a lot of suggestions. You don't have to accept any of them, but we do need the page we merge to mostly align with the style guide. All new pages should follow that style guide reasonably closely.

Would you be willing to revise this based on feedback?

Thanks for the feedback. Yeah, i will revise base on the feedback and also take another look at the style guide @lmktfy

…ng clarity on priority classes, runtime classes, and security contexts.
@Caesarsage
Copy link
Contributor Author

@lmktfy Thank you for your thorough reviews and detailed feedback. I have refined the pages based on your suggestions and aligned them with the Kubernetes style guide.

@Caesarsage Caesarsage requested a review from lmktfy September 6, 2025 23:16
Copy link
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

/lgtm

I have a few suggestions, but they are not so important that we need to wait for them to get fixed.

* Read about [Pod Priority and Preemption](/docs/concepts/scheduling-eviction/pod-priority-preemption/)
* Read about [RuntimeClasses](/docs/concepts/containers/runtime-class/)
* Explore [Configure a Security Context for a Pod or Container](/docs/tasks/configure-pod-container/security-context/)
* [Assign Pods to Nodes](/docs/concepts/scheduling-eviction/assign-pod-node/)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* [Assign Pods to Nodes](/docs/concepts/scheduling-eviction/assign-pod-node/)
* Learn how Kubernetes [assigns Pods to Nodes](/docs/concepts/scheduling-eviction/assign-pod-node/)

command: ["sh", "-c", "sleep 1h"]
{{< /highlight >}}

### Example Pod {#container-level-security-context}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### Example Pod {#container-level-security-context}
### Container-level security context {#container-level-security-context}
You can specify the security context just for a specific container.
Here's an example:
#### Example Pod {#container-level-security-context-example}


The `Security context` field in the Pod specification provides granular control over security settings for Pods and containers.

### Example Pod {#pod-level-security-context}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### Example Pod {#pod-level-security-context}
### Pod-wide `securityContext` {#pod-level-security-context}
Some aspects of security apply to the whole Pod; for other aspects,
you might want to set a default, without any container-level overrides.
Here's an example of using `securityContext` at the Pod level:
#### Example Pod {#pod-level-security-context-example}

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

LGTM label has been added.

Git tree hash: 26693177d96a623b7f35abcccaa36e3946c12ed7

@lmktfy
Copy link
Member

lmktfy commented Sep 7, 2025

/assign tengqm

per #51519 (comment)

security context of the Pod spec. For details and instructions, see
[Create a Windows HostProcess Pod](/docs/tasks/configure-pod-container/create-hostprocess-pod/).
{{< /caution >}}
granular control over what a Pod or individual containers can do.
Copy link
Member

Choose a reason for hiding this comment

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

Since the PR removes the general overview of what general control can be done. Perhaps it's good to link to the new "advanced-pod-config" page. Something like the below suggestion

Suggested change
granular control over what a Pod or individual containers can do.
granular control over what a Pod or individual containers can do. See [Advanced Pod Configuration](/docs/concepts/workloads/pods/advanced-pod-config/) for more details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is a Good suggestion @reylejano . Thanks.

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

New changes are detected. LGTM label has been removed.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from lmktfy. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@Caesarsage
Copy link
Contributor Author

@Caesarsage Caesarsage closed this Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pod Restructuring: Create Advanced Pod Configuration page

5 participants