0BD045E9-229D-4A82-953E-1EE7C6745A07
Hero shape 1Hero shape 2

iPaaS Insights

Integration tutorials, tips and best practices

The Benefits of Kubernetes for Integration Developers

August 01, 2022

Deploying cloud-native integrations is slowly becoming the standard for developers. With companies increasing their digital initiatives and moving towards a completely cloud-based infrastructure, getting everything launched as a native cloud deployment is a big focus.

One of the platforms that enables this large-scale transformation is Kubernetes. It's an open-source container orchestration platform for deploying and managing containerized applications, websites, and more. For developers of any creed, Kubernetes provides a unified platform for creating and running true cloud-native resources.

But what about integration developers? Connecting software together requires the proper tools and environments to run. Integration specialists can reap the benefits of Kubernetes as well when designing and running integration projects.

Let's explore how below!

What Is Kubernetes?

First, we'll provide a brief introduction to the technical side of Kubernetes. We won't go in-depth on the nitty-gritty of the platform here; this is just meant to be a basic introduction to what Kubernetes does and how it originated. For more information on Kubernetes, you can see the official documentation here or browse the other resources available on kubernetes.io.

Kubernetes, also abbreviated to k8s, is a container orchestration platform designed for deploying, managing, and scaling containerized applications. Originally developer by Google as an open-source platform, it's now run by the Cloud-Native Computing Foundation (CNCF) which have been actively updating the project. It's designed to let users manage and observe containerized workloads and services, facilitating both declarative configuration and automation.

Kubernetes Cluster Overview

Applications containerized within Kubernetes can run anywhere, including on-premise, cloud, and hybrid environments. Many cloud environments natively support Kubernetes containers and applications, such as Amazon Web Services, Microsoft Azure, Oracle Cloud, Google Cloud Platform, and IBM Cloud. Developers have been using it to create, launch, manage, patch, scale, secure, and maintain applications for nearly a decade.

Key Kubernetes Features for Integration Developers

So what can Kubernetes provide for your integration projects? Your developers will gain a strong, dedicated application development and orchestration platform that lets them craft and release applications with ease. For integration developers, Kubernetes provides plenty of benefits:

  • It's open-source. You gain the benefits of an open-source software community that's continually working to update the project. Kubernetes has a dedicated userbase and forum of developers that create new integrations, functions, resources, and configurations for Kubernetes projects.

  • Load balancing capabilities when necessary. Sometimes, you'll want or need to scale containerized integrations based on the amount of traffic they receive. Kubernetes will scale traffic through load balancers if it gets too high, ensuring that your network traffic is distributed evenly and the deployment state of your containers remains stable.

  • Self-healing containers. Kubernetes automatically checks the status of your deployed containers and applies fixes if it determines that something is off. You can schedule automatic health checks and updates for your integrations, letting your developers focus on other crucial tasks.

  • Automatic rollouts and rollbacks. You can automatically set the desired state for your deployed containers using Kubernetes. Create new containers, remove existing containers and adopt resources to other ones as needed. And if you need to change the state back to what it was, Kubernetes allows you to rollback changes upon request.

  • Kubernetes operators. Operators are software that create and manage functions in Kubernetes automatically on the user's behalf. Many operators currently exist for integration developers, including Apache Camel K — a deployment for Apache Camel that runs directly on Kubernetes.

Now, let's take a look into how you can build your own integrations on Kubernetes from scratch. We'll be exploring Apache Camel K for this example.

Apache Camel K: The Kubernetes Integration Framework of Choice

Apache Camel is an open-source integration framework designed to create cloud-native integrations. The framework centers around the simple, easy-to-use implementation of over 60 patterns that covers everything from message channels, construction, routing, transformation, and endpoint management.

Camel K Timer Tutorial Figure 1

Figure 1

One of the benefits of Camel K is that you can use the Java DSL for a cleaner interface and smaller lines of codes to handle many functionalities. In the example above using Figure 1, we use the Camel K script in a groovy file to run our timer integration.

In this example, four Camel K components (from, header, body, and log) are used to test a simple integration. Here's some brief notes on each component:

  • From: The from component define the endpoint which is starts the integration. It could be a file, URL endpoint, timer scheduler, etc. In this example, we've set the from component to a timer named test. This is where you can also set query parameters for your from component based on your needs; for this integration, we've added repeatCount = 5 to repeat the process five times.
  • Header: You can assign values to your header to use in your integration. Define values using proper methods, like constant(), simple(), jsonPath(), etc. For our example, we set the header of Time to correspond to date:now:hh.mm.ss.
  • Body: The body can also be assigned with values using the same method as the header. We've set the body to return a statement: The time for now is ${header.Time}.
  • Log: To view a specific output of your routes or sections, you can specify the output using the log component. Above, we've set the log to generate the body content.

Now it's time to generate the output:

Camel K Timer Tutorial Figure 2

Figure 2

To run this integration, simply open a command line and run kamel run <file-name>. Or run kamel run <file-name> --dev to run it in developer mode. (See above in Figure 2.)

NOTE: Make sure you've also included the proper Maven dependencies in your project as well.

We built the Jetic platform to enable developers to create integrations, APIs, etc. on Camel with an easy-to-use visual low-code environment. You can learn more about what Jetic can do by reading our documentation here.