⎈ k8s knowledge compiler

Create a Windows HostProcess Pod [page]deterministic

tasksschedulingstorage

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

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

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

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

##

This task guide is specific to Kubernetes v. If you are not running Kubernetes v, check the documentation for that version of Kubernetes.

In Kubernetes , the HostProcess container feature is enabled by default. The kubelet will communicate with containerd directly by passing the hostprocess flag via CRI. You can use the latest version of containerd (v1.6+) to run HostProcess containers. [How to install containerd.](/docs/setup/production-environment/container-runtimes/#containerd)

## Limitations

These limitations are relevant for Kubernetes v:

  • HostProcess containers require containerd 1.6 or higher [container runtime](#gloss:container-runtime) and containerd 1.7 is recommended.
  • HostProcess pods can only contain HostProcess containers. This is a current limitation of the Windows OS; non-privileged Windows containers cannot share a vNIC with the host IP namespace.
  • HostProcess containers run as a process on the host and do not have any degree of isolation other than resource constraints imposed on the HostProcess user account. Neither filesystem or Hyper-V isolation are supported for HostProcess containers.
  • Volume mounts are supported and are mounted under the container volume. See [Volume Mounts](#volume-mounts)
  • A limited set of host user accounts are available for HostProcess containers by default. See [Choosing a User Account](#choosing-a-user-account).
  • Resource limits (disk, memory, cpu count) are supported in the same fashion as processes on the host.
  • Both Named pipe mounts and Unix domain sockets are not supported and should instead be accessed via their path on the host (e.g. \\\\.\\pipe\\\*)

## HostProcess Pod configuration requirements

Enabling a Windows HostProcess pod requires setting the right configurations in the pod security configuration. …(trimmed)

Sources

tasks/configure-pod-container/create-hostprocess-pod.md · docCreate a Windows HostProcess Pod

Related (16)

references Container Runtimecontainer runtime conf=1
part_of {{% heading "prerequisites" %}}describes conf=1
part_of Limitationsdescribes conf=1
part_of HostProcess Pod configuration requirementsdescribes conf=1
part_of Volume mountsdescribes conf=1
part_of Resource limitsdescribes conf=1
part_of Choosing a user accountdescribes conf=1
part_of Base Image for HostProcess Containersdescribes conf=1
part_of Troubleshooting HostProcess containersdescribes conf=1
part_of Containerd v1.6describes conf=1
part_of Containerd v1.7 (and greater)describes conf=1
part_of System accountsdescribes conf=1
part_of Local accounts {#local-accounts}describes conf=1
api_for Poddocuments API object conf=1

← all Docs