System Architecture - Kubectl-Ops Cli Guide Table of Contents Introduction System Architecture Components and Tools Installation and Setup User Management Daily Operations Troubleshooting
- Introduction {#introduction} OpenServerless is an open source platform for serverless computing that offers a flexible and portable alternative to proprietary cloud provider solutions (AWS Lambda, Azure Functions, Google Cloud Functions).
Key Features Fully Open Source: Completely open and modifiable code Portability: Avoids vendor lock-in, deploy anywhere Kubernetes-Based: Leverages the cloud-native ecosystem Self-Hosted: Complete control over data and infrastructure Multi-Runtime Compatibility: Supports multiple programming languages 2. System Architecture {#architecture} Technology Stack ┌─────────────────────────────────────────┐ │ CLI Tools (ops, kubectl) │ │ User Interface │ └─────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────┐ │ Docker Desktop │ │ (Container Runtime + Kubernetes) │ └─────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────┐ │ Kubernetes Cluster │ │ • Container Orchestration │ │ • Resource Management │ │ • Networking and Storage │ └─────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────┐ │ OpenServerless Platform │ │ • Controller │ │ • API Gateway │ │ • Function Runtime │ │ • Database (CouchDB) │ │ • Optional: Redis, MongoDB, MinIO │ └─────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────┐ │ Exposed Services │ │ • REST API │ │ • Web UI │ │ • Authentication │ └─────────────────────────────────────────┘ Dependency Flow Without Docker Desktop:
❌ Kubernetes unavailable ❌ OpenServerless cannot start ❌ REST APIs inaccessible ❌ Web UI not working ✅ Only CLI tools available (local commands) With Docker Desktop Active:
✅ Kubernetes operational ✅ OpenServerless deployed ✅ REST APIs available ✅ Web UI accessible ✅ Authentication working 3. Components and Tools {#components} kubectl What it does:
Command-line client for Kubernetes Manages native K8s resources (pods, services, secrets, namespaces) Operates at low infrastructure level Essential Commands:
kubectl get nodes
kubectl get namespaces
kubectl get pods --all-namespaces
kubectl get all -n
kubectl get secrets -n
kubectl logs -n
kubectl edit secret -n
kubectl config view kubectl config current-context kubectl config get-contexts ops CLI What it does:
OpenServerless-specific CLI Simplifies complex operations Operates at high application level Uses kubectl behind the scenes Essential Commands:
ops -version ops -info ops -help ops -tasks
ops setup prereq # Validate prerequisites ops setup cluster # Deploy on existing cluster ops setup devcluster # Create local dev cluster ops setup mini # Deploy slim version ops setup status # Check status ops setup uninstall # Uninstall
ops -config # Manage configuration
ops -login
ops admin adduser [options] ops admin deleteuser ops admin listuser [] ops admin usage
ops action list ops action create ops action update ops action delete ops action invoke
ops package list ops trigger list ops rule list
ops activations list ops logs ops result Relationship between kubectl and ops ops admin adduser mario [email protected] Pass123 --all ↓ (internally executes) ↓ kubectl create namespace mario kubectl create secret generic mario-auth ... kubectl apply -f mario-redis-deployment.yaml kubectl apply -f mario-mongodb-deployment.yaml kubectl apply -f mario-storage-pvc.yaml ... When to use what:
ops: Standard and simplified operations on OpenServerless kubectl: Debug, manual modifications, operations not supported by ops (e.g., password change) 4. Installation and Setup {#installation} Prerequisites System:
Docker Desktop with at least 6GB RAM 20GB+ available disk space Verify installations:
docker --version docker ps
kubectl version --client kubectl get nodes
ops -version ops -info OpenServerless Setup Option 1: Mini Setup (Lightweight Local)
ops setup mini
Access: http://devel.miniops.me
Option 2: Cluster Setup (Docker Desktop)
kubectl get nodes
ops setup prereq
ops setup cluster
ops setup status
kubectl get pods --all-namespaces Option 3: Dev Cluster
ops setup devcluster Verify Installation
kubectl get namespaces
kubectl get pods -n nuvolaris
kubectl get services -n nuvolaris
ops -config 5. User Management {#user-management} Basic Concept In OpenServerless: Users = Namespaces
Each user has their own isolated Kubernetes namespace User services run in their namespace Complete isolation between users Creating a User
ops admin adduser
ops admin adduser mario [email protected] Pass123! --all --storagequota=auto
ops admin adduser luigi [email protected] Pass456! --redis --mongodb --minio
ops admin adduser peach [email protected] Pass789! --all --storagequota=10G Available service options:
--all: Enable all services --redis: In-memory key-value database --mongodb: NoSQL document-oriented database --minio: S3-compatible object storage --postgres: Relational database --milvus: Vector database for AI/ML --storagequota=: Storage quota (e.g., 10G) or auto Listing Users
ops admin listuser
ops admin listuser mario
kubectl get namespaces Deleting a User
ops admin deleteuser mario
kubectl get namespace mario
Changing User Password Problem: ops has no direct command to change password.
Solution 1: Via kubectl (Recommended)
kubectl get secrets -n mario
kubectl get secrets -n mario -o yaml
kubectl get secret mario-auth -n mario -o yaml
echo -n "NewPassword123!" | base64
kubectl edit secret mario-auth -n mario
Solution 2: Recreate user (Data Loss!)
ops admin deleteuser mario
ops admin adduser mario [email protected] NewPass! --all --storagequota=auto Monitoring User Resources
ops admin usage
ops admin usage --debug
kubectl get all -n mario
kubectl get pods -n mario
kubectl logs -n mario 6. Daily Operations {#operations} Login and Authentication
ops -login http://miniops.me mario
ops -login https://my-openserverless.com mario
export OPS_APIHOST=http://miniops.me export OPS_USER=mario export OPS_PASSWORD=Pass123! ops -login Managing Actions (Serverless Functions) Creating an Action
ops action create hello <(echo 'function main() { return {body: "Hello World!"}; }') --kind nodejs:default
echo 'function main(params) { return {greeting: "Hello " + params.name}; }' > hello.js
ops action create hello hello.js --kind nodejs:default
echo 'def main(args): name = args.get("name", "stranger") return {"greeting": f"Hello {name}"} ' > hello.py
ops action create hello-py hello.py --kind python:default Invoking an Action
ops invoke hello
ops invoke hello name=Mario
ops invoke hello --result
ops invoke hello --async Managing Actions
ops action list
ops action get hello
ops action update hello hello-v2.js
ops action delete hello
ops url hello Logs and Debugging
ops activations list
ops logs
ops result
ops activations poll Packages (Action Grouping)
ops package create mypackage
ops package list
ops action create mypackage/hello hello.js
ops invoke mypackage/hello
ops package delete mypackage Triggers and Rules
ops trigger create mytrigger
ops rule create myrule mytrigger hello
ops trigger list ops rule list
ops trigger fire mytrigger name=Mario
ops rule delete myrule ops trigger delete mytrigger 7. Troubleshooting {#troubleshooting} Common Problems
- Connection Refused Symptom:
error: dial tcp 127.0.0.1:6443: connect: connection refused Cause: Docker Desktop / Kubernetes not started
Solution:
kubectl get nodes 2. OpenServerless Not Responding Symptom:
error: Post "http://miniops.me/api/v1/...": connection refused Cause: OpenServerless not deployed or not active
Solution:
kubectl get pods --all-namespaces
ops setup cluster
ops setup status 3. User Cannot Log In Possible causes:
Wrong password User not created correctly User services not active Solution:
ops admin listuser mario
kubectl get namespace mario
kubectl get pods -n mario
kubectl get secrets -n mario
ops admin deleteuser mario ops admin adduser mario [email protected] NewPass! --all 4. Action Won't Start Debug:
ops action list
ops action get
ops activations list ops logs
kubectl get pods -n kubectl logs -n 5. Storage Quota Exceeded Check:
ops admin usage
ops admin usage --debug Solution:
Increase user quota (recreate user with higher quota) Clean old data Compact database: ops admin compact Complete Reset If nothing works:
ops -reset
ops setup uninstall
ops setup prereq ops setup cluster Useful Diagnostic Commands
ops -info kubectl version docker version
kubectl get nodes kubectl get namespaces kubectl get pods --all-namespaces kubectl get services --all-namespaces
ops setup status ops -config
kubectl logs -n nuvolaris kubectl describe pod -n nuvolaris
kubectl get events --all-namespaces --sort-by='.lastTimestamp'
kubectl top nodes kubectl top pods --all-namespaces Quick Command Reference Initial Setup ops setup prereq # Validate prerequisites ops setup cluster # Install OpenServerless ops setup status # Verify installation User Management ops admin adduser --all ops admin listuser ops admin deleteuser Login and Usage ops -login http://miniops.me ops action create ops invoke ops action list Debug kubectl get pods --all-namespaces kubectl logs -n ops activations list ops logs Resources Official Documentation: https://openserverless.apache.org GitHub Repository: https://github.com/apache/openserverless Task Repository: https://github.com/apache/openserverless-task Community Support: GitHub Issues Guide created based on practical experience with OpenServerless 0.1.0