Go to file
2023-11-01 22:18:25 -05:00
src fix the invalid struct with no volume name 2023-11-01 20:15:25 -05:00
.gitignore change to rust version 2023-10-30 23:43:30 -05:00
Cargo.lock release 0.2.0 2023-11-01 22:18:25 -05:00
Cargo.toml release 0.2.0 2023-11-01 22:18:25 -05:00
LICENSE initial import 2023-10-17 00:13:01 -05:00
README.md also fix the README to point directly to the crate 2023-11-01 20:04:59 -05:00
release.sh add release script 2023-11-01 22:18:04 -05:00
RELEASING.md add release instructions 2023-11-01 20:15:47 -05:00


A Git remote helper which allows the use of a Kubernetes PVC as the git repo storage.


First, install Rust.

Now, from within the cloned repo, install git-remote-k8s

cargo install git-remote-k8s


You must have access to a kubernetes cluster using kubectl where you can provision a persistent volume somehow and bind it to a claim. If you can "create a new PVC for a pod", you're probably good to go. If you instead get a pending claim forever, you will need to setup a volume provider which can do dynamic provisioning. I've been using longhorn lately since it has very simple backups. I have been very happy with it but YMMV. k3s also comes with a local dynamic provisioner and that would also work.


If you use this with minikube or similar and then delete your cluster, you will lose the git repo stored in the volume! Use with caution in non-prod environments. And use caution in prod, too! Don't forget backups.


The URL format for git-remote-k8s is k8s://kubectl-context/namespace/pvc.

A common name for a kubectl context is default. Yours will be found via kubectl config view and some information may be found in the kubectl Cheat Sheet.

For example, this PVC in the cluster accessed via the default context would be k8s://default/git-remote-test/git-remote-k8s:

NAMESPACE          NAME                                                                                                             STATUS        VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
git-remote-test    git-remote-k8s                                                                                                   Bound         pvc-abcdef10-1023-1025-1024-123456789123   1Gi        RWO            ssd            91m


git clone k8s://context/namespace/pvc

Adding a remote:

git remote add origin k8s//context/namespace/pvc