You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Windows Server 2019上安装Kubernetes?预览版功能咨询

Windows Server 2019 Preview: Installing Native Kubernetes Support

Hey Benjamin, totally get the confusion here—when that preview dropped, Microsoft’s docs were a bit scattered, and the feature wasn’t exactly "turnkey" out of the box. Let’s break this down clearly:

First, to answer your last question: Kubernetes support was announced for Windows Server 2019, but in the early preview builds, it was a hidden technical preview feature that required manual setup—it wasn’t enabled by default, which is why you couldn’t find it right away.

Here’s a step-by-step guide that should work for your Hyper-V VM with Desktop Experience:

Prerequisites

  • Make sure your Windows Server 2019 Preview VM is running the latest preview build (Slow or Fast Ring). Run this in an elevated PowerShell to force updates:
    wuauclt /detectnow /updatenow
    
  • Enable nested virtualization on your Hyper-V VM (critical for containers/K8s to work properly). On your host machine’s PowerShell:
    Set-VMProcessor -VMName "Your VM Name" -ExposeVirtualizationExtensions $true
    
    Then restart the VM.

Step 1: Enable Required Windows Features

Open an elevated PowerShell on your VM and run these commands:

  1. Install the Containers feature:
    Install-WindowsFeature -Name Containers -IncludeManagementTools
    
  2. Enable the Kubernetes technical preview component:
    Enable-WindowsOptionalFeature -Online -FeatureName Containers-Kubernetes -All
    
  3. Restart the VM to apply changes:
    Restart-Computer -Force
    

Step 2: Initialize the Kubernetes Cluster

After the VM restarts, open another elevated PowerShell:

  1. Initialize the control plane (this sets up a single-node cluster, which was the only supported setup in early previews):
    kubeadm init --pod-network-cidr=10.244.0.0/16
    
  2. Configure kubectl for your user account:
    mkdir -p $HOME/.kube
    Copy-Item -Path /etc/kubernetes/admin.conf -Destination $HOME/.kube/config
    Set-ItemProperty -Path $HOME/.kube/config -Name IsReadOnly -Value $false
    

Step 3: Install a Pod Network Plugin

Windows nodes in early previews only supported specific network plugins—Flannel was the most reliable option:

  1. Obtain the Flannel configuration file (kube-flannel.yml) optimized for Windows nodes (this file is available in the official Flannel project resources).
  2. Apply the config to your cluster using:
    kubectl apply -f kube-flannel.yml
    
  3. Wait 5-10 minutes, then verify all pods are running:
    kubectl get pods --all-namespaces
    

Common Gotchas to Watch For

  • If you get an error that the Containers-Kubernetes feature doesn’t exist, your preview build is too old. Grab the latest Windows Server 2019 Preview ISO and redeploy your VM.
  • Early previews only supported single-node clusters. Multi-node Windows K8s support came later in the preview cycle.
  • Make sure your VM has at least 4GB of RAM—Kubernetes and containers need a decent amount of resources to run smoothly.

Hope this gets you up and running!

内容的提问来源于stack exchange,提问作者Benjamin Abt

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:18:05