kubernetes-client is a free, open source api development & testing project written in Java and released under Apache-2.0. It has 3,677 GitHub stars, 1,519 forks and 115 open issues, and was last pushed 39 hours ago. On this registry it ranks #62 of 103 tracked projects in API Development & Testing, with 5 head-to-head comparisons available.

What is kubernetes-client?

What it is

Kubernetes & OpenShift Java Client is a Java library that provides access to the full Kubernetes and OpenShift REST APIs through a fluent domain-specific language. It lives in the Kubernetes and OpenShift ecosystem, and it is distributed as Java artifacts for JVM-based applications, services, and tooling.

The project addresses the need to interact with cluster APIs without writing low-level HTTP request code by hand. It gives Java developers a client path for core Kubernetes and OpenShift APIs, and it also exposes separate extension modules for related Kubernetes-native systems such as Knative, Tekton, ChaosMesh, VolumeSnapshot, Volcano, and Istio. The project is licensed under Apache-2.0.

Key capabilities

  • Provides fluent DSL access to the full Kubernetes and OpenShift REST APIs.
  • Publishes separate Maven artifacts for kubernetes-client and openshift-client.
  • Includes extension clients for knative-client, tekton-client, chaosmesh-client, volumesnapshot-client, volcano-client, and istio-client.
  • Supports mocking Kubernetes interactions, as indicated by the mock-server and mocking-kubernetes topics.
  • Includes Kubernetes object model support, as indicated by the kubernetes-model topic.
  • Documents the modules through Maven Central and Javadoc links.

Who uses it and how

  • Java applications that need to call Kubernetes or OpenShift APIs use the core client modules.
  • OpenShift-focused tools use the openshift-client artifact for OpenShift-specific API access.
  • Teams working with Knative, Tekton, ChaosMesh, VolumeSnapshot, Volcano, or Istio can add the matching extension client.
  • Developers writing tests can use the mock-server and mocking-kubernetes capabilities to simulate cluster behavior.
  • API developers and tool builders can use the project as a Java integration layer instead of writing custom REST clients.

Getting started

Add the required dependency from Maven Central, such as io.fabric8:kubernetes-client or io.fabric8:openshift-client, and use the Javadoc for the selected artifact. Extension artifacts such as io.fabric8:knative-client and io.fabric8:tekton-client are installed in the same Maven-based way.

When to use it — and when not to

Use it when the consuming application is written in Java and needs a supported client for Kubernetes, OpenShift, or the listed extension APIs. Do not choose it when the project requires a non-Java client, a hosted service, or a product that replaces a paid platform, because the provided facts describe a Java client library and Maven artifacts rather than a hosted product. No paid products are listed as replaced, and no database, storage, or SMTP self-hosting requirements are mentioned; the user must still operate the Java application that uses the client and provide its cluster access.

project readme (upstream, from github) — read inline

Kubernetes & OpenShift Java Client Join the chat at https://gitter.im/fabric8io/kubernetes-client

This client provides access to the full Kubernetes & OpenShift REST APIs via a fluent DSL.

Build Sonar Scanner Bugs E2E Tests Release Twitter

Module Maven Central Javadoc
kubernetes-client Maven Central Javadocs
openshift-client Maven Central Javadocs
Extensions Maven Central Javadoc
knative-client Maven Central Javadocs
tekton-client Maven Central Javadocs
chaosmesh-client Maven Central Javadocs
volumesnapshot-client Maven Central Javadocs
volcano-client Maven Central Javadocs
istio-client Maven Central Javadocs
open-cluster-management-client Maven Central Javadocs

Contents

Usage

Creating a client

The easiest way to create a client is:

KubernetesClient client = new KubernetesClientBuilder().build();

DefaultOpenShiftClient implements both the KubernetesClient & OpenShiftClient interface so if you need the OpenShift extensions, such as Builds, etc then simply do:

OpenShiftClient osClient = new KubernetesClientBuilder().build().adapt(OpenShiftClient.class);

Configuring the client

This will use settings from different sources in the following order of priority:

  • System properties
  • Environment variables
  • Kube config file
  • Service account token & mounted CA certificate

System properties are preferred over environment variables. The following system properties & environment variables can be used for configuration:

Property / Environment Variable Description Default value
kubernetes.disable.autoConfig / KUBERNETES_DISABLE_AUTOCONFIG Disable automatic configuration (KubernetesClient would not look in ~/.kube/config, mounted ServiceAccount, environment variables or System properties for Kubernetes cluster information) false
kubernetes.master / KUBERNETES_MASTER Kubernetes master URL https://kubernetes.default.svc
kubernetes.api.version / KUBERNETES_API_VERSION API version v1
openshift.url / OPENSHIFT_URL OpenShift master URL Kubernetes master URL value
kubernetes.oapi.version / KUBERNETES_OAPI_VERSION OpenShift API version

readme truncated — read the full docs on github

Frequently asked questions

Is kubernetes-client free to use?

kubernetes-client is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does kubernetes-client do?

Java client for Kubernetes & OpenShift

What is kubernetes-client written in?

kubernetes-client is primarily written in Java. Its source is publicly available at https://github.com/fabric8io/kubernetes-client, and it has 3,677 GitHub stars.