Estimated Time: 5 minutes
This guide will let you experience what it's like to develop with Kelda. We will be working with a real-world, open source, microservices application called Magda. We will deploy a development instance of Magda, fix a bug, and see our local changes take effect immediately on the development server. Let's jump in.
Download the Magda example project
curl -Lo magda.tar.gz 'link.kelda.io/magda' && \ tar -xzf magda.tar.gz && \ cd magda
The rest of this guide assumes you are running commands from the root of the
This guide deploys to a demo cluster maintained by the Kelda team, but you can run the cluster yourself when developing on your own applications.
Start Kelda by running
kelda devprocess should not be killed during development.
It's needed to sync local changes, and to keep the tunnels open.
If you accidentally kill it, you can restart it by re-running the
- Configures Kelda so that it's connected to the remote cluster.
- And starts the
kelda devprocess, which boots Magda, syncs the files in the
magda-web-serverdirectory, and creates tunnels for accessing the application.
Wait for all the services to become
Ready. The first boot may take several minutes because the Docker images need to be pulled.
View the Bug
Open http://localhost:8080 in your browser. You should see a website with a search box.
Try searching for "Australia" -- a red error message should pop up on the bottom right portion of the screen complaining about a SyntaxError in JSON.
Fix the SyntaxError bug
Fix this bug by editing your local copy of
magda-web-server/src/index.js, and replacing
v0on line 104.
You will notice that Kelda will automatically sync your change and restart the affected containers. The Development Status portion of the Kelda terminal application informs you of all of the changes that are occurring in real time.
If you refresh the page in your browser, and then perform a new search, you should see the
SyntaxErrorgo away, and search results begin to appear.
View service logs
kelda logs allows you to inspect the logs of any running service in your cluster.
In your terminal, run
./bin/kelda logs gatewayto inspect all of the requests that have been made to your
gatewayservice since you began this guide.
SSH into a service
kelda ssh allows you to remotely access any service in your cluster.
In your terminal, run
./bin/kelda ssh gateway. This will place you into a shell on the gateway service container running inside your Kubernetes cluster.
ps auxto see all of the currently running processes inside the gateway service container. The output should look something like this:
./bin/kelda ssh gateway # ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.2 0.7 1220256 57016 ? Ssl 18:52 0:03 node /usr/src root 22 0.0 0.0 4344 776 ? Ss 19:13 0:00 sh root 30 0.0 0.0 17512 2080 ? R+ 19:14 0:00 ps aux
To exit the SSH session, run
kelda devby entering
Ctrl + cinto the terminal window where the Kelda CLI is running.
Delete your development namespace
./bin/kelda deleteto delete your development namespace so that it stops consuming resources in the remote cluster.
Congratulations! You've now seen how easy it is to use Kelda to make changes to your code base locally and instantly see them reflected in a Kubernetes cluster.
We're constantly trying to improve our product for users like you! We would really appreciate it if you took a couple minutes to share your thoughts on Kelda.
If you're interested in using Kelda for your own applications, just let us know and we'll send over the license that you'll need to get started with deploying Kelda.