Resources and Workflows to build & deploy Unity3D WebGL builds using
GameCI, Kubernetes and ArgoCD.
Demo site webgl-nginx.buildstar.online
Workflows:
Templates:
You will need either a Kubernetes cluster running ArgoCD and the Kubernetes Ingress-Nginx controller, a virtual machine, or a bare-metal host.
If you do not have any of those available, the following resources can guide you through using Terraform to create one using various cloud providers.
I advise using K3s as it's very easy to deploy on Bare Metal and VMs as Single-Node cluster. This example shows a minimum-viable deployment.
-
Download and install K3s
curl -sfL https://get.k3s.io | sh -
-
Wait for node to be ready
sudo k3s kubectl get node NAME STATUS ROLES AGE VERSION vm0 Ready control-plane,master 1m v1.27.4+k3s1
-
Create the deployment and expose the service with a load-balancer
sudo kubectl create -f https://raw.githubusercontent.com/buildstar-online/unity-webgl-nginx/main/kubernetes/default-k3s-deployment.yaml
-
Get the External-IP and port for the service
sudo kubectl get svc -n webgl-nginx NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE webgl-nginx-service LoadBalancer 10.43.113.106 192.168.50.101 8080:30262/TCP 22m
-
Vist the site in your browser at
http://<external-ip>:8080/
-
Cleanup
/usr/local/bin/k3s-uninstall.sh