Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Using JGit on Kubernetes(Not sure the best way to handle storing the files as "local" is very temporary)
Using JGit on Kubernetes [message #1842262] Mon, 14 June 2021 20:52 Go to next message
Heavens Regent is currently offline Heavens RegentFriend
Messages: 7
Registered: May 2021
Junior Member
I'm attempting to run JGit on Kubernetes. If I use the local file stuff as soon as the container restarts all the files will be gone. I want to use another remote server to store the files, but I'm not sure how to do this.

The closest thing I've found is the Transport Sftp. Is this what I would need to use to connect to the remote server?
If so how would I get that working as the only things pulling up when Googling are the very insightful docs?
Is there something else that would work better?

Any help or insight would be greatly appreciated.

[Updated on: Mon, 14 June 2021 20:57]

Report message to a moderator

Re: Using JGit on Kubernetes [message #1842277 is a reply to message #1842262] Tue, 15 June 2021 09:49 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
This has hardly anything to do with JGit. You need a "persistent volume" for your pod. Do a web search for that term, maybe in combination with "kubernetes".
Re: Using JGit on Kubernetes [message #1842298 is a reply to message #1842277] Tue, 15 June 2021 22:23 Go to previous messageGo to next message
Heavens Regent is currently offline Heavens RegentFriend
Messages: 7
Registered: May 2021
Junior Member
My question for JGit is how would I use TransportSftp class to connect to the remote server? And is this a valid way to handle the issue.
Re: Using JGit on Kubernetes [message #1842309 is a reply to message #1842298] Wed, 16 June 2021 08:40 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
What remote server?

You asked about running JGit on Kubernetes, and how you'd keep the git repository persistent. For that you need a persistent volume. I suppose it should appear as a normal file system mounted locally in your pod.

To connect to a remote server to clone or fetch from or push to, you'd use https or ssh as usual.

If you want to run JGit on one server and have the files remotely on some other server: don't do that. There's also no support for that. Git is designed to have the repository "local". You can of course mount remote filesystems and store the git repository there. I guess that's what happens under the hood with a Kubernetes persistent volume. NFS mounts also work.

The Transport* implementations are not for storing git repositories remotely. They're for doing fetches or pushes.
Re: Using JGit on Kubernetes [message #1842334 is a reply to message #1842309] Wed, 16 June 2021 15:44 Go to previous messageGo to next message
Heavens Regent is currently offline Heavens RegentFriend
Messages: 7
Registered: May 2021
Junior Member
When looking through the documentation for the TransportSFTP class.

"The SFTP transport does not require any specialized Git support on the remote (server side) repository. Object files are retrieved directly through secure shell's FTP protocol, making it possible to copy objects from a remote repository that is available over SSH, but whose remote host does not have Git installed.

Unlike the HTTP variant (see TransportHttp) we rely upon being able to list files in directories, as the SFTP protocol supports this function. By listing files through SFTP we can avoid needing to have current objects/info/packs or info/refs files on the remote repository and access the data directly, much as Git itself would.

Concurrent pushing over this transport is not supported. Multiple concurrent push operations may cause confusion in the repository state."

Is this not describing a git repository being stored remotely?
Re: Using JGit on Kubernetes [message #1842338 is a reply to message #1842334] Wed, 16 June 2021 16:51 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
No. See above. It's for pushing or fetching. It's a git transport implementation over SFTP. It is not for doing any other kinds of operations, like committing, check-out, merging, or anything else.
Previous Topic:Transport Error : Git-upload-pack not permitted
Next Topic:change view in compare
Goto Forum:
  


Current Time: Thu Apr 18 15:02:18 GMT 2024

Powered by FUDForum. Page generated in 0.02543 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top