Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

How Helm and JKube simplify Kubernetes management, part 1

April 14, 2022
Rohan Kumar
Related topics:
JavaKubernetes
Related products:
Developer SandboxRed Hat OpenShiftRed Hat OpenShift Container Platform

    Tools provided with Kubernetes continually make it easier for Java developers to build applications, store them in registries, and deploy images. This article looks at Helm charts, the fundamental tool for building applications on Kubernetes and the Red Hat OpenShift cloud service, together with Eclipse JKube, which is available as a Kubernetes Maven or Gradle plugin.

    The article demonstrates how combining Helm with JKube simplifies Kubernetes manifest management for Java projects. You'll learn how JKube makes it possible for Java developers to automatically generate and publish Helm charts (Figure 1).

    Diagram showing how JKube can package a Java application and push it to a Kubernetes cluster using a Helm chart.
    Figure 1: JKube can package a Java application and push it to a Kubernetes cluster using a Helm chart.

    Benefits of Helm and JKube

    Kubernetes has been here for a while now, and more and more organizations are showing interest in the platform. Java developers are becoming increasingly familiar with packaging their applications into Docker or Podman container images and publishing them to container registries such as Docker Hub and Quay.io.

    When working with Kubernetes developers normally need to write Kubernetes configuration files in YAML format. The files can be written manually, of course. But as the complexity of applications increases, it becomes more and more difficult to manage and maintain these Kubernetes manifests.

    The Helm project was introduced in 2015-16 to reduce this complexity. It allows Kubernetes users to package Kubernetes manifests in form of Helm charts. A Helm chart is basically a collection of Kubernetes configuration files. It combines pre-configured Kubernetes application resources with corresponding versions into one easily manageable package.

    Helm quickly gained popularity and became a graduated project of the Cloud Native Computing Foundation. Helm is now considered the de facto package manager for Kubernetes. Think of it as equivalent to the rpm -i command for Linux systems or pip install for Python. Helm processes an application packaged as a chart, and deploys the application to Kubernetes. Through a command-line interface (CLI), Helm makes installation, upgrades, fetching dependencies, and configuring deployments on Kubernetes smoother.

    Benefits of Helm charts include:

    • Easy management of Kubernetes resource manifests
    • Better distribution of Kubernetes manifests across public and private Helm registries
    • Better management of version history for deployments with features such as Helm Rollback

    While Helm is useful, it has a learning curve. You can use Helm directly with Java projects, but it requires some effort. It isn't designed with Java developers' workflow in mind.

    That's where Eclipse JKube comes in. JKube is a collection of tools and libraries that make your development experience smoother on top of Kubernetes and OpenShift. JKube is available as a Maven or Gradle plugin, and aids Java developers working with cloud-native technologies such as Docker and Kubernetes. JKube provides an end-to-end workflow for Java developers while building container images of applications, generating opinionated manifests, and deploying the images to a Kubernetes cluster. Along with opinionated defaults, JKube also provides a rich set of configuration options via plugin configuration.

    Benefits of Eclipse JKube include:

    • Creation of container images and Kubernetes manifests with little to no configuration
    • Creation of Helm charts with little to no configuration
    • Robust operation in both inner and outer loop scenarios
    • Exposure as plugins via Maven and Gradle (with which Java developers are already familiar)
    • No external dependency on any CLI (docker, podman, kubectl, helm, oc, etc.)

    This article will specifically focus on generating Helm Charts using JKube. If you're not already familiar with general aspects of JKube usage, please check out Introduction to Eclipse JKube: Java tooling for Kubernetes and Red Hat OpenShift to get up to speed.

    Generate Helm charts using Eclipse JKube

    Over the rest of this article, you will package a simple Java project into a Helm chart and publish it to a Helm registry using Eclipse JKube. After that, the Java project will be available to any Kubernetes cluster to be installed using the Helm CLI. Then you will install the chart on an OpenShift cluster on the Developer Sandbox for Red Hat OpenShift.

    If you already have an existing Java project, you can try adding the plugins in this section to it. Otherwise, you can go to common starter websites such as code.quarkus.io or spring initializer to generate an application through Maven or Gradle. The sample code and configuration used in this article is available in a Github repository.

    If you're an Apache Maven user, add the OpenShift Maven plugin to your pom.xml file through the following configuration:

    <dependency>
      <groupId>org.eclipse.jkube</groupId>
      <artifactId>openshift-maven-plugin</artifactId>
      <version>${jkube.version}</version>
    </dependency>

    Once you've set up your Java project, you'll need to package it into a container image. You can use OpenShift Maven Plugin's build goal to package the application. This goal uses an OpenShift Source-to-Image (S2I) build, which builds the image in a pod and pushes it to OpenShift's internal container registry:

    $ ./mvnw oc:build

    Once you've built a container image, you can generate Kubernetes manifests using the resource goal:

    $ ./mvnw oc:resource

    After running this command, you should be able to see OpenShift manifests generated in the build output directories:

    $ tree target/classes/META-INF/
    target/classes/META-INF/
    ├── jkube
    │   ├── openshift
    │   │   ├── jkube-helm-maven-deploymentconfig.yml
    │   │   ├── jkube-helm-maven-route.yml
    │   │   └── jkube-helm-maven-service.yml
    │   └── openshift.yml
    └── resources
        └── index.html
    
    3 directories, 5 files

    Instead of preparing a Helm chart manually, package these generated OpenShift manifests into a Helm chart by running the following JKube Helm goal:

    $ ./mvnw oc:helm

    JKube generates a Helm chart without using the Helm CLI. You should be able to see both compressed and decompressed forms of the generated chart in the build output directory:

    $ ls target/jkube-helm-mavejkube-helm-maven-1.0.0-SNAPSHOT-helmshift.tar.gz
    target/jkube-helm-maven-1.0.0-SNAPSHOT-helmshift.tar.gz
    $ tree target/jkube/helm/
    target/jkube/helm/
    └── jkube-helm-maven
        └── openshift
            ├── Chart.yaml
            ├── README.md
            ├── templates
            │   ├── jkube-helm-maven-deploymentconfig.yaml
            │   ├── jkube-helm-maven-route.yaml
            │   └── jkube-helm-maven-service.yaml
            └── values.yaml
    
    3 directories, 6 files

    For more advanced configuration options for Helm chart generation, please check out the oc:helm documentation.

    Publish Helm charts to Helm repositories

    After you have packaged your application into a Helm chart, you might also want to upload it to a Helm registry. You can upload the chart using the JKube Helm push goal (oc:helm-push for Maven and ocHelmPush for Gradle).

    First, you must provide registry details in the plugin configuration. Because this article offers a demo application, we're providing registry details in snapshotRepository. For a real application, you should use stableRepository. The sample configuration is:

         <plugin>
            <groupId>org.eclipse.jkube</groupId>
            <artifactId>openshift-maven-plugin</artifactId>
            <version>${jkube.version}</version>
            <configuration>
              <helm>
                <snapshotRepository>
                  <name>ChartMuseum</name>
                  <url>http://localhost:8080/api/charts</url>
                  <type>CHARTMUSEUM</type>
                  <username>user1</username>
                </snapshotRepository>
              </helm>
            </configuration>
          </plugin>

    After you have configured the registry details, you can run the JKube Helm push goal. The following command uses Maven and provides the registry password on the command line as a property:

    $ ./mvnw oc:helm-push -Djkube.helm.snapshotRepository.password=secret

    You can check the complete list of configuration options for pushing Helm charts in the oc:helm-push documentation.

    Deploy a Helm chart to OpenShift with Helm CLI

    After you've pushed your Helm chart to a Helm registry, you can deploy your application by pulling it and installing the chart via the Helm CLI. This section shows several common commands.

    List all available Helm registries:

    $ helm repo list

    Get the latest chart updates from the registries:

    $ helm repo update 

    Search the Helm repositories for the chart you pushed in the previous section. Because you used the snapshot option, the following command has to include the --devel option:

    $ helm search repo chartmusuem --devel
    NAME                        	CHART VERSION 	APP VERSION	DESCRIPTION
    chartmusuem/jkube-helm-maven	1.0.0-SNAPSHOT

    Install the chart:

    $ helm install --generate-name chartmusuem/jkube-helm-maven --devel
    I0301 22:23:38.971633   37999 request.go:665] Waited for 1.198529433s due to client-side throttling, not priority and fairness, request: GET:https://api.sandbox.openshiftapps.com:6443/apis/security.openshift.io/v1?timeout=32s
    NAME: jkube-helm-maven-1646153615
    LAST DEPLOYED: Tue Mar  1 22:23:40 2022
    NAMESPACE: rokumar-dev
    STATUS: deployed
    REVISION: 1
    TEST SUITE: None

    This command deploys all OpenShift resources contained in this Helm chart to the OpenShift cluster. If you visit the console in the Developer Sandbox, you should see the application deployed in the Topology section (Figure 2).

    A screenshot of the OpenShift console showing a Helm chart.
    Figure 2: The OpenShift console shows a Helm chart.
    ​​​​

     

    Click Open URL and you should be redirected to your application's page (Figure 3).

    Screenshot of the OpenShift console, showing where to open your application.
    Figure 3: From the OpenShift console, you can open your application.

    Discover more

    In this article, you learned about the Helm capabilities provided by the Kubernetes Maven and Gradle JKube plugins. Generating and distributing a complete Helm chart for a Java application consists of just adding the desired Maven or Gradle plugin and invoking a few commands. Check out the follow-up article, How to configure Helm charts using JKube, part 2, to learn about the advanced configuration options provided by Eclipse JKube for generating Helm charts and pushing them to Helm registries.

    For more information about Eclipse JKube, please check out these articles:

    • Java development on top of Kubernetes using Eclipse JKube
    • Get started with Gradle plugins for Eclipse JKube

    You can also check out the Eclipse JKube website. If you like this project, feel free to follow it via these channels:

    • StackOverflow
    • YouTube
    • Twitter
    • Gitter Chat
    Last updated: October 31, 2023

    Related Posts

    • 3 ways to install a database with Helm charts

    • Migrating from Fabric8 Maven Plugin to Eclipse JKube 1.0.0

    • What's your favorite Kubernetes feature? Hear from the experts

    Recent Posts

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    • Control multicluster costs with right-sizing in Red Hat Advanced Cluster Management 5

    • Lightbits is now certified for Red Hat OpenStack Services on OpenShift

    What’s up next?

    Getting GitOps e-book card

    Learn how to navigate the complex world of modern container-based software development and distribution with Getting GitOps: A Practical Platform with OpenShift, Argo CD, and Tekton.

    Get the e-book
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI