nebari-dev / nebari-dev/nebari-docs

[DOC] - Consider adding a k8s job in backup/restore docs

Open
#462 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: documentation 📖
Dominant language
No language data
Stars
21
Forks
40
Avg merge
19h 50m
Merged PRs (30d)
6

Description

Preliminary Checks
Summary

Consider adding k8s job to file system backup. Using a k8s job is useful over a simple pod when the file system is large and copying all the data takes a long time. If you try and tar everything up from jupyterlab then your server can timeout due to inactivity before copying everything into a tarball. A k8s job gets around this e.g. Something like

kind: Job
apiVersion: batch/v1
metadata:
  name: backup
  namespace: dev
spec:
  template:
    spec:
      volumes:
        - name: backup-volume
          persistentVolumeClaim:
            claimName: "jupyterhub-dev-share"
      containers:
        - name: debugger
          image: ubuntu
          command: ["/bin/bash", "-c", "cd /data && tar -cvpzf 2024-03-08-shared.tar.gz shared && echo 'Backup complete' > backup.txt"]
          volumeMounts:
            - mountPath: "/data"
              name: backup-volume
      restartPolicy: OnFailure

and for restore

kind: Job
apiVersion: batch/v1
metadata:
  name: restore
  namespace: dev
spec:
  template:
    spec:
      volumes:
        - name: backup-volume
          persistentVolumeClaim:
            claimName: "jupyterhub-dev-share"
      containers:
        - name: debugger
          image: ubuntu
          command: ["/bin/bash", "-c", "cd /data && tar -xvpzf 2024-03-08-shared.tar.gz --skip-old-files && echo 'Restore complete' > restore2.txt"]
          volumeMounts:
            - mountPath: "/data"
              name: backup-volume
      restartPolicy: OnFailure
Steps to Resolve this Issue

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the existing backup and restore documentation in the repository and read the surrounding guidance first. Add Kubernetes Job examples for both operations, adapting the provided persistent-volume commands to fit the documented workflow, and make sure the documentation explains when a Job is preferable to a simple pod.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
devops, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.