TechBuzzPro

How to Configure Rancher for Windows

· 4 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can configure Rancher to manage Windows nodes in a Kubernetes cluster, but it requires specific setup steps and compatibility checks. This guide shows you how to integrate Windows Server nodes into a Rancher-managed Kubernetes environment using the correct versions, configurations, and networking setup. Before proceeding, ensure your Rancher server is already deployed and accessible, and you have administrative access to both Linux and Windows nodes.

What You'll Need

  • A running Rancher server (v2.6 or later recommended)
  • At least one Linux control plane node in your cluster
  • Windows Server 2019 or 2022 with containers feature enabled
  • Docker or containerd installed on Windows nodes
  • PowerShell with administrative privileges
  • Access to your cluster's kubeconfig file
  • Compatible CNI plugin (Flannel with host-gateway or VXLAN mode)
  • Network connectivity between Linux and Windows nodes

Step-by-Step

  1. Log in to your Rancher web UI and navigate to the cluster where you want to add Windows nodes. Ensure the cluster is using a compatible Kubernetes version (v1.21 or later recommended).
  2. In the cluster dashboard, go to Cluster > Tools > Drivers and verify that the Windows node driver is enabled. If not, enable it under Node Drivers.
  3. Ensure your cluster is using Flannel as the CNI plugin. In the cluster settings, confirm flannel is selected under Network Provider. Flannel must be configured in host-gw or vxlan mode to support Windows.
  4. On your Windows Server, open PowerShell as Administrator. Enable the Containers feature by running: Enable-WindowsOptionalFeature -Online -FeatureName Containers -All.
  5. Restart the Windows machine after enabling the feature.
  6. Install a container runtime. For Docker, download and run the Docker Desktop installer for Windows or use the standalone Docker Engine. Alternatively, install containerd using the official installation script from the Kubernetes documentation.
  7. After installing the container runtime, verify it's running by executing docker version or containerd --version in PowerShell.
  8. In Rancher, go to your cluster and click Cluster > Nodes > Register Node. Select Windows as the operating system.
  9. Copy the registration command displayed. It will include a PowerShell script with a token and server URL.
  10. Run the copied PowerShell command on your Windows node. This script downloads the required binaries (kubelet, kube-proxy), configures services, and registers the node with the cluster.
  11. Monitor the script output. It may take several minutes to complete. Look for messages indicating successful service registration and connection to the API server.
  12. Go back to the Rancher UI and refresh the node list. The Windows node should appear with status Active and role worker.
  13. Verify the node is ready by running: kubectl get nodes from a machine with cluster access. The Windows node should show Ready status.
  14. Test workload scheduling by deploying a sample Windows-compatible pod. Use an image like mcr.microsoft.com/windows/servercore:ltsc2019 and set nodeSelector to kubernetes.io/os: windows.
  15. Check pod logs and status with kubectl describe pod <pod-name> and kubectl logs <pod-name> to confirm it runs without errors.

Common Mistakes

  • Using an unsupported CNI plugin: Only Flannel is officially supported for Windows nodes in Rancher. Calico or other CNIs may not work.
  • Skipping container runtime installation: Windows nodes require Docker or containerd to run containerized workloads.
  • Firewall blocking traffic: Ensure ports 10250 (kubelet), 443 (API server), and Flannel VXLAN port (8472) are open between nodes.
  • Using incompatible Kubernetes versions: Older versions may lack Windows support or have bugs.
  • Running registration script without admin rights: The script must run in elevated PowerShell.

Tips

  • Use consistent time zones and synchronized clocks across all nodes to prevent certificate and authentication issues.
  • Label Windows nodes with node-role.kubernetes.io/windows=true for easier scheduling.
  • Keep Windows nodes updated with the latest patches and security fixes.
  • Use dedicated worker pools for Windows nodes to isolate workloads.
  • Monitor resource usage closely—Windows containers typically consume more memory than Linux counterparts.

Troubleshooting

If the Windows node does not register or stays in NotReady state:

  1. Check the kubelet logs on the Windows node. They are typically located in C:\var\log\kubelet.log. Look for connection errors or authentication failures.
  2. Verify network connectivity between the Windows node and the control plane. Use Test-NetConnection in PowerShell to test port access.
  3. Ensure the registration token has not expired. Generate a new one in Rancher if needed.
  4. Re-run the registration script with -Verbose to see detailed output.
  5. If using containerd, confirm the CRI plugin is enabled and configured correctly in the config.toml file.
  6. Restart the kubelet service on Windows: Restart-Service kubelet.
  7. Check Rancher server logs for any admission or certificate signing issues.
  8. Ensure the Windows node has sufficient disk space and memory.

Frequently Asked Questions

Can I run Linux and Windows workloads on the same cluster?

Yes. Rancher supports hybrid clusters with both Linux and Windows nodes. Use node selectors to schedule workloads on the correct OS.

Which Windows Server versions are supported?

Windows Server 2019 and 2022 are supported. Ensure you're using the Standard or Datacenter edition with containers feature enabled.

Do I need Docker on Windows nodes?

Yes, or containerd. Rancher requires a container runtime to run pods. Docker Desktop or standalone Docker Engine can be used.

Why is my Windows node stuck in NotReady?

This is often due to network issues, missing container runtime, or firewall rules blocking kubelet. Check kubelet logs and network connectivity.

Can I use Calico instead of Flannel?

No. As of current Rancher versions, only Flannel is supported for Windows node networking.

How do I remove a Windows node from the cluster?

Drain the node using kubectl drain <node-name>, then delete it with kubectl delete node <node-name>. Uninstall services manually if needed.