1
1
---
2
2
layout : blog
3
- title : " Kubernetes 1.26: Windows HostProcess Containers Are Going Stable "
3
+ title : " Kubernetes 1.26: Windows HostProcess Containers Are Going Generally Available "
4
4
date : 2022-12-13
5
- slug : host-process-containers-stable
5
+ slug : windows- host-process-containers-ga
6
6
---
7
7
8
8
** Authors** : Brandon Smith (Microsoft) and Mark Rossetti (Microsoft)
9
9
10
10
The long-awaited day has arrived: HostProcess containers, the Windows equivalent to Linux privileged
11
11
containers, has finally made it to ** GA in Kubernetes 1.26** !
12
12
13
- What are HostProcess containers and why are they useful? Cluster operators
14
- are often faced with the need to configure their nodes upon provisioning. Whether it's
15
- installing services, certificates, network configs, device plugins, or even monitoring solutions like
16
- installing Windows services, configuring registry keys and certificates for TLS, managing network configurations,
17
- providing a [ device plugin] ( /docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/ ) ,
18
- or even deploying monitoring tools such as a Prometheus's node-exporter.
19
- Until now, scenarios common to Linux privileged containers (such as running CNI solutions on the node)
20
- all required alternative solutions on Windows.
21
-
22
- HostProcess containers enable you to do all of this and more with minimal effort.
23
- With HostProcess containers you can now package any payload (such as powershell scripts)
13
+ What are HostProcess containers and why are they useful?
14
+
15
+ Cluster operators are often faced with the need to configure their nodes upon provisioning. Whether it's
16
+ installing Windows services, configuring registry keys, managing TLS certificates,
17
+ making network configuration changes, or even deploying monitoring tools such as a Prometheus's node-exporter.
18
+ Previously, performing these actions on Windows nodes was usually done by running PowerShell scripts
19
+ over SSH or WinRM sessions and/or working with your cloud provider's virtual machine management tooling.
20
+ HostProcess containers now enable you to do all of this and more with minimal effort.
21
+
22
+ With HostProcess containers you can now package any payload
24
23
into the container image, map volumes into container at runtime, and manage them like any other Kubernetes workload.
25
- These features combined remove the need to exec into the node or configure
26
- your cloud provider's virtual machine management tooling to perform these administrative actions.
27
24
You get all the benefits of containerized packaging and deployment methods combined with a reduction in
28
25
both administrative and development cost.
29
26
Gone are the days where cluster operators would need to manually log onto
@@ -39,31 +36,26 @@ On the other hand, Windows Server containers are highly isolated and exist in a
39
36
execution namespace. Direct access to the host from a Windows Server container is explicitly disallowed
40
37
by default.
41
38
42
- The Kubernetes project strongly recommends against mounting a host volume into a Windows Server
43
- container in order to minimize potential attack surfaces. HostProcess containers enable you to configure
44
- the host, along with privileged helper Pods, so that communication with your Windows workloads
45
- in containers happens within the bounds of a secure pipeline.
46
-
47
39
## How does it work?
48
40
49
41
Windows HostProcess containers are implemented with Windows [ _ Job Objects_ ] ( https://learn.microsoft.com/en-us/windows/win32/procthread/job-objects ) ,
50
- a break from the previous container model using server silos.
51
- Job objects are components of the Windows OS which offer the ability to
42
+ a break from the previous container model which use server silos.
43
+ Job Objects are components of the Windows OS which offer the ability to
52
44
manage a group of processes as a group (also known as a _ job_ ) and assign resource constraints to the
53
45
group as a whole. Job objects are specific to the Windows OS and are not associated with
54
46
the Kubernetes [ Job API] ( /docs/concepts/workloads/controllers/job/ ) . They have no process
55
47
or file system isolation,
56
48
enabling the privileged payload to view and edit the host file system with the
57
- correct permissions, among other host resources. The init process, and any processes
49
+ desired permissions, among other host resources. The init process, and any processes
58
50
it launches (including processes explicitly launched by the user) are all assigned to the
59
51
job object of that container. When the init process exits or is signaled to exit,
60
52
all the processes in the job will be signaled to exit, the job handle will be
61
53
closed and the storage will be unmounted.
62
54
63
55
HostProcess and Linux privileged containers enable similar scenarios but differ
64
56
greatly in their implementation (hence the naming difference). HostProcess containers
65
- have their own pod security context fields. Those used to configure Linux privileged
66
- containers ** do not** apply. Enabling privileged access to a Windows host is a
57
+ have their own [ PodSecurityContext ] ( https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#windowssecuritycontextoptions-v1-core ) fields.
58
+ Those used to configure Linux privileged containers ** do not** apply. Enabling privileged access to a Windows host is a
67
59
fundamentally different process than with Linux so the configuration and
68
60
capabilities of each differ significantly. Below is a diagram detailing the
69
61
overall architecture of Windows HostProcess containers:
@@ -101,17 +93,18 @@ To use that Microsoft image, put this in your `Dockerfile`:
101
93
FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
102
94
```
103
95
104
- You can run HostProcess containers can be run from within a
96
+ You can run HostProcess containers from within a
105
97
[ HostProcess Pod] ( /docs/concepts/workloads/pods/#privileged-mode-for-containers ) .
98
+
106
99
To get started with running Windows containers,
107
- see the general guidance for [ deploying Windows nodes] ( /docs/setup/production-environment/windows/ ) .
100
+ see the general guidance for [ deploying Windows nodes] ( /docs/setup/production-environment/windows/ ) .
108
101
If you have a compatible node (for example: Windows as the operating system
109
- containerd 1 .7 or later, and hcsshim v0.9.5 ), you can deploy a Pod with one
102
+ containerd v1 .7 or later), you can deploy a Pod with one
110
103
or more HostProcess containers.
111
- See the [ prerequisites] ( /docs/tasks/configure-pod-container/create-hostprocess-pod/#before-you-begin )
112
- in [ Create a Windows HostProcess Pod] ( /docs/tasks/configure-pod-container/create-hostprocess-pod )
104
+ See the [ Create a Windows HostProcess Pod - Prerequisites] ( /docs/tasks/configure-pod-container/create-hostprocess-pod/#before-you-begin )
113
105
for more information.
114
- Within a Pod, you can't mix HostProcess containers with normal Windows containers.
106
+
107
+ Please note that within a Pod, you can't mix HostProcess containers with normal Windows containers.
115
108
116
109
## How can I learn more?
117
110
@@ -125,6 +118,5 @@ Within a Pod, you can't mix HostProcess containers with normal Windows container
125
118
126
119
## How do I get involved?
127
120
128
- HostProcess containers are in active development. SIG Windows welcomes suggestions from the community.
129
121
Get involved with [ SIG Windows] ( https://github.com/kubernetes/community/tree/master/sig-windows )
130
122
to contribute!
0 commit comments