Experimenting GCSFUSE

Experimenting GCSFuse

Hi, Let me tell you an issue faced in my current day to day work. We have a Postgres centralized server hosted on a Kubernetes cluster. Whenever I logged into the pgAdmin, I need to recreate a server connection configuration again and again to see the databases. We have a list of common servers that all developers will use daily. So, It will be a time taking or repeating the process to say, connecting to servers again and again when we logged into the pgAdmin. So, I thought of fixing it and after some searching on google came up with something called FUSE file System.

What is FUSE?

Fuse (FileSystem in UserSpace) is something like a component or interface, using this a user-level program can mount a fileSystem to the machine kernel.

Solution

Postgres has the option to export the server configuration into a JSON file. So, I made the JSON file to write to a file using fuse and after every login attempt, Postgres will read the file from the fuse and the default server group’s had been listed :)

GCSFUSE

For this, I have used GCSFUSE which a solution from Google and it is very easy to use. Basic Requirements are,

  • Google Bucket, where you need to store the data.

Once you created the bucket, you need to mount the GCSfuse to our machine using

gcsfuse my-bucket /path/to/mount

That’s it, add a file inside this and check your bucket, the file will be stored there, instead of storing in your machine level file system.

Check GCSfuse Documentation For Further Readings — https://github.com/GoogleCloudPlatform/gcsfuse.