Skip to content

Commit 4d9e6d7

Browse files
marossetaravindhp
andauthored
Windows documentation overhaul (#33582)
* Move Windows storage concepts to a new page - Move FlexVolume plugins section to docs/concepts/storage/volumes.md - Move CSI plugins section to en/docs/concepts/storage/volumes.md - Move in-tree plugins section to en/docs/concepts/storage/volumes.md * Moving networking related content in /docs/setup/production-environment/windows to various locations - Moving windows DNS limitations to/docs/concepts/services-networking/dns-pod-service.md - Moving windows session sticky time disclaimer to /docs/concepts/services-networking/service.md - Moving windows dual stack support info to /docs/concepts/services-networking/dual-stack.md - Moving generic Windows content to /docs/concepts/services-networking/windows-networking.md Signed-off-by: Mark Rossetti <[email protected]> * Moving Windows troubleshooting topics to /tasks/debug-application-cluster/ Signed-off-by: Mark Rossetti <[email protected]> * Moving windows containers user guide out of /setup/production-environment/ Signed-off-by: Mark Rossetti <[email protected]> * fixup! Moving windows containers user guide out of /setup/production-environment/ * moving intro-windows-in-kubernetes content out of /setup/production-environment/ Signed-off-by: Mark Rossetti <[email protected]> Co-authored-by: Aravindh Puthiyaparambil <[email protected]>
1 parent 4d95494 commit 4d9e6d7

File tree

13 files changed

+917
-983
lines changed

13 files changed

+917
-983
lines changed

content/en/docs/concepts/services-networking/dns-pod-service.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ following pod-specific DNS policies. These policies are specified in the
226226
for details on how DNS queries are handled in those cases.
227227
- "`ClusterFirstWithHostNet`": For Pods running with hostNetwork, you should
228228
explicitly set its DNS policy "`ClusterFirstWithHostNet`".
229+
- Note: This is not supported on Windows. See [below](#dns-windows) for details
229230
- "`None`": It allows a Pod to ignore DNS settings from the Kubernetes
230231
environment. All DNS settings are supposed to be provided using the
231232
`dnsConfig` field in the Pod Spec.
@@ -323,8 +324,25 @@ If the feature gate `ExpandedDNSConfig` is enabled for the kube-apiserver and
323324
the kubelet, it is allowed for Kubernetes to have at most 32 search domains and
324325
a list of search domains of up to 2048 characters.
325326

326-
## {{% heading "whatsnext" %}}
327+
## DNS resolution on Windows nodes {#dns-windows}
328+
329+
- ClusterFirstWithHostNet is not supported for pods that run on Windows nodes.
330+
Windows treats all names with a `.` as a FQDN and skips FQDN resolution.
331+
- On Windows, there are multiple DNS resolvers that can be used. As these come with
332+
slightly different behaviors, using the
333+
[`Resolve-DNSName`](https://docs.microsoft.com/powershell/module/dnsclient/resolve-dnsname)
334+
powershell cmdlet for name query resolutions is recommended.
335+
- On Linux, you have a DNS suffix list, which is used after resolution of a name as fully
336+
qualified has failed.
337+
On Windows, you can only have 1 DNS suffix, which is the DNS suffix associated with that
338+
pod's namespace (example: `mydns.svc.cluster.local`). Windows can resolve FQDNs, services,
339+
or network name which can be resolved with this single suffix. For example, a pod spawned
340+
in the `default` namespace, will have the DNS suffix `default.svc.cluster.local`.
341+
Inside a Windows pod, you can resolve both `kubernetes.default.svc.cluster.local`
342+
and `kubernetes`, but not the partially qualified names (`kubernetes.default` or
343+
`kubernetes.default.svc`).
327344

345+
## {{% heading "whatsnext" %}}
328346

329347
For guidance on administering DNS configurations, check
330348
[Configure DNS Service](/docs/tasks/administer-cluster/dns-custom-nameservers/)

content/en/docs/concepts/services-networking/dual-stack.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,21 @@ If you want to enable egress traffic in order to reach off-cluster destinations
239239
Ensure your {{< glossary_tooltip text="CNI" term_id="cni" >}} provider supports IPv6.
240240
{{< /note >}}
241241

242+
## Windows support
243+
244+
Kubernetes on Windows does not support single-stack "IPv6-only" networking. However,
245+
dual-stack IPv4/IPv6 networking for pods and nodes with single-family services
246+
is supported.
247+
248+
You can use IPv4/IPv6 dual-stack networking with `l2bridge` networks.
249+
250+
{{< note >}}
251+
Overlay (VXLAN) networks on Windows **do not** support dual-stack networking.
252+
{{< /note >}}
253+
254+
You can read more about the different network modes for Windows within the
255+
[Networking on Windows](/docs/concepts/services-networking/windows-networking#network-modes) topic.
256+
242257
## {{% heading "whatsnext" %}}
243258

244259

content/en/docs/concepts/services-networking/service.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ You can also set the maximum session sticky time by setting
394394
`service.spec.sessionAffinityConfig.clientIP.timeoutSeconds` appropriately.
395395
(the default value is 10800, which works out to be 3 hours).
396396

397+
{{< note >}}
398+
On Windows, setting the maximum session sticky time for Services is not supported.
399+
{{< /note >}}
400+
397401
## Multi-Port Services
398402

399403
For some Services, you need to expose more than one port.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
reviewers:
3+
- aravindhp
4+
- jayunit100
5+
- jsturtevant
6+
- marosset
7+
title: Networking on Windows
8+
content_type: concept
9+
weight: 75
10+
---
11+
12+
<!-- overview -->
13+
14+
Kubernetes supports running nodes on either Linux or Windows. You can mix both kinds of node
15+
within a single cluster.
16+
This page provides an overview to networking specific to the Windows operating system.
17+
18+
<!-- body -->
19+
## Container networking on Windows {#networking}
20+
21+
Networking for Windows containers is exposed through
22+
[CNI plugins](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/).
23+
Windows containers function similarly to virtual machines in regards to
24+
networking. Each container has a virtual network adapter (vNIC) which is connected
25+
to a Hyper-V virtual switch (vSwitch). The Host Networking Service (HNS) and the
26+
Host Compute Service (HCS) work together to create containers and attach container
27+
vNICs to networks. HCS is responsible for the management of containers whereas HNS
28+
is responsible for the management of networking resources such as:
29+
30+
* Virtual networks (including creation of vSwitches)
31+
* Endpoints / vNICs
32+
* Namespaces
33+
* Policies including packet encapsulations, load-balancing rules, ACLs, and NAT rules.
34+
35+
The Windows HNS and vSwitch implement namespacing and can
36+
create virtual NICs as needed for a pod or container. However, many configurations such
37+
as DNS, routes, and metrics are stored in the Windows registry database rather than as
38+
files inside `/etc`, which is how Linux stores those configurations. The Windows registry for the container
39+
is separate from that of the host, so concepts like mapping `/etc/resolv.conf` from
40+
the host into a container don't have the same effect they would on Linux. These must
41+
be configured using Windows APIs run in the context of that container. Therefore
42+
CNI implementations need to call the HNS instead of relying on file mappings to pass
43+
network details into the pod or container.
44+
45+
## Network modes
46+
47+
Windows supports five different networking drivers/modes: L2bridge, L2tunnel,
48+
Overlay (Beta), Transparent, and NAT. In a heterogeneous cluster with Windows and Linux
49+
worker nodes, you need to select a networking solution that is compatible on both
50+
Windows and Linux. The following table lists the out-of-tree plugins are supported on Windows,
51+
with recommendations on when to use each CNI:
52+
53+
| Network Driver | Description | Container Packet Modifications | Network Plugins | Network Plugin Characteristics |
54+
| -------------- | ----------- | ------------------------------ | --------------- | ------------------------------ |
55+
| L2bridge | Containers are attached to an external vSwitch. Containers are attached to the underlay network, although the physical network doesn't need to learn the container MACs because they are rewritten on ingress/egress. | MAC is rewritten to host MAC, IP may be rewritten to host IP using HNS OutboundNAT policy. | [win-bridge](https://github.com/containernetworking/plugins/tree/master/plugins/main/windows/win-bridge), [Azure-CNI](https://github.com/Azure/azure-container-networking/blob/master/docs/cni.md), Flannel host-gateway uses win-bridge | win-bridge uses L2bridge network mode, connects containers to the underlay of hosts, offering best performance. Requires user-defined routes (UDR) for inter-node connectivity. |
56+
| L2Tunnel | This is a special case of l2bridge, but only used on Azure. All packets are sent to the virtualization host where SDN policy is applied. | MAC rewritten, IP visible on the underlay network | [Azure-CNI](https://github.com/Azure/azure-container-networking/blob/master/docs/cni.md) | Azure-CNI allows integration of containers with Azure vNET, and allows them to leverage the set of capabilities that [Azure Virtual Network provides](https://azure.microsoft.com/en-us/services/virtual-network/). For example, securely connect to Azure services or use Azure NSGs. See [azure-cni for some examples](https://docs.microsoft.com/azure/aks/concepts-network#azure-cni-advanced-networking) |
57+
| Overlay | Containers are given a vNIC connected to an external vSwitch. Each overlay network gets its own IP subnet, defined by a custom IP prefix.The overlay network driver uses VXLAN encapsulation. | Encapsulated with an outer header. | [win-overlay](https://github.com/containernetworking/plugins/tree/master/plugins/main/windows/win-overlay), Flannel VXLAN (uses win-overlay) | win-overlay should be used when virtual container networks are desired to be isolated from underlay of hosts (e.g. for security reasons). Allows for IPs to be re-used for different overlay networks (which have different VNID tags) if you are restricted on IPs in your datacenter. This option requires [KB4489899](https://support.microsoft.com/help/4489899) on Windows Server 2019. |
58+
| Transparent (special use case for [ovn-kubernetes](https://github.com/openvswitch/ovn-kubernetes)) | Requires an external vSwitch. Containers are attached to an external vSwitch which enables intra-pod communication via logical networks (logical switches and routers). | Packet is encapsulated either via [GENEVE](https://datatracker.ietf.org/doc/draft-gross-geneve/) or [STT](https://datatracker.ietf.org/doc/draft-davie-stt/) tunneling to reach pods which are not on the same host. <br/> Packets are forwarded or dropped via the tunnel metadata information supplied by the ovn network controller. <br/> NAT is done for north-south communication. | [ovn-kubernetes](https://github.com/openvswitch/ovn-kubernetes) | [Deploy via ansible](https://github.com/openvswitch/ovn-kubernetes/tree/master/contrib). Distributed ACLs can be applied via Kubernetes policies. IPAM support. Load-balancing can be achieved without kube-proxy. NATing is done without using iptables/netsh. |
59+
| NAT (*not used in Kubernetes*) | Containers are given a vNIC connected to an internal vSwitch. DNS/DHCP is provided using an internal component called [WinNAT](https://techcommunity.microsoft.com/t5/virtualization/windows-nat-winnat-capabilities-and-limitations/ba-p/382303) | MAC and IP is rewritten to host MAC/IP. | [nat](https://github.com/Microsoft/windows-container-networking/tree/master/plugins/nat) | Included here for completeness |
60+
61+
As outlined above, the [Flannel](https://github.com/coreos/flannel)
62+
[CNI plugin](https://github.com/flannel-io/cni-plugin)
63+
is also [supported](https://github.com/flannel-io/cni-plugin#windows-support-experimental) on Windows via the
64+
[VXLAN network backend](https://github.com/coreos/flannel/blob/master/Documentation/backends.md#vxlan) (**Beta support** ; delegates to win-overlay)
65+
and [host-gateway network backend](https://github.com/coreos/flannel/blob/master/Documentation/backends.md#host-gw) (stable support; delegates to win-bridge).
66+
67+
This plugin supports delegating to one of the reference CNI plugins (win-overlay,
68+
win-bridge), to work in conjunction with Flannel daemon on Windows (Flanneld) for
69+
automatic node subnet lease assignment and HNS network creation. This plugin reads
70+
in its own configuration file (cni.conf), and aggregates it with the environment
71+
variables from the FlannelD generated subnet.env file. It then delegates to one of
72+
the reference CNI plugins for network plumbing, and sends the correct configuration
73+
containing the node-assigned subnet to the IPAM plugin (for example: `host-local`).
74+
75+
For Node, Pod, and Service objects, the following network flows are supported for
76+
TCP/UDP traffic:
77+
78+
* Pod → Pod (IP)
79+
* Pod → Pod (Name)
80+
* Pod → Service (Cluster IP)
81+
* Pod → Service (PQDN, but only if there are no ".")
82+
* Pod → Service (FQDN)
83+
* Pod → external (IP)
84+
* Pod → external (DNS)
85+
* Node → Pod
86+
* Pod → Node
87+
88+
## IP address management (IPAM) {#ipam}
89+
90+
The following IPAM options are supported on Windows:
91+
92+
* [host-local](https://github.com/containernetworking/plugins/tree/master/plugins/ipam/host-local)
93+
* [azure-vnet-ipam](https://github.com/Azure/azure-container-networking/blob/master/docs/ipam.md) (for azure-cni only)
94+
* [Windows Server IPAM](https://docs.microsoft.com/windows-server/networking/technologies/ipam/ipam-top) (fallback option if no IPAM is set)
95+
96+
## Load balancing and Services
97+
98+
A Kubernetes {{< glossary_tooltip text="Service" term_id="service" >}} is an abstraction
99+
that defines a logical set of Pods and a means to access them over a network.
100+
In a cluster that includes Windows nodes, you can use the following types of Service:
101+
102+
* `NodePort`
103+
* `ClusterIP`
104+
* `LoadBalancer`
105+
* `ExternalName`
106+
107+
Windows container networking differs in some important ways from Linux networking.
108+
The [Microsoft documentation for Windows Container Networking](https://docs.microsoft.com/en-us/virtualization/windowscontainers/container-networking/architecture)
109+
provides additional details and background.
110+
111+
On Windows, you can use the following settings to configure Services and load
112+
balancing behavior:
113+
114+
{{< table caption="Windows Service Settings" >}}
115+
| Feature | Description | Minimum Supported Windows OS build | How to enable |
116+
| ------- | ----------- | -------------------------- | ------------- |
117+
| Session affinity | Ensures that connections from a particular client are passed to the same Pod each time. | Windows Server 2022 | Set `service.spec.sessionAffinity` to "ClientIP" |
118+
| Direct Server Return (DSR) | Load balancing mode where the IP address fixups and the LBNAT occurs at the container vSwitch port directly; service traffic arrives with the source IP set as the originating pod IP. | Windows Server 2019 | Set the following flags in kube-proxy: `--feature-gates="WinDSR=true" --enable-dsr=true` |
119+
| Preserve-Destination | Skips DNAT of service traffic, thereby preserving the virtual IP of the target service in packets reaching the backend Pod. Also disables node-node forwarding. | Windows Server, version 1903 | Set `"preserve-destination": "true"` in service annotations and enable DSR in kube-proxy. |
120+
| IPv4/IPv6 dual-stack networking | Native IPv4-to-IPv4 in parallel with IPv6-to-IPv6 communications to, from, and within a cluster | Windows Server 2019 | See [IPv4/IPv6 dual-stack](#ipv4ipv6-dual-stack) |
121+
| Client IP preservation | Ensures that source IP of incoming ingress traffic gets preserved. Also disables node-node forwarding. | Windows Server 2019 | Set `service.spec.externalTrafficPolicy` to "Local" and enable DSR in kube-proxy |
122+
{{< /table >}}
123+
124+
{{< warning >}}
125+
There are known issue with NodePort Services on overlay networking, if the destination node is running Windows Server 2022.
126+
To avoid the issue entirely, you can configure the service with `externalTrafficPolicy: Local`.
127+
128+
There are known issues with Pod to Pod connectivity on l2bridge network on Windows Server 2022 with KB5005619 or higher installed.
129+
To workaround the issue and restore Pod to Pod connectivity, you can disable the WinDSR feature in kube-proxy.
130+
131+
These issues require OS fixes.
132+
Please follow https://github.com/microsoft/Windows-Containers/issues/204 for updates.
133+
{{< /warning >}}
134+
135+
## Limitations
136+
137+
The following networking functionality is _not_ supported on Windows nodes:
138+
139+
* Host networking mode
140+
* Local NodePort access from the node itself (works for other nodes or external clients)
141+
* More than 64 backend pods (or unique destination addresses) for a single Service
142+
* IPv6 communication between Windows pods connected to overlay networks
143+
* Local Traffic Policy in non-DSR mode
144+
* Outbound communication using the ICMP protocol via the `win-overlay`, `win-bridge`, or using the Azure-CNI plugin.\
145+
Specifically, the Windows data plane ([VFP](https://www.microsoft.com/research/project/azure-virtual-filtering-platform/))
146+
doesn't support ICMP packet transpositions, and this means:
147+
* ICMP packets directed to destinations within the same network (such as pod to pod communication via ping)
148+
work as expected;
149+
* TCP/UDP packets work as expected;
150+
* ICMP packets directed to pass through a remote network (e.g. pod to external internet communication via ping)
151+
cannot be transposed and thus will not be routed back to their source;
152+
* Since TCP/UDP packets can still be transposed, you can substitute `ping <destination>` with
153+
`curl <destination>` when debugging connectivity with the outside world.
154+
155+
Other limitations:
156+
157+
* Windows reference network plugins win-bridge and win-overlay do not implement
158+
[CNI spec](https://github.com/containernetworking/cni/blob/master/SPEC.md) v0.4.0,
159+
due to a missing `CHECK` implementation.
160+
* The Flannel VXLAN CNI plugin has the following limitations on Windows:
161+
* Node-pod connectivity is only possible for local pods with Flannel v0.12.0 (or higher).
162+
* Flannel is restricted to using VNI 4096 and UDP port 4789. See the official
163+
[Flannel VXLAN](https://github.com/coreos/flannel/blob/master/Documentation/backends.md#vxlan)
164+
backend docs for more details on these parameters.

content/en/docs/concepts/storage/volumes.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,20 @@ for more information.
12401240
For more information on how to develop a CSI driver, refer to the
12411241
[kubernetes-csi documentation](https://kubernetes-csi.github.io/docs/)
12421242

1243+
#### Windows CSI proxy
1244+
1245+
{{< feature-state for_k8s_version="v1.22" state="stable" >}}
1246+
1247+
CSI node plugins need to perform various privileged
1248+
operations like scanning of disk devices and mounting of file systems. These operations
1249+
differ for each host operating system. For Linux worker nodes, containerized CSI node
1250+
node plugins are typically deployed as privileged containers. For Windows worker nodes,
1251+
privileged operations for containerized CSI node plugins is supported using
1252+
[csi-proxy](https://github.com/kubernetes-csi/csi-proxy), a community-managed,
1253+
stand-alone binary that needs to be pre-installed on each Windows node.
1254+
1255+
For more details, refer to the deployment guide of the CSI plugin you wish to deploy.
1256+
12431257
#### Migrating to CSI drivers from in-tree plugins
12441258

12451259
{{< feature-state for_k8s_version="v1.17" state="beta" >}}
@@ -1256,6 +1270,14 @@ provisioning/delete, attach/detach, mount/unmount and resizing of volumes.
12561270
In-tree plugins that support `CSIMigration` and have a corresponding CSI driver implemented
12571271
are listed in [Types of Volumes](#volume-types).
12581272

1273+
The following in-tree plugins support persistent storage on Windows nodes:
1274+
1275+
* [`awsElasticBlockStore`](#awselasticblockstore)
1276+
* [`azureDisk`](#azuredisk)
1277+
* [`azureFile`](#azurefile)
1278+
* [`gcePersistentDisk`](#gcepersistentdisk)
1279+
* [`vsphereVolume`](#vspherevolume)
1280+
12591281
### flexVolume
12601282

12611283
{{< feature-state for_k8s_version="v1.23" state="deprecated" >}}
@@ -1267,6 +1289,12 @@ volume plugin path on each node and in some cases the control plane nodes as wel
12671289
Pods interact with FlexVolume drivers through the `flexVolume` in-tree volume plugin.
12681290
For more details, see the FlexVolume [README](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-storage/flexvolume.md#readme) document.
12691291

1292+
The following FlexVolume [plugins](https://github.com/Microsoft/K8s-Storage-Plugins/tree/master/flexvolume/windows),
1293+
deployed as PowerShell scripts on the host, support Windows nodes:
1294+
1295+
* [SMB](https://github.com/microsoft/K8s-Storage-Plugins/tree/master/flexvolume/windows/plugins/microsoft.com~smb.cmd)
1296+
* [iSCSI](https://github.com/microsoft/K8s-Storage-Plugins/tree/master/flexvolume/windows/plugins/microsoft.com~iscsi.cmd)
1297+
12701298
{{< note >}}
12711299
FlexVolume is deprecated. Using an out-of-tree CSI driver is the recommended way to integrate external storage with Kubernetes.
12721300

0 commit comments

Comments
 (0)