Search…
Remote Development

Introduction

Most of the development work happens on local environments, with programmers having to run their own docker containers, services, databases and any other required elements.
Bunnyshell's Remote Development feature aims to streamline this process, with only the code being locally-stored. At the same time, all your work on the code would be synchronized in real time with a pod from your Kubernetes cluster. This pod is the one that will execute your code.
Instead of having all the Docker compose elements running locally, you will work directly within a cluster from your personal computer.

How Remote Development works

To start Remote Development, use the following command in the Bunnyshell CLI:
bunnyshell-cli remote-development start
After this, Bunnyshell will go through a series of steps meant to enable the service on your device.

Installing an SSH service and Syncthing

A component inside a Bunnyshell environment corresponds to a deployment inside a Kubernetes cluster. To sync in real-time with a pod from that cluster, the first thing we need to do is modify its Kubernetes manifest and enable it to receive external connections. Bunnyshell does this by installing two services on the pod:
  • A remote SSH service that allows you to establish a connection within it;
  • A Syncthing service. This will enable continuous file synchronization between the local files and the ones inside the pod.

Port-forward the SSH server to your localhost and Syncthing

The SSH server is exposed through the Kubernetes port-forward. Then Bunnyshell will create SSH tunnels that will port-forward Syncthing, making it available to the local machine.

Enabling Syncthing locally

Bunnyshell now needs to start Syncthing on your local machine.
There are two separate Syncthing services:
  • The remote Syncthing: runs inside the pod and shares a folder from there.
  • The local Syncthing: runs on your machine and shares the code stored locally.
After it is started, the local Syncthing service will be connected to the remote one via the forwarded port. At this step, the local files and the ones inside the pod will be synchronized.

Opening an interactive shell inside the pod

Finally, Bunnyshell opens an interactive shell into the pod, allowing you to execute Linux commands on it. You will now be able to edit code locally, with updates being made in real-time in the cloud.
Copy link
On this page
Introduction
How Remote Development works
Installing an SSH service and Syncthing
Port-forward the SSH server to your localhost and Syncthing
Enabling Syncthing locally
Opening an interactive shell inside the pod