Skip to content

Conversation

@amustaque97
Copy link
Contributor

@amustaque97 amustaque97 commented Nov 3, 2025

Related to: open-runtimes/open-runtimes#101

🎯 Overview

Adds Kubernetes support to OpenRuntimes Executor, enabling serverless functions to run as Kubernetes pods. Includes a production-ready Helm chart with RBAC, shared storage, and auto-scaling capabilities.

What's New

  • Dual Runner Support: Switch between Docker and Kubernetes via OPR_EXECUTOR_RUNNER environment variable
  • Kubernetes Runner: New Kubernetes.php runner using utopia-php/orchestration
  • Helm Chart: Complete deployment solution in deploy/ with 12 templates (Deployment, Service, Ingress, RBAC, PVC, HPA, etc.)
  • Shared Storage: ReadWriteMany PVC support
  • Makefile: 20+ targets for local development with Kind and Helm operations

Key Features

✅ Full API compatibility with Docker runner
✅ RBAC-based pod management
✅ Auto-scaling with HPA
✅ Shared storage for multi-pod function execution
✅ Local testing with Kind
✅ Zero breaking changes (backward compatible)

Files Changed

Added:

  • src/Executor/Runner/Kubernetes.php - Kubernetes runner implementation
  • deploy/ - Complete Helm chart with templates and values files
  • Makefile - Kubernetes build and deployment automation
  • test-k8s-quick.sh - API validation script (This script was used for testing purpose, after review I will be removing it.)

Modified:

  • app/http.php - Unified runner initialization
  • Dockerfile - Added kubectl and build tools
  • docker-compose.yml - Added K8s environment variables
  • README.md - Kubernetes deployment documentation

Configuration

# Enable Kubernetes runner
export OPR_EXECUTOR_RUNNER=kubernetes
export OPR_EXECUTOR_K8S_NAMESPACE=default

Quick Start

# Local deployment with Kind
make kind-full

# Production deployment
helm install executor ./deploy -f ./deploy/values-production.yaml

Testing

  • ✅ All API endpoints tested
  • ✅ RBAC permissions validated
  • ✅ Helm chart linted successfully
  • ✅ Kind local deployment verified

Breaking Changes: None
Migration Required: No (opt-in feature)
Backward Compatible: Yes

@amustaque97
Copy link
Contributor Author

CodeQL stage failure is expected because this PR utopia-php/orchestration#62 has not been merged yet. Once this is merged, we need to bump up the versions in the composer.json file. For local, I installed the dev version manually, something like below

diff --git a/composer.json b/composer.json
index a81ff0b..f7359b4 100644
--- a/composer.json
+++ b/composer.json
@@ -18,6 +18,12 @@
       "./vendor/bin/phpunit --configuration phpunit.xml --debug"
     ]
   },
+  "repositories": [
+    {
+      "type": "vcs",
+      "url": "https://github.com/amustaque97/orchestration.git"
+    }
+  ],
   "require": {
     "php": ">=8.3.0",
     "ext-curl": "*",
@@ -31,7 +37,7 @@
     "utopia-php/registry": "0.5.*",
     "utopia-php/preloader": "0.2.*",
     "utopia-php/system": "0.9.*",
-    "utopia-php/orchestration": "0.14.*",
+    "utopia-php/orchestration": "dev-k8s-adapter",
     "appwrite/php-runtimes": "0.19.*",
     "utopia-php/config": "^0.2.2"
   },

Testing Screenshot
Screenshot 2025-11-03 at 9 03 26 PM

@loks0n loks0n closed this Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants