Skip to content

OpenSandbox Controller Helm Chart

A Helm chart for deploying the OpenSandbox Kubernetes Controller, which manages sandbox environments with resource pooling and batch delivery capabilities.

Introduction

This chart bootstraps an OpenSandbox Controller deployment on a Kubernetes cluster using the Helm package manager. The controller provides:

  • Batch Sandbox Management: Create and manage multiple identical sandbox environments
  • Resource Pooling: Maintain pre-warmed resource pools for rapid sandbox provisioning
  • Task Orchestration: Optional task execution within sandboxes
  • High Performance: O(1) time complexity for batch sandbox delivery

Prerequisites

  • Kubernetes 1.21.1+
  • Helm 3.0+
  • Container runtime (Docker, containerd, etc.)

Installing the Chart

To install the chart with the release name opensandbox-controller:

bash
helm install opensandbox-controller ./opensandbox-controller \
  --set controller.image.repository=<your-registry>/opensandbox-controller \
  --set controller.image.tag=v0.1.0 \
  --namespace opensandbox-system \
  --create-namespace

The command deploys OpenSandbox Controller on the Kubernetes cluster with default configuration. The Parameters section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the opensandbox-controller deployment:

bash
helm delete opensandbox-controller -n opensandbox-system

The command removes all the Kubernetes components associated with the chart. Note that CRDs are kept by default (can be changed via crds.keep).

To also remove the CRDs:

bash
kubectl delete crd batchsandboxes.sandbox.opensandbox.io
kubectl delete crd pools.sandbox.opensandbox.io

Parameters

Global Parameters

NameDescriptionValue
nameOverrideOverride the name of the chart""
fullnameOverrideOverride the full name of the chart""
namespaceOverrideOverride the namespace where resources will be created""

Controller Parameters

NameDescriptionValue
controller.image.repositoryController image repositoryopensandbox.io/opensandbox-controller
controller.image.pullPolicyImage pull policyIfNotPresent
controller.image.tagOverrides the image tag (default is chart appVersion)""
controller.replicaCountNumber of controller replicas1
controller.resources.limits.cpuCPU resource limits500m
controller.resources.limits.memoryMemory resource limits128Mi
controller.resources.requests.cpuCPU resource requests10m
controller.resources.requests.memoryMemory resource requests64Mi
controller.logLevelCan be one of 'debug', 'info', 'error'info
controller.kubeClient.qpsQPS for Kubernetes client rate limiter100
controller.kubeClient.burstBurst for Kubernetes client rate limiter200
controller.leaderElection.enabledEnable leader electiontrue
controller.nodeSelectorNode labels for pod assignment{}
controller.tolerationsTolerations for pod assignment[]
controller.affinityAffinity for pod assignment{}
controller.podLabelsAdditional labels for controller pods{}
controller.podAnnotationsAdditional annotations for controller pods{}
controller.priorityClassNamePriority class name for controller pods""

RBAC Parameters

NameDescriptionValue
rbac.createSpecifies whether RBAC resources should be createdtrue
serviceAccount.createSpecifies whether a service account should be createdtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use""

CRD Parameters

NameDescriptionValue
crds.installSpecifies whether CRDs should be installedtrue
crds.keepKeep CRDs on chart uninstalltrue
crds.annotationsAnnotations to add to CRDs{"helm.sh/resource-policy": "keep"}

Additional Parameters

NameDescriptionValue
imagePullSecretsImage pull secrets for private registries[]
extraEnvAdditional environment variables[]
extraVolumesAdditional volumes[]
extraVolumeMountsAdditional volume mounts[]
extraInitContainersAdditional init containers[]
extraContainersAdditional sidecar containers[]

Configuration Examples

Custom Resource Limits

yaml
controller:
  resources:
    limits:
      cpu: 1000m
      memory: 512Mi
    requests:
      cpu: 100m
      memory: 128Mi

Custom Kubernetes Client Rate Limiter

Configure the QPS and Burst for the Kubernetes client to handle high-throughput scenarios:

yaml
controller:
  kubeClient:
    qps: 100
    burst: 250

Note: Default values are QPS=100, Burst=200.

Use Private Registry

yaml
controller:
  image:
    repository: myregistry.example.com/opensandbox-controller
    tag: v0.1.0

imagePullSecrets:
  - name: myregistrykey

Node Affinity

yaml
controller:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: node-role.kubernetes.io/control-plane
            operator: Exists

Usage Examples

After installation, you can create resources:

Create a Resource Pool

yaml
apiVersion: sandbox.opensandbox.io/v1alpha1
kind: Pool
metadata:
  name: example-pool
spec:
  template:
    spec:
      containers:
      - name: sandbox-container
        image: nginx:latest
        ports:
        - containerPort: 80
  capacitySpec:
    bufferMax: 10
    bufferMin: 2
    poolMax: 20
    poolMin: 5

Create a Batch Sandbox

yaml
apiVersion: sandbox.opensandbox.io/v1alpha1
kind: BatchSandbox
metadata:
  name: example-batch-sandbox
spec:
  replicas: 3
  poolRef: example-pool

Upgrading

To upgrade the chart:

bash
helm upgrade opensandbox-controller ./opensandbox-controller \
  --namespace opensandbox-system \
  -f custom-values.yaml

Troubleshooting

Check controller logs

bash
kubectl logs -n opensandbox-system -l control-plane=controller-manager -f

Check CRD installation

bash
kubectl get crd | grep opensandbox

Verify RBAC permissions

bash
kubectl auth can-i --as=system:serviceaccount:opensandbox-system:opensandbox-controller-controller-manager create pods

Additional Resources

License

Apache 2.0 License


此页内容来自仓库源文件:kubernetes/charts/opensandbox-controller/README.md