Skip to content

Commit ba6bf9d

Browse files
committed
user-namespaces: add idsPerPod configuration
Kubernetes v1.33 will support setting `userNamespaces.idsPerPod` in `KubeletConfiguration`. Depends on k/k PR 130028 Signed-off-by: Akihiro Suda <[email protected]>
1 parent af7cde7 commit ba6bf9d

File tree

2 files changed

+51
-3
lines changed

2 files changed

+51
-3
lines changed

content/en/docs/concepts/workloads/pods/user-namespaces.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ to the `kubelet` user:
177177
configuration.
178178

179179
* The subordinate ID count must be a multiple of 65536
180-
(for Kubernetes {{< skew currentVersion >}} the subordinate ID count for each Pod is hard-coded
181-
to 65536).
182180

183181
* The subordinate ID count must be at least `65536 x <maxPods>` where `<maxPods>`
184182
is the maximum number of pods that can run on the node.
@@ -209,6 +207,22 @@ kubelet:65536:7208960
209207
[CVE-2021-25741]: https://github.com/kubernetes/kubernetes/issues/104980
210208
[shadow-utils]: https://github.com/shadow-maint/shadow
211209

210+
## ID count for each of Pods
211+
Starting with Kubernetes v1.33, the ID count for each of Pods can be set in
212+
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/).
213+
214+
```yaml
215+
apiVersion: kubelet.config.k8s.io/v1beta1
216+
kind: KubeletConfiguration
217+
userNamespaces:
218+
idsPerPod: 1048576
219+
```
220+
221+
The value of `idsPerPod` must be a multiple of 65536.
222+
The default value is 65536.
223+
224+
In Kubernetes prior to v1.33, the ID count for each of Pods was hard-coded to 65536.
225+
212226
## Integration with Pod security admission checks
213227

214228
{{< feature-state state="alpha" for_k8s_version="v1.29" >}}

content/en/docs/reference/config-api/kubelet-config.v1beta1.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,13 @@ option is explicitly enabled.
16371637
Default: false</p>
16381638
</td>
16391639
</tr>
1640+
<tr><td><code>userNamespaces</code><br/>
1641+
<a href="#kubelet-config-k8s-io-v1beta1-UserNamespaces"><code>UserNamespaces</code></a>
1642+
</td>
1643+
<td>
1644+
<p>UserNamespaces contains config for the pod user namespaces</p>
1645+
</td>
1646+
</tr>
16401647
</tbody>
16411648
</table>
16421649

@@ -2126,4 +2133,31 @@ managers (secret, configmap) are discovering object changes.</p>
21262133
</tr>
21272134
</tbody>
21282135
</table>
2129-
2136+
2137+
## `UserNamespaces` {#kubelet-config-k8s-io-v1beta1-UserNamespaces}
2138+
2139+
2140+
**Appears in:**
2141+
2142+
- [KubeletConfiguration](#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)
2143+
2144+
2145+
<p>UserNamespaces specifies the config for user namespaces</p>
2146+
2147+
2148+
<table class="table">
2149+
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
2150+
<tbody>
2151+
2152+
2153+
<tr><td><code>idsPerPod</code><br/>
2154+
<code>uint32</code>
2155+
</td>
2156+
<td>
2157+
<p>idsPerPod is the mapping length of UIDs and GIDs.
2158+
The length must be multiple of 65536.
2159+
Default: 65536</p>
2160+
</td>
2161+
</tr>
2162+
</tbody>
2163+
</table>

0 commit comments

Comments
 (0)