Remote Development allows software engineers to work and perform tests on environments which are identical to production from an architecture and configuration standpoint.
This solves two main issues:
- It allows engineers to run their code on exactly the same type of services as production. There is no longer a need to emulate/simulate cloud services.
- It allows engineers to use environments which they would not be able to run on their local machines due to available hardware resources.
You can use Bunnyshell's Remote Development feature in one of two ways, depending whether you prefer to keep a local copy of the code or not:
- have nothing but your IDE on your local machine and edit the file directly in the container. The IDE will connect through SSH into the container.
- have the code and your favourite IDE on your local machine and edit the files locally and sync them into the container. The code will be synchronized using a 3rd party tool named Mutagen from your device to the container of your choice, running in Kubernetes.
- Bunnyshell prepares the targeted component by installing the Mutagen agent and an SSH server on its Kubernetes Pod.
- A Mutagen process will be started on your machine, which will connect to the remote Mutagen agent. It will sync the files in
two-way-resolvedmode, meaning it will sync files two-ways: both from local into the container, as well as from the container to local, using a high-performance file sync'ing algorithm, in which the local will win any potential conflicts (files modified both on local and in the container).
- The SSH server forwarded port will be used to open an interactive shell into the
Podwhich will allow you to execute commands in the container running in Kubernetes, so you can preserve your way of working, and run the same commands in the Kubernetes cluster, as you did on local.
PersistentVolumeClaimstoring the code for the application that's about to be remote developed on
EmptyDirvolume, used to copy files needed by Bunnyshell from the
remote-dev-bincontainer into the target container
remote-dev-config: secret containing the
Init Containers Added
remote-dev-work: a container which will initialize the
remote-dev-workvolume by copying the code from the main container into the
PersistemVolumeClaim(only if the volume is empty)
remote-dev-work-permissions: a container which sets the correct permissions on the folders within the
remote-dev-bin: a container based on a Bunnyshell image (
bunnyshell/remote-binaries) containing the binaries needed for Bunnyshell; will mount the volume
remote-dev-bin, which will copy the files in the target container in
Since the development containers usually don't start the processes same as production/staging ones the Kubernetes probes
startupProbe are removed (overwritten with null).
The command is overridden for the target container, into
/opt/bunnyshell/bin/start.sh: this will start the SSH server and if in file sync mode, will also install the Mutagen agent .
Also, some additional labels are added on the
as well as some annotations:
Additionally, to be able to restore the Pods to their previous state after a Remote Development session ends, the
ReplicaSet has the previous manifest saved as text in an annotation:
and some annotations are added on the
Explore the topics below to get a complete understanding on Remote Development in Bunnyshell, and learn how you can make the most of it.
Updated 3 months ago