deploy/helm/opensandbox/scripts/README.md
This directory contains utility scripts for OpenSandbox Controller deployment and testing.
Interactive installation of OpenSandbox Controller to Kubernetes cluster.
Features:
Usage:
cd scripts
./install.sh
Environment Variables:
IMAGE_REPO - Override controller image repositoryIMAGE_TAG - Override controller image tagSERVER_IMAGE_REPO - Override server image repositorySERVER_IMAGE_TAG - Override server image tagExample:
# Using custom images
IMAGE_REPO=myregistry.com/controller \
IMAGE_TAG=v1.0.0 \
SERVER_IMAGE_REPO=myregistry.com/server \
SERVER_IMAGE_TAG=v0.1.0 \
./install.sh
Uninstall OpenSandbox Controller and clean up related resources.
Features:
Usage:
cd scripts
./uninstall.sh
Environment Variables:
RELEASE_NAME - Release name (default: opensandbox-controller)NAMESPACE - Namespace (default: opensandbox)Example:
# Uninstall specific release
RELEASE_NAME=my-release NAMESPACE=my-namespace ./uninstall.sh
Execute complete end-to-end test workflow.
Test Workflow:
Features:
Usage:
cd scripts
./e2e-test.sh [VALUES_FILE]
# Using default values-e2e.yaml
./e2e-test.sh
# Using custom values file
./e2e-test.sh custom-values.yaml
Prerequisites:
All scripts automatically detect whether sudo privileges are required to execute kubectl and helm commands.
Scripts use relative paths to locate the Chart directory and can be invoked from any location:
# From chart root directory
./scripts/install.sh
# From scripts directory
cd scripts
./install.sh
# From other directory
/path/to/opensandbox-controller/scripts/install.sh
Scripts use ANSI color codes to enhance readability:
All scripts use set -e, exiting immediately on errors. The e2e-test.sh uses trap to ensure cleanup functions execute on exit.
Issue: Cannot connect to Kubernetes cluster
# Check kubeconfig
kubectl cluster-info
# Check context
kubectl config current-context
Issue: Chart validation fails
# Manual validation
helm lint ../
Issue: Resources are still running
# View all BatchSandbox
kubectl get batchsandboxes -A
# View all Pool
kubectl get pools -A
# Delete all resources
kubectl delete batchsandboxes --all -A
kubectl delete pools --all -A
Issue: Port-forward fails
# Check if any process is using port 8080
lsof -i :8080
# Manual port-forward test
kubectl port-forward -n opensandbox svc/opensandbox-controller-server 8080:8080
Issue: SDK test fails
# Check Server logs
kubectl logs -n opensandbox -l app.kubernetes.io/component=server
# Check Pool Pod logs
kubectl logs -n opensandbox -l pool=agent-pool
# Test Server API
curl http://localhost:8080/health
Issue: Image not found
# Check if images are loaded
docker images | grep opensandbox
# Reload images
docker load -i /path/to/image.tar
After modifying scripts, ensure:
New scripts should follow these conventions:
#!/bin/bash shebangset -e to enable exit-on-errorApache License 2.0