Skip to content

Commit 6a68446

Browse files
authored
Windows HostProcess Beta 1.23 Documentation (#30391)
* Added initial version change * Added more information for HostProcess in 1.23, removed content relating to 1.22 specifically. * Made containerd mention specific to 1.6 * Added note about base images and removed annotation mentions * Reworded prerequisites section.
1 parent 0660f9a commit 6a68446

File tree

2 files changed

+64
-73
lines changed

2 files changed

+64
-73
lines changed

content/en/docs/reference/command-line-tools-reference/feature-gates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ different Kubernetes components.
203203
| `WinDSR` | `false` | Alpha | 1.14 | |
204204
| `WinOverlay` | `false` | Alpha | 1.14 | 1.19 |
205205
| `WinOverlay` | `true` | Beta | 1.20 | |
206-
| `WindowsHostProcessContainers` | `false` | Alpha | 1.22 | |
206+
| `WindowsHostProcessContainers` | `false` | Beta | 1.23 | |
207207
{{< /table >}}
208208

209209
### Feature gates for graduated or deprecated features

content/en/docs/tasks/configure-pod-container/create-hostprocess-pod.md

Lines changed: 63 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -7,102 +7,84 @@ min-kubernetes-server-version: 1.22
77

88
<!-- overview -->
99

10-
{{< feature-state for_k8s_version="v1.22" state="alpha" >}}
10+
{{< feature-state for_k8s_version="v1.23" state="beta" >}}
1111

12-
Windows HostProcess containers enable you to run containerized
13-
workloads on a Windows host. These containers operate as
14-
normal processes but have access to the host network namespace,
15-
storage, and devices when given the appropriate user privileges.
12+
Windows HostProcess containers enable you to run containerized
13+
workloads on a Windows host. These containers operate as
14+
normal processes but have access to the host network namespace,
15+
storage, and devices when given the appropriate user privileges.
1616
HostProcess containers can be used to deploy network plugins,
17-
storage configurations, device plugins, kube-proxy, and other
18-
components to Windows nodes without the need for dedicated proxies or
17+
storage configurations, device plugins, kube-proxy, and other
18+
components to Windows nodes without the need for dedicated proxies or
1919
the direct installation of host services.
2020

21-
Administrative tasks such as installation of security patches, event
22-
log collection, and more can be performed without requiring cluster operators to
23-
log onto each Window node. HostProcess containers can run as any user that is
24-
available on the host or is in the domain of the host machine, allowing administrators
25-
to restrict resource access through user permissions. While neither filesystem or process
26-
isolation are supported, a new volume is created on the host upon starting the container
27-
to give it a clean and consolidated workspace. HostProcess containers can also be built on
28-
top of existing Windows base images and do not inherit the same
29-
[compatibility requirements](https://docs.microsoft.com/virtualization/windowscontainers/deploy-containers/version-compatibility)
30-
as Windows server containers, meaning that the version of the base images does not need
31-
to match that of the host. HostProcess containers also support
21+
Administrative tasks such as installation of security patches, event
22+
log collection, and more can be performed without requiring cluster operators to
23+
log onto each Window node. HostProcess containers can run as any user that is
24+
available on the host or is in the domain of the host machine, allowing administrators
25+
to restrict resource access through user permissions. While neither filesystem or process
26+
isolation are supported, a new volume is created on the host upon starting the container
27+
to give it a clean and consolidated workspace. HostProcess containers can also be built on
28+
top of existing Windows base images and do not inherit the same
29+
[compatibility requirements](https://docs.microsoft.com/virtualization/windowscontainers/deploy-containers/version-compatibility)
30+
as Windows server containers, meaning that the version of the base images does not need
31+
to match that of the host. It is, however, recommended that you use the same base image
32+
version as your Windows Server container workloads to ensure you do not have any unused
33+
images taking up space on the node. HostProcess containers also support
3234
[volume mounts](./create-hostprocess-pod#volume-mounts) within the container volume.
3335

3436
### When should I use a Windows HostProcess container?
3537

36-
- When you need to perform tasks which require the networking namespace of the host.
38+
- When you need to perform tasks which require the networking namespace of the host.
3739
HostProcess containers have access to the host's network interfaces and IP addresses.
3840
- You need access to resources on the host such as the filesystem, event logs, etc.
3941
- Installation of specific device drivers or Windows services.
40-
- Consolidation of administrative tasks and security policies. This reduces the degree of
42+
- Consolidation of administrative tasks and security policies. This reduces the degree of
4143
privileges needed by Windows nodes.
4244

4345

44-
## {{% heading "prerequisites" %}}
46+
## {{% heading "prerequisites" %}}% version-check %}}
4547

46-
{{% version-check %}}
48+
In 1.23 the HostProcess container feature is enabled by default. The kublet will
49+
communicate with containerd directly by passing the hostprocess flag via CRI. You can use the
50+
latest version of containerd (v1.6+) to run HostProcess containers.
51+
[How to install containerd.](/docs/setup/production-environment/container-runtimes/#containerd)
4752

48-
To enable HostProcess containers while in Alpha you need to pass the following feature gate flag to
49-
**kubelet** and **kube-apiserver**.
50-
See [Features Gates](/docs/reference/command-line-tools-reference/feature-gates/#overview)
51-
documentation for more details.
53+
To *disable* HostProcess containers you need to pass the following feature gate flag to the
54+
**kubelet** and **kube-apiserver**:
5255

53-
```
54-
--feature-gates=WindowsHostProcessContainers=true
56+
```powershell
57+
--feature-gates=WindowsHostProcessContainers=false
5558
```
5659

57-
You can use the latest version of Containerd (v1.5.4+) with the following settings using the containerd
58-
v2 configuration. Add these annotations to any runtime configurations were you wish to enable the
59-
HostProcess container feature.
60-
60+
See [Features Gates](/docs/reference/command-line-tools-reference/feature-gates/#overview)
61+
documentation for more details.
6162

62-
```
63-
[plugins]
64-
[plugins."io.containerd.grpc.v1.cri"]
65-
[plugins."io.containerd.grpc.v1.cri".containerd]
66-
[plugins."io.containerd.grpc.v1.cri".containerd.default_runtime]
67-
container_annotations = ["microsoft.com/hostprocess-container"]
68-
pod_annotations = ["microsoft.com/hostprocess-container"]
69-
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
70-
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runhcs-wcow-process]
71-
container_annotations = ["microsoft.com/hostprocess-container"]
72-
pod_annotations = ["microsoft.com/hostprocess-container"]
73-
```
7463

75-
The current versions of containerd ship with a version of hcsshim that does not have support.
76-
You will need to build a version of hcsshim from the main branch following the
77-
[instructions in hcsshim](https://github.com/Microsoft/hcsshim/#containerd-shim).
78-
Once the containerd shim is built you can replace the file in your contianerd installation.
79-
For example if you followed the instructions to
80-
[install containerd](/docs/setup/production-environment/container-runtimes/#containerd)
81-
replace the `containerd-shim-runhcs-v1.exe` is installed at `$Env:ProgramFiles\containerd` with the newly built shim.
8264

8365
## Limitations
8466

85-
- HostProcess containers require version 1.5.4 or higher of the containerd {{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}.
86-
- As of v1.22 HostProcess pods can only contain HostProcess containers. This is a current limitation
67+
- HostProcess containers require containerd 1.6 or higher
68+
{{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}.
69+
- As of v1.23 HostProcess pods can only contain HostProcess containers. This is a current limitation
8770
of the Windows OS; non-privileged Windows containers cannot share a vNIC with the host IP namespace.
88-
- HostProcess containers run as a process on the host and do not have any degree of
89-
isolation other than resource constraints imposed on the HostProcess user account. Neither
71+
- HostProcess containers run as a process on the host and do not have any degree of
72+
isolation other than resource constraints imposed on the HostProcess user account. Neither
9073
filesystem or Hyper-V isolation are supported for HostProcess containers.
91-
- Volume mounts are supported and are mounted under the container volume.
92-
See [Volume Mounts](#volume-mounts)
93-
- A limited set of host user accounts are available for HostProcess containers by default.
74+
- Volume mounts are supported and are mounted under the container volume. See [Volume Mounts](#volume-mounts)
75+
- As of 1.23, a limited set of host user accounts are available for HostProcess containers by default.
9476
See [Choosing a User Account](#choosing-a-user-account).
95-
- Resource limits (disk, memory, cpu count) are supported in the same fashion as processes
77+
- Resource limits (disk, memory, cpu count) are supported in the same fashion as processes
9678
on the host.
97-
- Both Named pipe mounts and Unix domain sockets are **not** currently supported and should instead
79+
- Both Named pipe mounts and Unix domain sockets are **not** currently supported and should instead
9880
be accessed via their path on the host (e.g. \\\\.\\pipe\\\*)
9981

10082
## HostProcess Pod configuration requirements
10183

102-
Enabling a Windows HostProcess pod requires setting the right configurations in the pod security
103-
configuration. Of the policies defined in the [Pod Security Standards](/docs/concepts/security/pod-security-standards)
104-
HostProcess pods are disallowed by the baseline and restricted policies. It is therefore recommended
105-
that HostProcess pods run in alignment with the privileged profile.
84+
Enabling a Windows HostProcess pod requires setting the right configurations in the pod security
85+
configuration. Of the policies defined in the [Pod Security Standards](/docs/concepts/security/pod-security-standards)
86+
HostProcess pods are disallowed by the baseline and restricted policies. It is therefore recommended
87+
that HostProcess pods run in alignment with the privileged profile.
10688

10789
When running under the privileged policy, here are
10890
the configurations which need to be set to enable the creation of a HostProcess pod:
@@ -185,10 +167,10 @@ spec:
185167
186168
## Volume Mounts
187169
188-
HostProcess containers support the ability to mount volumes within the container volume space.
189-
Applications running inside the container can access volume mounts directly via relative or
190-
absolute paths. An environment variable `$CONTAINER_SANDBOX_MOUNT_POINT` is set upon container
191-
creation and provides the absolute host path to the container volume. Relative paths are based
170+
HostProcess containers support the ability to mount volumes within the container volume space.
171+
Applications running inside the container can access volume mounts directly via relative or
172+
absolute paths. As of v1.23, an environment variable `$CONTAINER_SANDBOX_MOUNT_POINT` is set upon container
173+
creation and provides the absolute host path to the container volume. Relative paths are based
192174
upon the `Pod.containers.volumeMounts.mountPath` configuration.
193175

194176
### Example {#volume-mount-example}
@@ -199,13 +181,22 @@ To access service account tokens the following path structures are supported wit
199181
200182
`$CONTAINER_SANDBOX_MOUNT_POINT\var\run\secrets\kubernetes.io\serviceaccount\`
201183

184+
## Resource Limits
185+
186+
Resource limits (disk, memory, cpu count) are applied to the job and are job wide.
187+
For example, with a limit of 10MB set, the memory allocated for any HostProcess job object
188+
will be capped at 10MB. This is the same behavior as other Windows container types.
189+
These limits would be specified the same way they are currently for whatever orchestrator
190+
or runtime is being used. The only difference is in the disk resource usage calculation
191+
used for resource tracking due to the difference in how HostProcess containers are bootstrapped.
192+
202193
## Choosing a User Account
203194

204-
HostProcess containers support the ability to run as one of three supported Windows service accounts:
195+
As of 1.23, HostProcess containers support the ability to run as one of three supported Windows service accounts:
205196

206-
- **[LocalSystem](https://docs.microsoft.com/en-us/windows/win32/services/localsystem-account)**
207-
- **[LocalService](https://docs.microsoft.com/en-us/windows/win32/services/localservice-account)**
208-
- **[NetworkService](https://docs.microsoft.com/en-us/windows/win32/services/networkservice-account)**
197+
- **[LocalSystem](https://docs.microsoft.com/windows/win32/services/localsystem-account)**
198+
- **[LocalService](https://docs.microsoft.com/windows/win32/services/localservice-account)**
199+
- **[NetworkService](https://docs.microsoft.com/windows/win32/services/networkservice-account)**
209200

210201
You should select an appropriate Windows service account for each HostProcess
211202
container, aiming to limit the degree of privileges so as to avoid accidental (or even

0 commit comments

Comments
 (0)