Project details
KubeSilicon enables running Linux virtual machines from Kubernetes objects on Apple Silicon Macs, utilizing the Virtualization.framework in place of KVM. This solution supports GPU jobs for machine learning tasks, providing an efficient way to leverage Apple's hardware capabilities for Kubernetes workloads.
KubeSilicon provides a powerful solution for running Linux virtual machines (VMs) on Apple Silicon Macs using Kubernetes objects in a manner similar to KubeVirt on Linux. By leveraging Apple's Virtualization.framework, KubeSilicon allows users to define and manage Linux VMs and execute GPU jobs directly on macOS, facilitating seamless integration with cloud-native workflows. This project primarily targets developers and data scientists who utilize Apple Silicon for machine learning and other computational tasks.
Linux VM Deployment: Utilize Kubernetes Custom Resource Definitions (CRDs) to declare SiliconVM objects for effortless VM management. Each VM can be controlled via API calls and integrates smoothly into local Kubernetes clusters such as kind running on Docker Desktop.
Native GPU Computing: A dedicated SiliconJob resource enables the execution of Python scripts utilizing the Mac's GPU (with support for PyTorch MPS or MLX), making it an ideal environment for machine learning workloads. The capability to run GPU jobs natively ensures high performance and efficiency.
KubeSilicon operates by monitoring SiliconVM objects through a daemon (kubesilicond) running on macOS. It manages the lifecycle of VMs, handles image downloads, and provides networking capabilities to ensure pods in the Kubernetes cluster can interact with the VMs. The architecture is illustrated below:
kind (Docker Desktop VM) macOS host
┌──────────────────────┐ ┌────────────────────────────────────┐
│ SiliconVM objects │◄─ API watch ─┤ kubesilicond │
│ (CRD kubesilicon.io) │── status ───►│ download + convert image │
│ │ │ cloud-init ISO │
│ pod ──────── ping/ssh ─────────────►│ Virtualization.framework ──► VM │
└──────────────────────┘ └────────────────────────────────────┘
To create a Linux VM using KubeSilicon, define the VM specifications in a YAML file (vm.yaml):
apiVersion: kubesilicon.io/v1
kind: SiliconVM
metadata: { name: demo }
spec:
cpu: 2
memory: 2Gi
disk:
source: https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-arm64.img
size: 10Gi
cloudInit:
userData: |
#cloud-config
users:
- name: ubuntu
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys: [ssh-ed25519 AAAA... you@host]
Then deploy the VM using:
kubectl apply -f vm.yaml
kubectl get svm -w # Watch the VM state
You can access the VM via SSH using the command:
./bin/kubesilicon -context kind-<your-cluster> ssh demo
KubeSilicon also supports integration with Kubeflow Pipelines, enabling users to define workflows that leverage both Kubernetes and local GPU resources for effective model training and evaluation.
KubeSilicon is in the early stages of development and has been validated end-to-end on a single Mac with a kind cluster. The API versioning is under development, and enhancements are expected in future releases. As it stands, KubeSilicon is not intended for production use.
For detailed documentation, validations, benchmarks, and development information, please refer to the repository and its accompanying README.
Comments
0Start the conversation
Share the first comment.