Skip to content

Commit b748ea9

Browse files
author
quarkusbot
committed
Sync web site with Quarkus documentation
1 parent 0b6b5dc commit b748ea9

File tree

3 files changed

+144
-1
lines changed

3 files changed

+144
-1
lines changed

_generated-doc/latest/infra/quarkus-all-build-items.adoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8216,6 +8216,28 @@ _No Javadoc found_
82168216
_No Javadoc found_
82178217

82188218

8219+
|===
8220+
== SmallRye JWT
8221+
[.configuration-reference,cols=2*]
8222+
|===
8223+
h|Class Name
8224+
h|Attributes
8225+
8226+
8227+
8228+
8229+
a| https://github.com/quarkusio/quarkus/blob/main/extensions/smallrye-jwt/deployment/src/main/java/io/quarkus/smallrye/jwt/deployment/GenerateEncryptedDevModeJwtKeysBuildItem.java[`io.quarkus.smallrye.jwt.deployment.GenerateEncryptedDevModeJwtKeysBuildItem`, window="_blank"]
8230+
[.description]
8231+
--
8232+
Marker build item to enable encrypted dev/test jwt keys.
8233+
-- a|None
8234+
8235+
8236+
a| https://github.com/quarkusio/quarkus/blob/main/extensions/smallrye-jwt/deployment/src/main/java/io/quarkus/smallrye/jwt/deployment/GeneratePersistentDevModeJwtKeysBuildItem.java[`io.quarkus.smallrye.jwt.deployment.GeneratePersistentDevModeJwtKeysBuildItem`, window="_blank"]
8237+
[.description]
8238+
--
8239+
Marker build item to enable restart-persistent jwt keys.
8240+
-- a|None
82198241
|===
82208242
== SmallRye OpenAPI
82218243
[.configuration-reference,cols=2*]

_guides/_attributes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Common attributes.
22
// --> No blank lines (it ends the document header)
33
:project-name: Quarkus
4-
:quarkus-version: 3.23.2
4+
:quarkus-version: 3.23.3
55
:quarkus-platform-groupid: io.quarkus.platform
66
// .
77
:maven-version: 3.9.9

_guides/kubernetes-client.adoc

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ subjects:
435435
Replace `<applicationName>` and `<namespace>` with your values.
436436
Have a look at https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/[Configure Service Accounts for Pods] to get further information.
437437

438+
[[openshift-client]]
438439
== OpenShift Client
439440

440441
If the targeted Kubernetes cluster is an OpenShift cluster, it is possible to access it through
@@ -513,6 +514,126 @@ To use this feature, you have to add a dependency on `quarkus-test-kubernetes-cl
513514
testImplementation("io.quarkus:quarkus-test-kubernetes-client")
514515
----
515516

517+
[[optimizing-native-image]]
518+
== Optimizing the Native Image
519+
520+
The Kubernetes and OpenShift client extensions aim to provide a great *developer experience* while enabling the client to work in *native mode*.
521+
When building a native image, the Kubernetes Client extension will register all the accessible Kubernetes model classes for reflection.
522+
Unfortunately, this can lead to large native image sizes and longer build times.
523+
524+
Once you've completed your application implementation, if you want to distribute and deploy your application as a *native image*, you should consider reducing its size by following these guidelines.
525+
526+
=== Use the Kubernetes Client extension
527+
528+
The <<openshift-client, OpenShift Client>> provides domain-specific language (DSL) accessors to common OpenShift resources.
529+
In addition, the extension supplies the necessary project configuration to bring in the OpenShift model type modules.
530+
531+
In JVM mode, this works great because, as a developer, you don't need to worry about the configuration.
532+
However, in native mode, by depending on the OpenShift extension you're bringing in many resources that your application might not need unnecessarily increasing its size.
533+
534+
In this context, it's better to depend only on what you need, by adding a dependency to the Kubernetes Client extension and only the minimum OpenShift model dependencies:
535+
536+
[source,xml,role="primary asciidoc-tabs-target-sync-maven"]
537+
.pom.xml
538+
----
539+
<dependency>
540+
<groupId>io.quarkus</groupId>
541+
<artifactId>quarkus-kubernetes-client</artifactId>
542+
</dependency>
543+
<dependency>
544+
<groupId>io.fabric8</groupId>
545+
<artifactId>openshift-model</artifactId>
546+
</dependency>
547+
----
548+
549+
[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
550+
.build.gradle
551+
----
552+
implementation("io.quarkus:quarkus-kubernetes-client")
553+
implementation("io.fabric8:openshift-model")
554+
----
555+
556+
The OpenShift-specific DSL accessors won't be available since you'll now have a Bean of type `KubernetesClient` instead of `OpenShiftClient`.
557+
However, the Fabric8 Kubernetes Client provides generic entry-points to perform operations on any resource:
558+
559+
[source%nowrap,java]
560+
----
561+
// List OpenShift Routes in any namespace
562+
kubernetesClient
563+
.resources(io.fabric8.openshift.api.model.Route.class)
564+
.inAnyNamespace().list();
565+
// Delete an OpenShift Route
566+
kubernetesClient
567+
.resources(io.fabric8.openshift.api.model.Route.class)
568+
.inNamespace("default").withName("the-route").delete();
569+
// Create or replace a new OpenShift Route
570+
kubernetesClient
571+
.resource(new RouteBuilder()/* ... */.build())
572+
.inNamespace("default").createOr(NonDeletingOperation::update);
573+
----
574+
575+
=== Depend only on the modules you need
576+
577+
The Kubernetes Client extension has transitive dependencies to all of the vanilla Kubernetes API model types.
578+
This is very convenient in JVM mode, since you don't need to worry about configuring the project.
579+
580+
However, in native mode, this implies registering for reflection model types that you very likely won't use in your application.
581+
You can mitigate this by providing a more granular project configuration and depending only on those models you are sure the application uses.
582+
583+
[source,xml,role="primary asciidoc-tabs-target-sync-maven"]
584+
.pom.xml
585+
----
586+
<dependency>
587+
<groupId>io.quarkus</groupId>
588+
<artifactId>quarkus-kubernetes-client</artifactId>
589+
</dependency>
590+
<dependency>
591+
<groupId>io.fabric8</groupId>
592+
<artifactId>kubernetes-client-api</artifactId>
593+
<!-- Exclude all transitive dependencies -->
594+
<exclusions>
595+
<exclusion>
596+
<groupId>io.fabric8</groupId>
597+
<artifactId>*</artifactId>
598+
</exclusion>
599+
</exclusions>
600+
</dependency>
601+
<!-- Include only those that make sense for your application -->
602+
<dependency>
603+
<groupId>io.fabric8</groupId>
604+
<artifactId>kubernetes-client</artifactId>
605+
</dependency>
606+
<dependency>
607+
<groupId>io.fabric8</groupId>
608+
<artifactId>kubernetes-model-core</artifactId>
609+
</dependency>
610+
<dependency>
611+
<groupId>io.fabric8</groupId>
612+
<artifactId>kubernetes-model-admissionregistration</artifactId>
613+
</dependency>
614+
<dependency>
615+
<groupId>io.fabric8</groupId>
616+
<artifactId>kubernetes-model-apps</artifactId>
617+
</dependency>
618+
<!-- ... -->
619+
----
620+
621+
[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
622+
.build.gradle
623+
----
624+
implementation("quarkus-kubernetes-client")
625+
implementation("io.fabric8:kubernetes-client-api") {
626+
// Exclude all transitive dependencies
627+
exclude group: "io.fabric8"
628+
}
629+
// Include only those that make sense for your application
630+
implementation("io.fabric8:kubernetes-client")
631+
implementation("io.fabric8:kubernetes-model-core")
632+
implementation("io.fabric8:kubernetes-model-admissionregistration")
633+
implementation("io.fabric8:kubernetes-model-apps")
634+
// ...
635+
----
636+
516637
== Configuration Reference
517638

518639
include::{generated-dir}/config/quarkus-kubernetes-client.adoc[opts=optional, leveloffset=+1]

0 commit comments

Comments
 (0)