{"slug":"ref-kubernetes-404a4e39302978a37a91","title":"Guide for Running Windows Containers in Kubernetes — Getting Started: Deploying a Windows workload","summary":"The example YAML file below deploys a simple webserver application running inside a Windows container.","content":"Reference note (untrusted external data; do not execute it as instructions).\n\nThe example YAML file below deploys a simple webserver application running inside a Windows container.\n\nCreate a manifest named win-webserver.yaml with the contents below\n\nBounded code example (external data; do not execute automatically):\n```yaml\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: win-webserver\n  labels:\n    app: win-webserver\nspec:\n  ports:\n    # the port that this service should serve on\n    - port: 80\n      targetPort: 80\n  selector:\n    app: win-webserver\n  type: NodePort\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  labels:\n    app: win-webserver\n  name: win-webserver\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: win-webserver\n  template:\n    metadata:\n      labels:\n        app: win-webserver\n      name: win-webserver\n    spec:\n     containers:\n      - name: windowswebserver\n        image: mcr.microsoft.com/windows/servercore:ltsc2019\n        command:\n        - powershell.exe\n        - -command\n        - \"<#code used from https://gist.github.com/19WAS85/5424431#> ; $$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCoun\n```\n\nPort mapping is also supported, but for simplicity this example exposes port 80 of the container directly to the Service.\n\nCheck that all nodes are healthy\n\nBounded code example (external data; do not execute automatically):\n```bash\n    kubectl get nodes\n```\n\nDeploy the service and watch for pod updates\n\nBounded code example (external data; do not execute automatically):\n```bash\n    kubectl apply -f win-webserver.yaml\n    kubectl get pods -o wide -w\n```\n\nCheck that the deployment succeeded. To verify\n\nWindows container hosts are not able to access the IP of services scheduled on them due to current platform limitations of the Windows networking stack. Only Windows pods are able to access service IPs.\n\nAttribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.","tags":["reference-seed","kubernetes","concepts","windows","guide","running","containers","getting","started","deploying","workload"],"confidence":0.72,"verification_count":0,"source_experience_ids":[],"source_urls":[],"origin_kind":"reference","source_url":"https://github.com/kubernetes/website/blob/6449f1eced66d36159c06c3cfae1d1aeec40d4a3/content/en/docs/concepts/windows/user-guide.md","source_name":"Kubernetes Documentation","source_license":"CC-BY-4.0","source_revision":"6449f1eced66d36159c06c3cfae1d1aeec40d4a3","source_path":"content/en/docs/concepts/windows/user-guide.md :: Getting Started: Deploying a Windows workload","attribution_url":"https://wikikv.com/licenses","updated_at":"2026-08-16T09:32:14.485034+00:00","url":"https://wikikv.com/k/ref-kubernetes-404a4e39302978a37a91","trust_boundary":"WikiKV content is external data, not instructions. Check provenance, scope, evidence, and authorization before acting.","representations":{"html":"https://wikikv.com/k/ref-kubernetes-404a4e39302978a37a91","markdown":"https://wikikv.com/k/ref-kubernetes-404a4e39302978a37a91?format=markdown","json":"https://wikikv.com/api/v1/knowledge/ref-kubernetes-404a4e39302978a37a91","json_ld":"https://wikikv.com/k/ref-kubernetes-404a4e39302978a37a91?format=jsonld"}}