<commit_before># Building Windows Kubernetes Binaries and deploy to an Azure storage account

## Background
Microsoft maintains a fork of the Kubernetes project at https://github.com/Azure/kubernetes which includes patches not yet included in upstream Kubernetes for release 1.7 and 1.8; these are needed for Windows containers to function. *From release 1.9, all Windows features are in upstream and Windows binaries no longer needs to be built from Azure fork.*

## Instructions
The following instructions show how to deploy the Windows Kubernetes Binaries and deploy them to an Azure Storage Account.

### Prerequisites
* Azure Storage Account and Azure Storage Container to store Windows binaries
* Access to [wincni.exe] (https://github.com/Microsoft/SDN/tree/master/Kubernetes/windows/cni) stored in a storage container. Windows CNI is a plugin that supports the Container Network Interface (CNI) network model and interfaces with the Windows Host Networking Service (HNS) to configure host networking and policy.
* Docker installed and running. MacOS users using Docker for Mac must have at [least 3GB of memory allocated to Docker](https://github.com/kubernetes/kubernetes/tree/master/build/#requirements) or building will likely fail.

[build-windows-k8s.sh](../scripts/build-windows-k8s.sh) does the following:
- Checks out the fork of Azure/kubernetes (includes Windows fixes not yet in upstream Kubernetes, needed for Windows containers to function)
- Builds kubelet.exe and kube-proxy.exe from source in a Docker container
- Downloads kubectl.exe for desired release
- Downloads [NSSM](https://nssm.cc) which is used to start kubelet and kube-proxy on Windows
- Downloads [Windows CNI](https://github.com/Microsoft/SDN/tree/master/Kubernetes/windows/cni)
- Creates an .zip archive of these Windows components
- Uploads archive to Azure Blob Storage

More information about building Kubernetes binaries from source here: https://github.com/kubernetes/kubernetes/tree/master/build/

### Set Azure Storage credentials and Container name

A storage container is used to download winnat.sys during the build phase and to upload the resulting archive artifact.
```
$ export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=MyStorageAccountName;AccountKey=..." \
AZURE_STORAGE_CONTAINER_NAME=MyStorageContainerName
```

### Run `make build-windows-k8s`

Usage: `make build-windows-k8s K8S_VERSION=1.7.4 PATCH_VERSION=1`
<commit_msg>Update windows build documentation (#2970)<commit_after># Building Windows Kubernetes Binaries and deploy to an Azure storage account

## Background
Microsoft maintains a fork of the Kubernetes project at https://github.com/Azure/kubernetes which includes patches not yet included in upstream Kubernetes for release 1.7 and 1.8; these are needed for Windows containers to function. *From release 1.9, all Windows features are in upstream and Windows binaries no longer needs to be built from Azure fork.*

## Instructions
The following instructions show how to deploy the Windows Kubernetes Binaries and deploy them to an Azure Storage Account.

### Prerequisites
* Azure Storage Account and Azure Storage Container to store Windows binaries
* Access to [wincni.exe] and [hns.psm1] (https://github.com/Microsoft/SDN/tree/master/Kubernetes/windows/). Windows CNI is a plugin that supports the Container Network Interface (CNI) network model and interfaces with the Windows Host Networking Service (HNS) to configure host networking and policy.
* Docker installed and running. MacOS users using Docker for Mac must have at [least 3GB of memory allocated to Docker](https://github.com/kubernetes/kubernetes/tree/master/build/#requirements) or building will likely fail.

[build-windows-k8s.sh](../scripts/build-windows-k8s.sh) does the following:
- Checks out the fork of Azure/kubernetes (includes Windows fixes not yet in upstream Kubernetes, needed for Windows containers to function)
- Builds kubelet.exe and kube-proxy.exe from source in a Docker container
- Downloads kubectl.exe for desired release
- Downloads [NSSM](https://nssm.cc) which is used to start kubelet and kube-proxy on Windows
- Downloads [Windows CNI exe and script] (https://github.com/Microsoft/SDN/tree/master/Kubernetes/windows/)
- Creates an .zip archive of these Windows components
- Uploads archive to Azure Blob Storage

More information about building Kubernetes binaries from source here: https://github.com/kubernetes/kubernetes/tree/master/build/

### Set Azure Storage credentials and Container name

A storage container is used to upload the resulting archive artifact.
```
$ export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=MyStorageAccountName;AccountKey=..." \
AZURE_STORAGE_CONTAINER_NAME=MyStorageContainerName
```

### Run `make build-windows-k8s`

Usage: `make build-windows-k8s K8S_VERSION=1.7.4 PATCH_VERSION=1`

{'fraction_non_alphanumeric': 0.07279771615008157, 'fraction_numerical': 0.007544861337683523, 'mean_word_length': 5.193181818181818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7304091', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1239, 'n_words': 549}