Cloud-Native Java Applications without a hassle
- Introduction
- Migrating from Fabric8 Maven Plugin to Kubernetes/OpenShift Maven Plugin
- Getting Started
- Rebranding Notice
- Contributing
- How to use Eclipse JKube snapshot artifacts?
- Add your organization to ADOPTERS
- FAQs
Eclipse JKube is a collection of plugins and libraries that are used for building container images using Docker, JIB or S2I build strategies. Eclipse JKube generates and deploys Kubernetes/OpenShift manifests at compile time too.
It brings your Java applications on to Kubernetes and OpenShift by leveraging the tasks required to make your application cloud-native.
Eclipse JKube also provides a set of tools such as watch, debug, log, etc. to improve your developer experience. This project contains various building blocks for the Kubernetes Java developer toolbox.
- Add to project:
<plugin> <groupId>org.eclipse.jkube</groupId> <artifactId>kubernetes-maven-plugin</artifactId> <version>${jkube.version}</version> </plugin>
- Run the JKube commands, for instance:
mvn package k8s:build k8s:push k8s:resource k8s:apply
- 📺 Watch 2-minute demo on YouTube:
- Add to project:
plugins { id "org.eclipse.jkube.kubernetes" version "${jKubeVersion}" }
- Run the JKube commands, for instance:
gradle build k8sBuild k8sPush k8sResource k8sApply
- 📺 Watch 2-minute demo on YouTube:
- Add to project:
plugins { id "org.eclipse.jkube.openshift" version "${jKubeVersion}" }
- Run the JKube commands, for instance:
gradle build ocBuild ocResource ocApply
- 📺 Watch 2-minute demo on YouTube:
- Add to project:
<plugin> <groupId>org.eclipse.jkube</groupId> <artifactId>openshift-maven-plugin</artifactId> <version>${jkube.version}</version> </plugin>
- Run the JKube commands, for instance:
mvn package oc:build oc:resource oc:apply
- 📺 Watch 2-minute demo on YouTube:
You can take a look at our quickstarts in quickstarts directory that contain sample maven and gradle projects using the latest version of jkube plugin.
- Clone repository and move to quickstart helloworld sample, build project and run JKube goals:
# 1. Clone repository
$ git clone git@github.com:eclipse/jkube.git
# 2. Move to Hello World Quickstart folder
$ cd jkube/quickstarts/maven/hello-world
# 3. Build Project and run JKube goals
$ mvn clean install \
k8s:build `# Build Docker Image` \
k8s:resource `# Generate Kubernetes Manifests` \
k8s:apply `# Apply generated Kubernetes Manifests onto Kubernetes`
- Check created pod logs:
# Using Kubectl
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
helloworld-7c4665f464-xwskj 0/1 Completed 2 27s
$ kubectl logs jkube-sample-helloworld-7c4665f464-xwskj
Hello World!
# Using JKube
$ mvn k8s:log
[INFO] k8s: [NEW] helloworld-7c4665f464-xwskj status: Running
[INFO] k8s: [NEW] Tailing log of pod: helloworld-587dfff745-2kdpq
[INFO] k8s: [NEW] Press Ctrl-C to stop tailing the log
[INFO] k8s: [NEW]
[INFO] k8s: Hello World!
[INFO] k8s: [NEW] helloworld-7c4665f464-xwskj status: Running
If you experience problems using minikube that pod's status shows 'ImagePullBackOff' and not 'Completed' you must share the minikube's docker daemon environment with your shell with:
$ eval $(minikube docker-env)
You can remove this from your shell again with:
$ eval $(minikube docker-env -u)
If you don't want to type the command for every new terminal you open, you can add the command to your .bash_profile
on mac or .zshrc
.
This project is not an effort from scratch. It was earlier called Fabric8 Maven Plugin. It is just refactored and rebranded version of the project targeted towards Java developers who are working on top of Kubernetes. For more information about history, please see REBRANDING.md