DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Tools for App Development on Kubernetes: Ksync

Tools for App Development on Kubernetes: Ksync

In the ongoing series with tools for Kubernetes, we take a look at Ksync, a tool that allows you to developer and debug in real time.

Anita Buehrle user avatar by
Anita Buehrle
·
Oct. 04, 18 · Tutorial
Like (3)
Save
Tweet
Share
4.49K Views

Join the DZone community and get the full member experience.

Join For Free

A few weeks ago we started a series on developer tooling for Kubernetes. The tools that we have been reviewing are based upon those chosen to highlight in our weekly online meetup, "Developing on Kubernetes Office Hours" with the DX team at Weaveworks.

Much like Telepresence, Ksync is also designed to help you debug issues when you're developing new features for apps running on Kubernetes. It saves you time during new feature development and it allows you to iterate on the code without the overhead of running through your entire automated pipeline every single time. This can be particularly useful if you are in the prototyping or you're in the "get it working" stages of development.

Ksync transparently updates containers running on the cluster from your local dev environment. This means you are working from inside the cluster right from your IDE where you can step through and debug your code more easily. And because you are not sending new code through a pipeline each time you make a change, you won't have to wait several minutes to test the changes.

Ksync works from whatever your local dev environment you're using, be it a laptop running Minikube or another cluster.

(From Ksync documentation)

How Ksync Works

Ksync consists of two parts: a server and a client. The server is a DaemonSet that gets installed to the cluster, and provides access to each node's filesystem. The client, on the other hand, watches your local environment, and when there is a change, it starts a new job. This allows the Kubernetes API to deploy the change from your local environment.

The following command puts the client into the background:

ksync watch --daemon

Start Syncing

Ksync is bi-directional, and therefore, it can move all the files from your local container to the one that is running on the cluster. If you're working with a local copy, the most recently updated files are transferred between the container and your local machine.When you check the status after a sync, you should see a watching state with a pod name in the list.

Other Live Coding/Debugging Tools and How They Compare

Like Telepresence, which is also a tool that allows you to go beyond simple debugging, with Ksync you can test and run services from your local environment to a running cluster on the fly. If you didn't have a tool that allowed this type of development, you may have to resort to one of the following configurations:

  • Run your entire distributed application locally with Docker Compose. Provides a fast dev/debug cycle, but, doesn't reflect a real running cluster. If you are using any cloud services (such as RDS) these also might not be easy to access locally.
  • Run Minikube. You can't do live coding/debugging with minikube by itself, but you can if you're using a tool like Telepresence or Ksync.
  • Run everything in a remote Kubernetes staging cluster. Allows you to perform live coding/debugging against the remote Kubernetes cluster. You can do this with both Telepresence and Ksync.

For more on Telepresence, see the post, Debugging microservices - Squash vs. Telepresenc.

Final Thoughts

In this post we discussed Ksync, which is a tool that allows developers to use their local IDE environments in order to more quickly iterate on new features. For a live discussion on Developer's toolkits, tune in and participate in our online meetup "Developing on Kubernetes" every Thursday at 10:00 PT/18:00 BST (British Standard Time).

Kubernetes Docker (software) app

Published at DZone with permission of Anita Buehrle, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Create and Edit Excel XLSX Documents in Java
  • Load Balancing Pattern
  • Distributed SQL: An Alternative to Database Sharding
  • Real-Time Stream Processing With Hazelcast and StreamNative

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: