Skip to content

Commit eb88ef7

Browse files
marossettengqmTim Bannisterdivya-mohan0209
authored
Updating Windows intro and resource management pages (#34083)
* Updating some Windows docs pages including: - Fixinig heading levels for /docs/concepts/windows/intro.md - Misc updates to /docs/concepts/windows/intro.ms - Updates to /docs/concepts/configuration/windows-resource-management.md for accuracy Signed-off-by: Mark Rossetti <marosset@microsoft.com> * Apply suggestions from code review Co-authored-by: Qiming Teng <tengqm@outlook.com> Co-authored-by: Tim Bannister <tim@scalefactory.com> Co-authored-by: divya-mohan0209 <divya.mohan0209@gmail.com> Co-authored-by: Qiming Teng <tengqm@outlook.com> Co-authored-by: Tim Bannister <tim@scalefactory.com> Co-authored-by: divya-mohan0209 <divya.mohan0209@gmail.com>
1 parent bfdfd60 commit eb88ef7

2 files changed

Lines changed: 56 additions & 57 deletions

File tree

content/en/docs/concepts/configuration/windows-resource-management.md

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,52 +32,48 @@ host, and thus privileged containers are not available on Windows.
3232
Containers cannot assume an identity from the host because the Security Account Manager
3333
(SAM) is separate.
3434

35-
## Memory reservations {#resource-management-memory}
35+
## Memory management {#resource-management-memory}
3636

3737
Windows does not have an out-of-memory process killer as Linux does. Windows always
3838
treats all user-mode memory allocations as virtual, and pagefiles are mandatory.
3939

40-
Windows nodes do not overcommit memory for processes running in containers. The
40+
Windows nodes do not overcommit memory for processes. The
4141
net effect is that Windows won't reach out of memory conditions the same way Linux
4242
does, and processes page to disk instead of being subject to out of memory (OOM)
4343
termination. If memory is over-provisioned and all physical memory is exhausted,
4444
then paging can slow down performance.
4545

46-
You can place bounds on memory use for workloads using the kubelet
47-
parameters `--kubelet-reserve` and/or `--system-reserve`; these account
48-
for memory usage on the node (outside of containers), and reduce
49-
[NodeAllocatable](/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable).
50-
As you deploy workloads, set resource limits on containers. This also subtracts from
51-
`NodeAllocatable` and prevents the scheduler from adding more pods once a node is full.
52-
53-
{{< note >}}
54-
When you set memory resource limits for Windows containers, you should either set a
55-
limit and leave the memory request unspecified, or set the request equal to the limit.
56-
{{< /note >}}
57-
58-
On Windows, good practice to avoid over-provisioning is to configure the kubelet
59-
with a system reserved memory of at least 2GiB to account for Windows, Kubernetes
60-
and container runtime overheads.
61-
62-
## CPU reservations {#resource-management-cpu}
63-
64-
To account for CPU use by the operating system, the container runtime, and by
65-
Kubernetes host processes such as the kubelet, you can (and should) reserve a
66-
percentage of total CPU. You should determine this CPU reservation taking account of
67-
to the number of CPU cores available on the node. To decide on the CPU percentage to
68-
reserve, identify the maximum pod density for each node and monitor the CPU usage of
69-
the system services running there, then choose a value that meets your workload needs.
46+
## CPU management {#resource-management-cpu}
7047

71-
You can place bounds on CPU usage for workloads using the
72-
kubelet parameters `--kubelet-reserve` and/or `--system-reserve` to
73-
account for CPU usage on the node (outside of containers).
74-
This reduces `NodeAllocatable`.
75-
The cluster-wide scheduler then takes this reservation into account when determining
76-
pod placement.
48+
Windows can limit the amount of CPU time allocated for different processes but cannot
49+
guarantee a minimum amount of CPU time.
7750

78-
On Windows, the kubelet supports a command-line flag to set the priority of the
51+
On Windows, the kubelet supports a command-line flag to set the
52+
[scheduling priority](https://docs.microsoft.com/windows/win32/procthread/scheduling-priorities) of the
7953
kubelet process: `--windows-priorityclass`. This flag allows the kubelet process to get
8054
more CPU time slices when compared to other processes running on the Windows host.
8155
More information on the allowable values and their meaning is available at
8256
[Windows Priority Classes](https://docs.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities#priority-class).
8357
To ensure that running Pods do not starve the kubelet of CPU cycles, set this flag to `ABOVE_NORMAL_PRIORITY_CLASS` or above.
58+
59+
## Resource reservation {#resource-reservation}
60+
61+
To account for memory and CPU used by the operating system, the container runtime, and by
62+
Kubernetes host processes such as the kubelet, you can (and should) reserve
63+
memory and CPU resources with the `--kube-reserved` and/or `--system-reserved` kubelet flags.
64+
On Windows these values are only used to calculate the node's
65+
[allocatable](/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable) resources.
66+
67+
{{< caution >}}
68+
As you deploy workloads, set resource memory and CPU limits on containers.
69+
This also subtracts from `NodeAllocatable` and helps the cluster-wide scheduler in determining which pods to place on which nodes.
70+
71+
Scheduling pods without limits may over-provision the Windows nodes and in extreme
72+
cases can cause the nodes to become unhealthy.
73+
{{< /caution >}}
74+
75+
On Windows, a good practice is to reserve at least 2GiB of memory.
76+
77+
To determine how much CPU to reserve,
78+
identify the maximum pod density for each node and monitor the CPU usage of
79+
the system services running there, then choose a value that meets your workload needs.

content/en/docs/concepts/windows/intro.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ Some node features are only available if you use a specific
5050
including:
5151

5252
* HugePages: not supported for Windows containers
53-
* Privileged containers: not supported for Windows containers
53+
* Privileged containers: not supported for Windows containers.
54+
[HostProcess Containers](/docs/tasks/configure-pod-container/create-hostprocess-pod/) offer similar functionality.
5455
* TerminationGracePeriod: requires containerD
5556

5657
Not all features of shared namespaces are supported. See [API compatibility](#api)
@@ -78,7 +79,7 @@ section refers to several key workload abstractions and how they map to Windows.
7879

7980
* Single or multiple containers per Pod with process isolation and volume sharing
8081
* Pod `status` fields
81-
* Readiness and Liveness probes
82+
* Readiness, liveness, and startup probes
8283
* postStart & preStop container lifecycle hooks
8384
* ConfigMap, Secrets: as environment variables or volumes
8485
* `emptyDir` volumes
@@ -136,7 +137,7 @@ section refers to several key workload abstractions and how they map to Windows.
136137
Pods, workload resources, and Services are critical elements to managing Windows
137138
workloads on Kubernetes. However, on their own they are not enough to enable
138139
the proper lifecycle management of Windows workloads in a dynamic cloud native
139-
environment. Kubernetes also supports:
140+
environment.
140141

141142
* `kubectl exec`
142143
* Pod and container metrics
@@ -150,14 +151,15 @@ Some kubelet command line options behave differently on Windows, as described be
150151

151152
* The `--windows-priorityclass` lets you set the scheduling priority of the kubelet process
152153
(see [CPU resource management](/docs/concepts/configuration/windows-resource-management/#resource-management-cpu))
153-
* The `--kubelet-reserve`, `--system-reserve` , and `--eviction-hard` flags update
154+
* The `--kube-reserved`, `--system-reserved` , and `--eviction-hard` flags update
154155
[NodeAllocatable](/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable)
155156
* Eviction by using `--enforce-node-allocable` is not implemented
156157
* Eviction by using `--eviction-hard` and `--eviction-soft` are not implemented
157-
* A kubelet running on a Windows node does not have memory
158-
restrictions. `--kubelet-reserve` and `--system-reserve` do not set limits on
159-
kubelet or processes running on the host. This means kubelet or a process on the host
160-
could cause memory resource starvation outside the node-allocatable and scheduler.
158+
* When running on a Windows node the kubelet does not have memory or CPU
159+
restrictions. `--kube-reserved` and `--system-reserved` only subtract from `NodeAllocatable`
160+
and do not guarantee resource provided for workloads.
161+
See [Resource Management for Windows nodes](/docs/concepts/configuration/windows-resource-management/#resource-reservation)
162+
for more information.
161163
* The `MemoryPressure` Condition is not implemented
162164
* The kubelet does not take OOM eviction actions
163165

@@ -192,7 +194,7 @@ Container exit codes follow the same convention where 0 is success, and nonzero
192194
The specific error codes may differ across Windows and Linux. However, exit codes
193195
passed from the Kubernetes components (kubelet, kube-proxy) are unchanged.
194196

195-
##### Field compatibility for container specifications {#compatibility-v1-pod-spec-containers}
197+
#### Field compatibility for container specifications {#compatibility-v1-pod-spec-containers}
196198

197199
The following list documents differences between how Pod container specifications
198200
work between Windows and Linux:
@@ -232,7 +234,7 @@ work between Windows and Linux:
232234
default value is `/dev/termination-log`, which does work because it does not
233235
exist on Windows by default.
234236

235-
##### Field compatibility for Pod specifications {#compatibility-v1-pod}
237+
#### Field compatibility for Pod specifications {#compatibility-v1-pod}
236238

237239
The following list documents differences between how Pod specifications work between Windows and Linux:
238240

@@ -260,17 +262,18 @@ The following list documents differences between how Pod specifications work bet
260262
* You cannot enable `mountPropagation` for volume mounts as this is not
261263
supported on Windows.
262264

263-
##### Field compatibility for Pod security context {#compatibility-v1-pod-spec-containers-securitycontext}
265+
#### Field compatibility for Pod security context {#compatibility-v1-pod-spec-containers-securitycontext}
264266

265267
None of the Pod [`securityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) fields work on Windows.
266268

267-
### Node problem detector
269+
## Node problem detector
268270

269271
The node problem detector (see
270272
[Monitor Node Health](/docs/tasks/debug/debug-cluster/monitor-node-health/))
271-
is not compatible with Windows.
273+
has preliminary support for Windows.
274+
For more information, visit the project's [GitHub page](https://github.com/kubernetes/node-problem-detector#windows).
272275

273-
### Pause container
276+
## Pause container
274277

275278
In a Kubernetes Pod, an infrastructure or “pause” container is first created
276279
to host the container. In Linux, the cgroups and namespaces that make up a pod
@@ -293,7 +296,7 @@ The Kubernetes project recommends using the Microsoft maintained image if you ar
293296
deploying to a production or production-like environment that requires signed
294297
binaries.
295298

296-
### Container runtimes {#container-runtime}
299+
## Container runtimes {#container-runtime}
297300

298301
You need to install a
299302
{{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}
@@ -303,7 +306,7 @@ The following container runtimes work with Windows:
303306

304307
{{% thirdparty-content %}}
305308

306-
#### cri-containerd
309+
### ContainerD
307310

308311
{{< feature-state for_k8s_version="v1.20" state="stable" >}}
309312

@@ -318,9 +321,10 @@ when using GMSA with containerd to access Windows network shares, which requires
318321
kernel patch.
319322
{{< /note >}}
320323

321-
#### Mirantis Container Runtime {#mcr}
324+
### Mirantis Container Runtime {#mcr}
322325

323-
[Mirantis Container Runtime](https://docs.mirantis.com/mcr/20.10/overview.html) (MCR) is available as a container runtime for all Windows Server 2019 and later versions.
326+
[Mirantis Container Runtime](https://docs.mirantis.com/mcr/20.10/overview.html) (MCR)
327+
is available as a container runtime for all Windows Server 2019 and later versions.
324328

325329
See [Install MCR on Windows Servers](https://docs.mirantis.com/mcr/20.10/install/mcr-windows.html) for more information.
326330

@@ -361,12 +365,10 @@ If you have what looks like a bug, or you would like to
361365
make a feature request, please follow the [SIG Windows contributing guide](https://github.com/kubernetes/community/blob/master/sig-windows/CONTRIBUTING.md#reporting-issues-and-feature-requests) to create a new issue.
362366
You should first search the list of issues in case it was
363367
reported previously and comment with your experience on the issue and add additional
364-
logs. SIG-Windows Slack is also a great avenue to get some initial support and
368+
logs. SIG Windows channel on the Kubernetes Slack is also a great avenue to get some initial support and
365369
troubleshooting ideas prior to creating a ticket.
366370

367-
## {{% heading "whatsnext" %}}
368-
369-
### Deployment tools
371+
## Deployment tools
370372

371373
The kubeadm tool helps you to deploy a Kubernetes cluster, providing the control
372374
plane to manage the cluster it, and nodes to run your workloads.
@@ -375,9 +377,10 @@ explains how to deploy Windows nodes to your cluster using kubeadm.
375377

376378
The Kubernetes [cluster API](https://cluster-api.sigs.k8s.io/) project also provides means to automate deployment of Windows nodes.
377379

378-
### Windows distribution channels
380+
## Windows distribution channels
379381

380-
For a detailed explanation of Windows distribution channels see the [Microsoft documentation](https://docs.microsoft.com/en-us/windows-server/get-started-19/servicing-channels-19).
382+
For a detailed explanation of Windows distribution channels see the
383+
[Microsoft documentation](https://docs.microsoft.com/en-us/windows-server/get-started-19/servicing-channels-19).
381384

382385
Information on the different Windows Server servicing channels
383386
including their support models can be found at

0 commit comments

Comments
 (0)