Skip to content

Commit 1059ce1

Browse files
committed
Update docs for windows container resources
1 parent 5829739 commit 1059ce1

File tree

1 file changed

+67
-16
lines changed
  • docs/getting-started-guides/windows

1 file changed

+67
-16
lines changed

docs/getting-started-guides/windows/index.md

+67-16
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Kubernetes control plane (API Server, Scheduler, Controller Manager, etc) co
1717
{: .note}
1818

1919
## Get Windows Binaries
20-
We recommend using the release binaries that can be found at [https://github.com/kubernetes/kubernetes/releases/latest](https://github.com/kubernetes/kubernetes/releases/latest). Under the CHANGELOG you can find the Node Binaries link for Windows-amd64, which will include kubeadm, kubectl, kubelet and kube-proxy.
20+
We recommend using the release binaries that can be found at [https://github.com/kubernetes/kubernetes/releases/latest](https://github.com/kubernetes/kubernetes/releases/latest). Under the CHANGELOG you can find the Node Binaries link for Windows-amd64, which will include kubeadm, kubectl, kubelet and kube-proxy.
2121

2222
If you wish to build the code yourself, please refer to detailed build instructions [here](https://docs.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/compiling-kubernetes-binaries).
2323

@@ -31,7 +31,7 @@ In Kubernetes version 1.9 or later, Windows Server Containers for Kubernetes are
3131

3232
## Networking
3333
There are several supported network configurations with Kubernetes v1.9 on Windows, including both Layer-3 routed and overlay topologies using third-party network plugins.
34-
34+
3535
1. [Upstream L3 Routing](#upstream-l3-routing-topology) - IP routes configured in upstream ToR
3636
2. [Host-Gateway](#host-gateway-topology) - IP routes configured on each host
3737
3. [Open vSwitch (OVS) & Open Virtual Network (OVN) with Overlay](#using-ovn-with-ovs) - overlay networks (supports STT and Geneve tunneling types)
@@ -47,7 +47,7 @@ An additional two CNI plugins [win-l2bridge (host-gateway) and win-overlay (vxla
4747
The above networking approaches are already supported on Linux using a bridge interface, which essentially creates a private network local to the node. Similar to the Windows side, routes to all other pod CIDRs must be created in order to send packets via the "public" NIC.
4848

4949
### Windows
50-
Windows supports the CNI network model and uses plugins to interface with the Windows Host Networking Service (HNS) to configure host networking and policy. At the time of this writing, the only publicly available CNI plugin from Microsoft is built from a private repo and available here [wincni.exe](https://github.com/Microsoft/SDN/blob/master/Kubernetes/windows/cni/wincni.exe). It uses an l2bridge network created through the Windows Host Networking Service (HNS) by an administrator using HNS PowerShell commands on each node as documented in the [Windows Host Setup](#windows-host-setup) section below. Source code for the future CNI plugins will be made available publicly.
50+
Windows supports the CNI network model and uses plugins to interface with the Windows Host Networking Service (HNS) to configure host networking and policy. At the time of this writing, the only publicly available CNI plugin from Microsoft is built from a private repo and available here [wincni.exe](https://github.com/Microsoft/SDN/blob/master/Kubernetes/windows/cni/wincni.exe). It uses an l2bridge network created through the Windows Host Networking Service (HNS) by an administrator using HNS PowerShell commands on each node as documented in the [Windows Host Setup](#windows-host-setup) section below. Source code for the future CNI plugins will be made available publicly.
5151

5252
#### Upstream L3 Routing Topology
5353
In this topology, networking is achieved using L3 routing with static IP routes configured in an upstream Top of Rack (ToR) switch/router. Each cluster node is connected to the management network with a host IP. Additionally, each node uses a local 'l2bridge' network with a pod CIDR assigned. All pods on a given worker node will be connected to the pod CIDR subnet ('l2bridge' network). In order to enable network communication between pods running on different nodes, the upstream router has static routes configured with pod CIDR prefix => Host IP.
@@ -65,7 +65,7 @@ The following diagram gives a general overview of the architecture and interacti
6565

6666
(The above image is from [https://github.com/openvswitch/ovn-kubernetes#overlay-mode-architecture-diagram](https://github.com/openvswitch/ovn-kubernetes#overlay-mode-architecture-diagram))
6767

68-
Due to its architecture, OVN has a central component which stores your networking intent in a database. Other components i.e. kube-apiserver, kube-controller-manager, kube-scheduler etc. can be deployed on that central node as well.
68+
Due to its architecture, OVN has a central component which stores your networking intent in a database. Other components i.e. kube-apiserver, kube-controller-manager, kube-scheduler etc. can be deployed on that central node as well.
6969

7070
## Setting up Windows Server Containers on Kubernetes
7171
To run Windows Server Containers on Kubernetes, you'll need to set up both your host machines and the Kubernetes node components for Windows. Depending on your network topology, routes may need to be set up for pod communication on different nodes.
@@ -76,7 +76,7 @@ To run Windows Server Containers on Kubernetes, you'll need to set up both your
7676

7777
##### Linux Host Setup
7878

79-
1. Linux hosts should be setup according to their respective distro documentation and the requirements of the Kubernetes version you will be using.
79+
1. Linux hosts should be setup according to their respective distro documentation and the requirements of the Kubernetes version you will be using.
8080
2. Configure Linux Master node using steps [here](https://github.com/MicrosoftDocs/Virtualization-Documentation/blob/live/virtualization/windowscontainers/kubernetes/creating-a-linux-master.md)
8181
3. [Optional] CNI network plugin installed.
8282

@@ -92,7 +92,7 @@ To run Windows Server Containers on Kubernetes, you'll need to set up both your
9292

9393
More detailed instructions can be found [here](https://github.com/MicrosoftDocs/Virtualization-Documentation/blob/live/virtualization/windowscontainers/kubernetes/getting-started-kubernetes-windows.md).
9494

95-
**Windows CNI Config Example**
95+
**Windows CNI Config Example**
9696
Today, Windows CNI plugin is based on wincni.exe code with the following example, configuration file. This is based on the ToR example diagram shown above, specifying the configuration to apply to Windows node-1. Of special interest is Windows node-1 pod CIDR (10.10.187.64/26) and the associated gateway of cbr0 (10.10.187.66). The exception list is specifying the Service CIDR (11.0.0.0/8), Cluster CIDR (10.10.0.0/16), and Management (or Host) CIDR (10.127.132.128/25).
9797

9898
Note: this file assumes that a user previous created 'l2bridge' host networks on each Windows node using `<Verb>-HNSNetwork` cmdlets as shown in the `start-kubelet.ps1` and `start-kubeproxy.ps1` scripts linked above
@@ -229,7 +229,7 @@ Use your preferred method to start Kubernetes cluster on Linux. Please note that
229229

230230
## Support for kubeadm join
231231

232-
If your cluster has been created by [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/),
232+
If your cluster has been created by [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/),
233233
and your networking is setup correctly using one of the methods listed above (networking is setup outside of kubeadm), you can use kubeadm to add a Windows node to your cluster. At a high level, you first have to initialize the master with kubeadm (Linux), then set up the CNI based networking (outside of kubeadm), and finally start joining Windows or Linux worker nodes to the cluster. For additional documentation and reference material, visit the kubeadm link above.
234234

235235
The kubeadm binary can be found at [Kubernetes Releases](https://github.com/kubernetes/kubernetes/releases), inside the node binaries archive. Adding a Windows node is not any different than adding a Linux node:
@@ -290,9 +290,9 @@ Secrets and ConfigMaps can be utilized in Windows Server Containers, but must be
290290
data:
291291
username: YWRtaW4=
292292
password: MWYyZDFlMmU2N2Rm
293-
293+
294294
---
295-
295+
296296
apiVersion: v1
297297
kind: Pod
298298
metadata:
@@ -315,7 +315,7 @@ Secrets and ConfigMaps can be utilized in Windows Server Containers, but must be
315315
nodeSelector:
316316
beta.kubernetes.io/os: windows
317317
```
318-
318+
319319
Windows pod with configMap values mapped to environment variables
320320
321321
```yaml
@@ -351,14 +351,14 @@ spec:
351351
nodeSelector:
352352
beta.kubernetes.io/os: windows
353353
```
354-
354+
355355
### Volumes
356356
Some supported Volume Mounts are local, emptyDir, hostPath. One thing to remember is that paths must either be escaped, or use forward slashes, for example `mountPath: "C:\\etc\\foo"` or `mountPath: "C:/etc/foo"`.
357357

358358
Persistent Volume Claims are supported for supported volume types.
359359

360360
**Examples:**
361-
361+
362362
Windows pod with a hostPath volume
363363
```yaml
364364
apiVersion: v1
@@ -380,9 +380,9 @@ Persistent Volume Claims are supported for supported volume types.
380380
hostPath:
381381
path: "C:\\etc\\foo"
382382
```
383-
383+
384384
Windows pod with multiple emptyDir volumes
385-
385+
386386
```yaml
387387
apiVersion: v1
388388
kind: Pod
@@ -434,14 +434,65 @@ spec:
434434

435435
Windows Stats use a hybrid model: pod and container level stats come from CRI (via dockershim), while node level stats come from the "winstats" package that exports cadvisor like data structures using windows specific perf counters from the node.
436436

437+
### Container Resources
438+
439+
Container resources (CPU and memory) could be set now for windows containers in v1.10.
440+
441+
```yaml
442+
apiVersion: apps/v1
443+
kind: Deployment
444+
metadata:
445+
name: iis
446+
spec:
447+
replicas: 3
448+
template:
449+
metadata:
450+
labels:
451+
app: iis
452+
spec:
453+
containers:
454+
- name: iis
455+
image: microsoft/iis
456+
resources:
457+
limits:
458+
memory: "128Mi"
459+
cpu: 2
460+
ports:
461+
- containerPort: 80
462+
```
463+
464+
### Hyper-V Containers
465+
466+
Hyper-V containers are supported as experimental in v1.10. To create a Hyper-V container, kubelet should be started with feature gates `HyperVContainer=true` and Pod should include annotation `experimental.windows.kubernetes.io/isolation-type=hyperv`.
467+
468+
```yaml
469+
apiVersion: apps/v1
470+
kind: Deployment
471+
metadata:
472+
name: iis
473+
spec:
474+
replicas: 3
475+
template:
476+
metadata:
477+
labels:
478+
app: iis
479+
annotations:
480+
experimental.windows.kubernetes.io/isolation-type: hyperv
481+
spec:
482+
containers:
483+
- name: iis
484+
image: microsoft/iis
485+
ports:
486+
- containerPort: 80
487+
```
488+
437489
## Known Limitations for Windows Server Containers with v1.9
438490
Some of these limitations will be addressed by the community in future releases of Kubernetes
439491
- Shared network namespace (compartment) with multiple Windows Server containers (shared kernel) per pod is only supported on Windows Server 1709 or later
440-
- Using Secrets and ConfigMaps as volume mounts is not supported
492+
- Using Secrets and ConfigMaps as volume mounts is not supported
441493
- Mount propagation is not supported on Windows
442494
- The StatefulSet functionality for stateful applications is not supported
443495
- Horizontal Pod Autoscaling for Windows Server Container pods has not been verified to work end-to-end
444-
- Hyper-V isolated containers are not supported.
445496
- Windows container OS must match the Host OS. If it does not, the pod will get stuck in a crash loop.
446497
- Under the networking models of L3 or Host GW, Kubernetes Services are inaccessible to Windows nodes due to a Windows issue. This is not an issue if using OVN/OVS for networking.
447498
- Windows kubelet.exe may fail to start when running on Windows Server under VMware Fusion [issue 57110](https://github.com/kubernetes/kubernetes/pull/57124)

0 commit comments

Comments
 (0)