Welcome to the world of Eclipse JKube, where deploying Java applications to cloud environments like Kubernetes and OpenShift becomes a breeze! In this article, we’ll walk you through the essential components, usage, and troubleshooting tips for making your applications cloud-native without a hassle.
Introduction
Eclipse JKube is a collection of powerhouse plugins and libraries that simplify the process of building container images with Docker, JIB, or S2I strategies. It simultaneously generates and deploys Kubernetes and OpenShift manifests right at compile time. Think of Eclipse JKube as your personal cloud-native Swiss Army knife, equipped with all necessary tools for transitioning your Java applications to the cloud.
Kubernetes Maven Plugin
This powerful plugin allows Maven users to easily build, push, and deploy their applications to Kubernetes.
Add the plugin to your project by modifying the pom.xml file as follows:
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>$jkube.version</version>
</plugin>
To run the JKube commands, execute:
mvn package k8s:build k8s:push k8s:resource k8s:apply
For a quick visual overview, check out the demo on YouTube:
Kubernetes Gradle Plugin
For Gradle users, Eclipse JKube offers a similar plugin to make the transition smooth.
Add the plugin in your build.gradle:
plugins {
id 'org.eclipse.jkube.kubernetes' version '$jKubeVersion'
}
Run the corresponding JKube commands with:
gradle build k8sBuild k8sPush k8sResource k8sApply
And don’t forget to check out the demo:
OpenShift Plugins
Eclipse JKube provides similar plugins for OpenShift, catering to both Maven and Gradle users:
Integrate the OpenShift Gradle Plugin into your project:
plugins {
id 'org.eclipse.jkube.openshift' version '$jKubeVersion'
}
Use the command:
gradle build ocBuild ocResource ocApply
Watch the demo here:
Getting Started
To dive right in, explore the quickstarts in the quickstarts directory featuring sample Maven and Gradle projects using the latest JKube plugin version.
Hello World using Eclipse JKube
Follow these steps to create and run your first application:
- Clone the repository:
- Navigate to the Hello World Quickstart folder:
- Configure your local environment to use the Docker daemon inside Minikube:
- Build the project and run JKube goals:
- Check the created pod logs using:
git clone git@github.com:eclipsejkube.git
cd jkube/quickstarts/maven/hello-world
eval $(minikube -p minikube docker-env)
mvn clean install k8s:build k8s:resource k8s:apply
kubectl get pods
Troubleshooting
In case you encounter problems such as “ImagePullBackOff”, ensure that you share Minikube’s Docker daemon environment with your shell:
eval $(minikube -p minikube docker-env)
To revert, use:
eval $(minikube docker-env -u)
If you frequently use this command, consider adding it to your .bash_profile or .zshrc.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Rebranding Notice
Eclipse JKube is a rebranded version of the earlier Fabric8 Maven Plugin, redesigned for Java developers working with Kubernetes.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

