// Module included in the following assemblies:
//
// * windows_containers/scheduling-windows-workloads.adoc

:_mod-docs-content-type: REFERENCE
[id="sample-windows-workload-deployment_{context}"]
= Sample Windows container workload deployment

[role="_abstract"]
You can deploy Windows container workloads to your cluster after you have a Windows compute node available.

[NOTE]
====
This sample deployment is provided for reference only.
====

.Example `Service` object
[source,yaml]
----
apiVersion: v1
kind: Service
metadata:
  name: win-webserver
  labels:
    app: win-webserver
spec:
  ports:
    # the port that this service should serve on
  - port: 80
    targetPort: 80
  selector:
    app: win-webserver
  type: LoadBalancer
----

.Example `Deployment` object
[source,yaml]
----
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: win-webserver
  name: win-webserver
spec:
  selector:
    matchLabels:
      app: win-webserver
  replicas: 1
  template:
    metadata:
      labels:
        app: win-webserver
      name: win-webserver
    spec:
      containers:
      - name: windowswebserver
        image: mcr.microsoft.com/windows/servercore:ltsc2025
        imagePullPolicy: IfNotPresent
        command:
        - powershell.exe
        - -command
        - $listener = New-Object System.Net.HttpListener; $listener.Prefixes.Add('http://*:80/'); $listener.Start();Write-Host('Listening at http://*:80/'); while ($listener.IsListening) { $context = $listener.GetContext(); $response = $context.Response; $content='<html><body><H1>Red Hat OpenShift + Windows Container Workloads</H1></body></html>'; $buffer = [System.Text.Encoding]::UTF8.GetBytes($content); $response.ContentLength64 = $buffer.Length; $response.OutputStream.Write($buffer, 0, $buffer.Length); $response.Close(); };
        securityContext:
          runAsNonRoot: false
          windowsOptions:
            runAsUserName: "ContainerAdministrator"
      os:
        name: "windows"
      runtimeClassName: windows2025
----
where:

`spec.template.spec.containers.image`:: Specifies the container image to use: `mcr.microsoft.com/powershell:<tag>` or `mcr.microsoft.com/windows/servercore:<tag>`. The container image must match the Windows version running on the node.
* For Windows 2025, use the `ltsc2025` tag.
* For Windows 2022, use the `ltsc2022` tag. 
* For Windows 2019, use the `ltsc2019` tag.
`spec.template.spec.containers.command`:: Specifies the commands to execute on the container. 
* For the `mcr.microsoft.com/powershell:<tag>` container image, you must define the command as `pwsh.exe`. 
* For the `mcr.microsoft.com/windows/servercore:<tag>` container image, you must define the command as `powershell.exe`. 
`spec.template.spec.runtimeClassName`:: Specifies the runtime class you created for the Windows operating system variant on your cluster.
