Deploying Kubernetes Resources
Assuming you have a Kubernetes cluster consisting of at least 1 master and 1 worker, you are ready to deploy Kubernetes resources.
Running a sample service
You'll be deploying a very simple PowerShell-based web service to ensure you joined the cluster successfully and our network is properly configured.
Before doing so, it is always a good idea to make sure all our nodes are healthy.
kubectl get nodes
If everything looks good, you can download and run the following service:
kubectl apply, make sure to double-check/modify the
microsoft/windowsservercore image in the sample file to a container image that is runnable by your nodes!
wget https://raw.githubusercontent.com/Microsoft/SDN/master/Kubernetes/flannel/l2bridge/manifests/simpleweb.yml -O win-webserver.yaml kubectl apply -f win-webserver.yaml watch kubectl get pods -o wide
This creates a deployment and a service. The last watch command queries the pods indefinitely to track their status; simply press
Ctrl+C to exit the
watch command when done observing.
If all went well, it is possible to:
- see 2 containers per pod under
docker pscommand on the Windows node
- see 2 pods under a
kubectl get podscommand from the Linux master
curlon the pod IPs on port 80 from the Linux master gets a web server response; this demonstrates proper node to pod communication across the network.
- ping between pods (including across hosts, if you have more than one Windows node) via
docker exec; this demonstrates proper pod-to-pod communication
curlthe virtual service IP (seen under
kubectl get services) from the Linux master and from individual pods; this demonstrates proper service to pod communication.
curlthe service name with the Kubernetes default DNS suffix, demonstrating proper service discovery.
curlthe NodePort from the Linux master or machines outside of the cluster; this demonstrates inbound connectivity.
curlexternal IPs from inside the pod; this demonstrates outbound connectivity.
Windows container hosts will not be able to access the service IP from services scheduled on them. This is a known platform limitation that will be improved in future versions to Windows Server. Windows pods are able to access the service IP however.
In this section, we covered how to schedule Kubernetes resources on Windows nodes. This concludes the guide. If there were any problems, please review the troubleshooting section:
Otherwise, you may also be interested in running Kubernetes components as Windows services: