Backup and disaster recovery
InferOps stores desired state in Kubernetes custom resources and model bytes in the configured cache storage. Back up both layers.
Backup scope
- InferOps CRDs and all
ModelDeployment,ModelRuntime, andModelCacheobjects. - Every Secret referenced by
spec.secrets.huggingFaceTokenSecretNameorModelCache.spec.secretRef. - Helm values and exact image digests.
- Cache data when avoiding a full model re-download is required.
Logical backup
set -eu
namespace=default
backup_dir="inferops-backup-$(date -u +%Y%m%dT%H%M%SZ)"
umask 077
mkdir "$backup_dir"
for resource in modelruntimes modelcaches modeldeployments; do
kubectl get "$resource" -n "$namespace" -o json \
| python3 scripts/sanitize_kubernetes_export.py \
> "$backup_dir/$resource.json"
done
kubectl get crd \
modeldeployments.inference.inferops.dev \
modelruntimes.inference.inferops.dev \
modelcaches.inference.inferops.dev \
-o json \
| python3 scripts/sanitize_kubernetes_export.py \
> "$backup_dir/crds.json"
helm get values inferops-operator -n "$namespace" --all -o yaml \
> "$backup_dir/operator-values.yaml"
helm get values inferops-gateway -n "$namespace" --all -o yaml \
> "$backup_dir/gateway-values.yaml"
Export referenced Secrets separately through your organization's secret backup process.
Restore order
- Restore the Kubernetes datastore or create a clean compatible cluster.
- Install storage classes, GPU device plugins, ingress, and Secret-management controllers.
- Apply backed-up CRDs, then apply current additive CRD upgrades.
- Restore referenced Secrets.
- Install operator and gateway with recorded values and pinned images.
- Restore node-local cache data when preserving it is required.
- Restore
ModelRuntime, thenModelCache, thenModelDeploymentobjects.
kubectl apply -f inferops-backup/crds.json
kubectl apply --server-side -f deploy/manifests/crds
helm upgrade --install inferops-operator ./deploy/helm/inferops-operator \
--namespace "$namespace" --values inferops-backup/operator-values.yaml \
--atomic --wait
helm upgrade --install inferops-gateway ./deploy/helm/inferops-gateway \
--namespace "$namespace" --values inferops-backup/gateway-values.yaml \
--atomic --wait
kubectl apply -f inferops-backup/modelruntimes.json
kubectl apply -f inferops-backup/modelcaches.json
kubectl apply -f inferops-backup/modeldeployments.json
Never restore status: controllers must reconstruct it from the recovered cluster.