Skip to content

Commit 7d6c4a1

Browse files
committed
Update docs for windows container resources
1 parent f5b6cb3 commit 7d6c4a1

File tree

1 file changed

+71
-20
lines changed
  • docs/getting-started-guides/windows

1 file changed

+71
-20
lines changed

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

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

1919
## Build
20-
We recommend using the release binaries that can be found at [https://github.com/kubernetes/kubernetes/releases](https://github.com/kubernetes/kubernetes/releases). Look for the Node Binaries section by visiting the binary downloads link.
20+
We recommend using the release binaries that can be found at [https://github.com/kubernetes/kubernetes/releases](https://github.com/kubernetes/kubernetes/releases). Look for the Node Binaries section by visiting the binary downloads link.
2121

2222
If you wish to build the code yourself, please follow the next instructions:
2323

2424
1. Install the pre-requisites on a Linux host:
2525

2626
```
2727
sudo apt-get install curl git build-essential docker.io conntrack
28-
```
28+
```
2929
2. Run the following commands to build kubelet and kube-proxy:
3030
3131
```bash
3232
K8SREPO="github.com/kubernetes/kubernetes"
3333
go get -d $K8SREPO
34-
# Note: the above command may spit out a message about
34+
# Note: the above command may spit out a message about
3535
# "no Go files in...", but it can be safely ignored!
3636
3737
cd $GOPATH/src/k8s.io/kubernetes
@@ -56,7 +56,7 @@ In Kubernetes version 1.9 or later, Windows Server Containers for Kubernetes are
5656

5757
## Networking
5858
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.
59-
59+
6060
1. [Upstream L3 Routing](#upstream-l3-routing-topology) - IP routes configured in upstream ToR
6161
2. [Host-Gateway](#host-gateway-topology) - IP routes configured on each host
6262
3. [Open vSwitch (OVS) & Open Virtual Network (OVN) with Overlay](#using-ovn-with-ovs) - overlay networks (supports STT and Geneve tunneling types)
@@ -72,7 +72,7 @@ An additional two CNI plugins [win-l2bridge (host-gateway) and win-overlay (vxla
7272
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.
7373

7474
### Windows
75-
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.
75+
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.
7676

7777
#### Upstream L3 Routing Topology
7878
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.
@@ -92,7 +92,7 @@ The following diagram gives a general overview of the architecture and interacti
9292

9393
(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))
9494

95-
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.
95+
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.
9696

9797
## Setting up Windows Server Containers on Kubernetes
9898
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.
@@ -103,7 +103,7 @@ To run Windows Server Containers on Kubernetes, you'll need to set up both your
103103

104104
##### Linux Host Setup
105105

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

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

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

122-
**Windows CNI Config Example**
122+
**Windows CNI Config Example**
123123
Today, Windows CNI plugin is based on wincni.exe code with the following example, configuration file.
124124

125125
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
@@ -287,7 +287,7 @@ Because your cluster has both Linux and Windows nodes, you must explicitly set t
287287
```
288288
## Support for kubeadm join
289289

290-
If your cluster has been created by [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/),
290+
If your cluster has been created by [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/),
291291
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.
292292

293293
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:
@@ -313,9 +313,9 @@ Secrets and ConfigMaps can be utilized in Windows Server Containers, but must be
313313
data:
314314
username: YWRtaW4=
315315
password: MWYyZDFlMmU2N2Rm
316-
316+
317317
---
318-
318+
319319
apiVersion: v1
320320
kind: Pod
321321
metadata:
@@ -338,7 +338,7 @@ Secrets and ConfigMaps can be utilized in Windows Server Containers, but must be
338338
nodeSelector:
339339
beta.kubernetes.io/os: windows
340340
```
341-
341+
342342
Windows pod with configMap values mapped to environment variables
343343
344344
```yaml
@@ -374,14 +374,14 @@ spec:
374374
nodeSelector:
375375
beta.kubernetes.io/os: windows
376376
```
377-
377+
378378
### Volumes
379379
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"`.
380380

381381
Persistent Volume Claims are supported for supported volume types.
382382

383383
**Examples:**
384-
384+
385385
Windows pod with a hostPath volume
386386
```yaml
387387
apiVersion: v1
@@ -403,9 +403,9 @@ Persistent Volume Claims are supported for supported volume types.
403403
hostPath:
404404
path: "C:\\etc\\foo"
405405
```
406-
406+
407407
Windows pod with multiple emptyDir volumes
408-
408+
409409
```yaml
410410
apiVersion: v1
411411
kind: Pod
@@ -428,18 +428,69 @@ Persistent Volume Claims are supported for supported volume types.
428428
nodeSelector:
429429
beta.kubernetes.io/os: windows
430430
```
431-
431+
432432
### Metrics
433433

434434
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 datastructures using windows specific perf counters from the node.
435435

436+
### Container Resources
437+
438+
Container resources (CPU and memory) could be set now for windows containers in v1.10.
439+
440+
```yaml
441+
apiVersion: extensions/v1beta1
442+
kind: Deployment
443+
metadata:
444+
name: iis
445+
spec:
446+
replicas: 3
447+
template:
448+
metadata:
449+
labels:
450+
app: iis
451+
spec:
452+
containers:
453+
- name: iis
454+
image: microsoft/iis
455+
resources:
456+
limits:
457+
memory: "128Mi"
458+
cpu: 2
459+
ports:
460+
- containerPort: 80
461+
```
462+
463+
### Hyper-V Containers
464+
465+
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`.
466+
467+
```yaml
468+
apiVersion: extensions/v1beta1
469+
kind: Deployment
470+
metadata:
471+
name: iis
472+
spec:
473+
replicas: 3
474+
template:
475+
metadata:
476+
labels:
477+
app: iis
478+
annotations:
479+
experimental.windows.kubernetes.io/isolation-type: hyperv
480+
spec:
481+
containers:
482+
- name: iis
483+
image: microsoft/iis
484+
ports:
485+
- containerPort: 80
486+
```
487+
436488
## Known Limitations for Windows Server Containers with v1.9
437489
Some of these limitations will be addressed by the community in future releases of Kubernetes
438490
- Shared network namespace (compartment) with multiple Windows Server containers (shared kernel) per pod is only supported on Windows Server 1709 or later
439-
- Using Secrets and ConfigMaps as volume mounts is not supported
491+
- Using Secrets and ConfigMaps as volume mounts is not supported
440492
- The StatefulSet functionality for stateful applications is not supported
441493
- Horizontal Pod Autoscaling for Windows Server Container pods has not been verified to work end-to-end
442-
- Hyper-V Containers are not supported
443494

444495

445-
> As of this writing, the Kube-proxy binary requires a pending Kubernetes [pull request](https://github.com/kubernetes/kubernetes/pull/56529) to work properly. You may need to [build](#build) the binaries manually to work around this.
496+
> As of this writing, the Kube-proxy binary requires a pending Kubernetes [pull request](https://github.com/kubernetes/kubernetes/pull/56529) to work properly. You may need to [build](#build) the binaries manually to work around this.

0 commit comments

Comments
 (0)