|
24 | 24 | - [Example without idmap mounts](#example-without-idmap-mounts) |
25 | 25 | - [Example with idmap mounts](#example-with-idmap-mounts) |
26 | 26 | - [Regarding the previous implementation for volumes](#regarding-the-previous-implementation-for-volumes) |
| 27 | + - [Pod Security Standards (PSS) integration](#pod-security-standards-pss-integration) |
27 | 28 | - [Unresolved](#unresolved) |
28 | 29 | - [Test Plan](#test-plan) |
29 | 30 | - [Prerequisite testing updates](#prerequisite-testing-updates) |
@@ -141,7 +142,6 @@ Here we use UIDs, but the same applies for GIDs. |
141 | 142 | - Implement all the very nice use cases that user namespaces allows. The goal |
142 | 143 | here is to allow them as incremental improvements, not implement all the |
143 | 144 | possible ideas related with user namespaces. |
144 | | -- Support stateful pods |
145 | 145 |
|
146 | 146 | [kubelet-userns]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2033-kubelet-in-userns-aka-rootless |
147 | 147 |
|
@@ -329,7 +329,7 @@ way, the Kubelet can read all the allocated mappings if it restarts. |
329 | 329 | During alpha, to make sure we don't exhaust the host UID namespace, we will |
330 | 330 | limit the number of pods using user namespaces to `min(maxPods, 1024)`. This |
331 | 331 | leaves us plenty of host UID space free and this limits is probably never hit in |
332 | | -practice. See UNRESOLVED for more some UNRESOLVED info we still have on this. |
| 332 | +practice. See the [Unresolved section](#unresolved) for more details on this. |
333 | 333 |
|
334 | 334 | ### Handling of stateless volumes |
335 | 335 |
|
@@ -422,6 +422,44 @@ components that implement the interface. |
422 | 422 |
|
423 | 423 | [kubeletVolumeHost-interface]: https://github.com/kubernetes/kubernetes/blob/36450ee422d57d53a3edaf960f86b356578fe996/pkg/volume/plugins.go#L322 |
424 | 424 |
|
| 425 | +### Pod Security Standards (PSS) integration |
| 426 | + |
| 427 | +[Pod Security Standards](https://k8s.io/docs/concepts/security/pod-security-standards) |
| 428 | +define three different policies to broadly cover the whole security spectrum of |
| 429 | +Kubernetes, while the User Namespaces feature should integrate into them. This |
| 430 | +will happen only if the feature is graduated to GA, which _may_ result in |
| 431 | +changing the `Restricted` profile to disallow host user namespaces for stateless |
| 432 | +Pods. |
| 433 | + |
| 434 | +The Pod Security will relax in a controlled way for pods which enable user |
| 435 | +namespaces. This behavior can be controlled by an API Server Feature Gate, which |
| 436 | +allows an early opt-in for end users. The overall burden to ensure that all |
| 437 | +nodes will honor user namespaces is on the cluster admin, though. The relaxation |
| 438 | +in detail means, that if user namespaces are enabled, then the following fields |
| 439 | +won't be restricted any more because they always have to refer to the user |
| 440 | +inside the container: |
| 441 | + |
| 442 | +- `spec.securityContext.runAsNonRoot` |
| 443 | +- `spec.containers[*].securityContext.runAsNonRoot` |
| 444 | +- `spec.initContainers[*].securityContext.runAsNonRoot` |
| 445 | +- `spec.ephemeralContainers[*].securityContext.runAsNonRoot` |
| 446 | +- `spec.securityContext.runAsUser` |
| 447 | +- `spec.containers[*].securityContext.runAsUser` |
| 448 | +- `spec.initContainers[*].securityContext.runAsUser` |
| 449 | +- `spec.ephemeralContainers[*].securityContext.runAsUser` |
| 450 | +- `spec.containers[*].securityContext.allowPrivilegeEscalation` |
| 451 | +- `spec.initContainers[*].securityContext.allowPrivilegeEscalation` |
| 452 | +- `spec.ephemeralContainers[*].securityContext.allowPrivilegeEscalation` |
| 453 | +- `spec.containers[*].securityContext.capabilities.drop` |
| 454 | +- `spec.initContainers[*].securityContext.capabilities.drop` |
| 455 | +- `spec.ephemeralContainers[*].securityContext.capabilities.drop` |
| 456 | +- `spec.containers[*].securityContext.capabilities.add` |
| 457 | +- `spec.initContainers[*].securityContext.capabilities.add` |
| 458 | +- `spec.ephemeralContainers[*].securityContext.capabilities.add` |
| 459 | + |
| 460 | +A serial test will be added to validate the functionality with the enabled |
| 461 | +feature gate. |
| 462 | + |
425 | 463 | ### Unresolved |
426 | 464 |
|
427 | 465 | Here is a list of considerations raised in PRs discussion that hasn't yet |
@@ -547,20 +585,27 @@ use container runtime versions that have the needed changes. |
547 | 585 | ### Graduation Criteria |
548 | 586 |
|
549 | 587 | ##### Alpha |
| 588 | + |
550 | 589 | - Support with idmap mounts |
| 590 | +- Gather and address feedback from the community |
| 591 | +- Add API Server feature flag to integrate into [Pod Security Standards (PSS)](#pod-security-standards-pss-integration) |
| 592 | +- Changing restrictions on the what volumes will be allowed |
551 | 593 |
|
552 | 594 | ##### Beta |
553 | 595 |
|
554 | 596 | - Make plans on whether, when, and how to enable by default |
| 597 | + |
| 598 | +###### Open Questions |
| 599 | + |
555 | 600 | - Should we reconsider making the mappings smaller by default? |
556 | 601 | - Should we allow any way for users to for "more" IDs mapped? If yes, how many more and how? |
557 | 602 | - Should we allow the user to ask for specific mappings? |
558 | 603 | - Get review from VM container runtimes maintainers |
559 | | -- Gather and address feedback from the community |
560 | 604 |
|
561 | 605 | ##### GA |
562 | 606 |
|
563 | 607 | - Gather and address feedback from the community |
| 608 | +- Fully integrate into [Pod Security Standards (PSS)](#pod-security-standards-pss-integration) |
564 | 609 |
|
565 | 610 | ### Upgrade / Downgrade Strategy |
566 | 611 |
|
|
0 commit comments