Fabric8 Kubernetes Client 7.8 is now available!
On behalf of the Fabric8
team and everyone who has contributed, I'm happy to announce that the Fabric8 Kubernetes Client 7.8.0 has been
released and is now available from
Maven Central 🎉.
This marks the eighth minor release of the Fabric8 Kubernetes Client 7, bringing new features, bug fixes, and improvements while keeping the breaking changes minimal.
Thanks to all of you who have contributed with issue reports, pull requests, feedback, and spreading the word with blogs, videos, comments, and so on. We really appreciate your help, keep it up!
What's new?
Without further ado, let's have a look at the most significant updates:
- Shard selectors for list, watch and informers
- Opt-in TLS warm-up for the Vert.x HTTP client
- CRD generator: class-level descriptions via @JsonClassDescription
- 🐛 Many other bug fixes and minor improvements
You can find the full changelog for this version in our GitHub release page.
Shard selectors for list, watch and informers
List and watch operations, including informers, now support shard selectors through the new withShardSelector method.
This lets you partition a large set of resources across multiple consumers, so each instance only lists and watches the slice it is responsible for.
It's a handy building block when you need to scale controllers or operators horizontally and distribute the watch load, instead of having every instance receive every event.
A shard selector is a CEL expression, typically a shardRange(...) over the resource UID, that you attach to any list, watch, inform or delete operation:
try (KubernetesClient client = new KubernetesClientBuilder().build()) {
// This instance only sees the first half of the UID space
String shard = "shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000')";
client.configMaps()
.withShardSelector(shard)
.inform(handler);
}Note that this relies on the server-side sharded list and watch support, an alpha Kubernetes feature, so the corresponding feature gate must be enabled on your cluster. The initial support was rounded out with a few follow-ups to smooth out the rough edges.
Opt-in TLS warm-up for the Vert.x HTTP client
The Vert.x HTTP client factories (Vertx5HttpClientFactory and VertxHttpClientFactory) now expose a setTlsWarmup(TlsWarmup) method with three modes: OFF, CONTEXT (the default, with unchanged behaviour) and FULL.
When set to FULL, the client performs a synchronous, once-per-JVM, throwaway loopback TLS handshake off the event loop when it's built.
This pays the one-time cost of JDK/Netty TLS class loading up front, so the first real connection no longer blocks the event loop on it.
It's specifically aimed at users running on cold or hard CPU-throttled JVMs who were hitting first-connection stalls or timeouts.
You opt in by configuring the warm-up mode on the HTTP client factory and passing it to the builder:
Vertx5HttpClientFactory factory = new Vertx5HttpClientFactory();
factory.setTlsWarmup(TlsWarmup.FULL);
try (KubernetesClient client = new KubernetesClientBuilder()
.withHttpClientFactory(factory)
.build()) {
// The first TLS connection no longer pays the class-loading cost on the event loop
}The default behaviour (CONTEXT) is unchanged, so you only opt in if you need it.
CRD generator: class-level descriptions via @JsonClassDescription
The CRD generator now honors Jackson's @JsonClassDescription annotation, allowing you to add descriptions to whole classes in the generated CRD schema.
This complements the existing field-level description support, so the documentation embedded in your CRDs can be more complete and closer to your source model.
Using this release
If your project is based on Maven, you just need to add the Fabric8 Kubernetes Client to your Maven dependencies:
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>7.8.0</version>
</dependency>If your project is based on Gradle, you just need to add the Fabric8 Kubernetes Client to your Gradle dependencies:
dependencies {
api "io.fabric8:kubernetes-client:7.8.0"
}Once your project is ready, you can create a new instance of the client to perform operations. In the following code snippet, I show you how to instantiate the client and retrieve a list of Pods:
try (KubernetesClient client = new KubernetesClientBuilder().build()) {
client.pods().list().getItems().forEach(p -> System.out.println(p.getMetadata().getName()));
}How can you help?
If you're interested in helping out and are a first-time contributor, check out the "good first issue" tag in the issue repository. We've tagged extremely easy issues so that you can get started contributing to Open Source.
We're also excited to read articles and posts mentioning our project and sharing the user experience. Giving a star to the project, and spreading the word in general, helps us reach more users and broaden the feedback. Feedback is the only way to improve.
Project Page | Issues | Discussions | Gitter | Stack Overflow

