All Products
Search
Document Center

Container Service for Kubernetes:Best practices for Unity remote rendering

Last Updated:Jun 25, 2026

Deploy Unity Render Streaming on ACK GPU nodes to stream real-time 3D rendering to browsers without client-side GPU hardware.

Prerequisites

Ensure that you have:

  • An ACK managed cluster with a GPU node pool

  • kubectl configured to connect to the cluster

  • Unity Editor installed locally

  • Docker installed locally to build container images

Environment used in this guide:

Component Version / specification
ACK managed cluster 1.22.3-aliyun.1
Node pool operating system Alibaba Cloud Linux 2.1903
Instance type ecs.gn6v-c8g1.2xlarge
Docker Engine 19.3.15

Step 1: Build the Unity Render Streaming application

This step uses Unity Editor 2021.3.2f1c1 for Mac M1 Silicon.

  1. In Unity Editor, open Package Manager from the top-left menu.

  2. Search for com.unity.renderstreaming@3.1.0-exp.2 and click Add.

  3. Click Yes to restart the project. After restarting, the Unity Render Streaming package appears on the Package Manager page.

    Unity Render Streaming package

  4. On the Package Manager page, scroll to Samples and click Import (1.19 MB). The Assets folder updates after importing.

    Assets

  5. Open Build Settings from the top-left menu. Set the fields as follows, then click Build and name the output mac-linux. After the build, the output directory looks like this:

    Field Value
    Platform Windows, Mac, Linux
    Target Platform Linux
    Scenes WebBrowserInput

    Build

  6. Download the official web server sample from the top-left menu. The web server handles WebSocket signaling between browsers and the Unity application's WebRTC stream. Your remote rendering application is now complete with a Unity executable and a web server binary. Other implementation options are covered in About Unity Render Streaming.

Step 2: Containerize and deploy the application

Containerize the Unity application and web server

  1. Build the Unity application image. Follow Linux graphics application best practices for containerization steps. Use a unityci/editor base image matching your Unity Editor version — available tags are on unityci/editor on Docker Hub. This guide uses ubuntu-2021.3.2f1-mac-mono-1.0.1 with additional packages: vulkan-util, libc++1, and libc++abi1.

  2. Build the web server image. Use the following Dockerfile:

    FROM ubuntu:20.04
    WORKDIR /run
    COPY webserver ./
    CMD webserver -w

Deploy to ACK

  1. Create a file named unity-demo.yaml with the following content:

    apiVersion: v1
    kind: Pod
    metadata:
      name: unity-demo
      namespace: default
    spec:
      # The Linux web server sample binds WebSocket to 127.0.0.1 only.
      # Use host network mode so browsers can reach it through the node's EIP.
      hostNetwork: true
      nodeName: <your-gpu-node-name>
      containers:
      - image: <your-unity-image>:<tag>
        name: unity
        command: ["/run/mac-linux/mac-linux.x86_64"]
        securityContext:
          # privileged: true is required for the Unity process to access
          # the GPU device on the host.
          privileged: true
      - image: <your-webserver-image>:<tag>
        name: webserver
        ports:
        - containerPort: 80
          protocol: TCP
      restartPolicy: Always

    Both containers share the Pod network namespace. Unity connects to the web server at 127.0.0.1:80 via WebSocket; the web server accepts browser connections on port 80.

    Key fields explained:

    • hostNetwork: true — The web server sample binds to 127.0.0.1 only. Host network mode makes it reachable via the node's elastic IP address (EIP).

    • privileged: true — Required for the Unity container to access the host GPU.

    • nodeName — Pins the Pod to a specific GPU node. Replace <your-gpu-node-name> with your node name.

  2. Apply the manifest:

    kubectl apply -f unity-demo.yaml
  3. Verify the Pod is running:

    kubectl get pod unity-demo

    Expected output:

    NAME         READY   STATUS    RESTARTS   AGE
    unity-demo   2/2     Running   0          30s

    If the Pod is not running, check the container logs:

    kubectl logs unity-demo -c unity
    kubectl logs unity-demo -c webserver

Step 3: Access the remote rendering stream

Connection path:

Browser -> EIP (port 80) -> web server (WebSocket signaling) -> Unity application (WebRTC stream)

In your browser, go to EIP:80. Click VideoPlayer Sample to start the stream.

Demo video

Stream quality depends on network stability.