Camel K and Knative featured image

Apache Camel K is a lightweight cloud-integration platform that runs natively on Kubernetes and, in particular, lets you automate your cloud configurations. Based on the famous Apache Camel, Camel K is designed and optimized for serverless and microservices architectures. In this article, I discuss six ways that Camel K transforms how developers work with Kubernetes, Red Hat OpenShift, and Knative on cloud platforms.

Cloud automation and Camel K

As an old-time developer, I have done my best to adapt to the latest and greatest cloud-native "ecology." It's not that difficult, but there are enough traps to ensure that the process isn't a smooth ride, either. The slow adoption path is understandable for emerging technologies, but with the large-scale adoption of cloud computing, automation is reaching a new level of maturity. We are now able to focus on how to make things work faster, as well as making the technology more accessible to a broader audience.

Here are six reasons that you will love Camel K.

Reason 1: Real-time coding on Kubernetes

When you want to publish an application onto Kubernetes, you need to build the app, containerize it for a working image, and push the image to Kubernetes to run. If you need to debug the app or make other changes, you have to go back to square one and build it again. The worst nightmare for developers is the wait. It is time-consuming, and it breaks the flow of your thoughts. Camel K eliminates this painstaking process by letting developers quickly and immediately update their apps on Kubernetes. You simply layer the image build on the cloud and stream the code using the Camel K Operator.

Reason 2: Natively on the cloud

Camel K is smart enough to discover any resources required to run your application. For instance, if you expose an HTTP endpoint in the app, Camel K will create a related service and route on the platform. Camel K also configures cron jobs based on the behavior you've defined in the code. Camel K handles configurations, and can automatically convert properties files into Kubernetes resources. If you change your mind about a resource, simply remove it from your app, and Camel K will delete it.

Reason 3: No more dependency hell

From a developer's perspective, configuring dependencies is troublesome and annoying. If you frequently work on monolithic projects, it might not be a big deal: You've probably imported everything you could ever need from previous projects. That tactic works as long as we don't talk about redundancy, wasted resources, and version conflicts. But if you are writing a 20-line microservice or function, it doesn't make sense to write a 50-line dependency definition. This is where Camel K saves the day: It smartly picks up the dependencies required to run the app, and it automatically locates the associated libraries during the build. You also have the option to load any specific libraries you might need.

Reason 4: Choose your language and runtime

Camel K supports a range of languages for software development, no matter if it's Java, a scripting language like Groovy or JavaScript, or a markup language like XML or YAML. Camel K also does not need a heavyweight framework like Spring Boot to run. Depending on the type of application, you could run a plain Java main class in a microservice, or go with Quarkus for serverless apps and a fast boot-up time. All you need for the Quarkus runtime is a single configuration: -t quarkus.enabled=true.

Reason 5: Small but powerful

Camel K's core is based on Apache Camel, so it contains many well-established patterns that you can reuse in your applications. The Camel core offers pre-built data transformations and more than 300 components for quick connectivity. You do not need to reinvent the wheel. As a result, your code will be cleaner and easier to maintain, while still being highly customizable and giving you the freedom to choose.

Reason 6: Serverless made easy

Knative is the most popular serverless framework for Kubernetes. It introduces the idea of scaling to zero and scaling up for load and also, with Knative Eventing, serves as the new specification for future cloud events. Camel K can automatically handle the configurations to apply Knative's serverless capabilities to any cloud-based application. Knative makes the process of accessing the Knative channel (similar to a broker) to get cloud events seamless; it can also reduce the cost of operations, development, and scaling.

Conclusion

Camel K might not be the silver bullet that magically solves all your problems, but it's definitely worth your time. Try it out for yourself to see how dramatically it could change the way that you code on cloud platforms. To start, check out this video I made—a 1,000-foot high overview of Camel K. You could also learn more from my Getting started with Camel K basics series.

Last updated: June 26, 2020