From b5802cd159befd3ef7d1ef4dcd132afad49d7dfc Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 10 Jan 2024 12:32:30 +0530 Subject: [PATCH] doc (jkube-kit/doc) : Documentation for WellKnownLabelsEnricher Add documentation for WellKnownLabelsEnricher Signed-off-by: Rohan Kumar --- CHANGELOG.md | 17 ++++- .../doc/src/main/asciidoc/inc/_enricher.adoc | 4 ++ .../_jkube_well_known_labels.adoc | 69 +++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 jkube-kit/doc/src/main/asciidoc/inc/enricher/well-known-labels/_jkube_well_known_labels.adoc diff --git a/CHANGELOG.md b/CHANGELOG.md index 363030c8a6..71a61ee00d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,9 @@ Usage: ./scripts/extract-changelog-for-version.sh 1.3.37 5 ``` ### 1.16-SNAPSHOT -* Fix #2257: Provide guidance when the final project packaged file is not found in Quarkus projeicts * Fix #1690: Base images based on ubi9 +* Fix #1700: Add [Kubernetes Well Known labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/) to generated resources +* Fix #2257: Provide guidance when the final project packaged file is not found in Quarkus projeicts * Fix #2070: build goals/tasks log warning if user forgets to run package/build goal/task * Fix #2314: Add chart name validation before doing Helm OCI push * Fix #2381: Container Images based on Java 21 (Java-exec, Tomcat, Jetty, Karaf) @@ -37,6 +38,20 @@ Usage: * Fix #2503: Container Images Jolokia agent bumped to 2.0.0 * Fix #2532: Bump version.kubernetes-client from 6.9.2 to 6.10.0 +_**Note**_: +Kubernetes manifests generated by JKube would now contain the following labels by default: +- `app.kubernetes.io/component` +- `app.kubernetes.io/managed-by` +- `app.kubernetes.io/name` +- `app.kubernetes.io/part-of` +- `app.kubernetes.io/version` + +These are added in favor of deprecating and removing the current project labels in future releases: +- `app` +- `group` +- `provider` +- `version` + ### 1.15.0 (2023-11-10) * Fix #2138: Support for Spring Boot Native Image * Fix #2186: Reuse ` io.fabric8.kubernetes.client.utils.KubernetesResourceUtil` ConfigMap utils methods diff --git a/jkube-kit/doc/src/main/asciidoc/inc/_enricher.adoc b/jkube-kit/doc/src/main/asciidoc/inc/_enricher.adoc index fcd3d0328f..88f460604c 100644 --- a/jkube-kit/doc/src/main/asciidoc/inc/_enricher.adoc +++ b/jkube-kit/doc/src/main/asciidoc/inc/_enricher.adoc @@ -153,6 +153,8 @@ ifeval::["{plugin-type}" == "maven"] endif::[] +| <> +| Add https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels[Kubernetes Recommended Well Known labels]. |=== [[enrichers-generic]] @@ -224,6 +226,8 @@ include::enricher/triggers-annotation/_jkube_triggers_annotation.adoc[] include::enricher/volume-permission/_jkube_volume_permission.adoc[] +include::enricher/well-known-labels/_jkube_well_known_labels.adoc[] + // TODO: At the moment only enrichers listed above have been tested and documented with gradle plugins. Adding the // rest of enrichers only in case of maven. We can slowly refactor these to support both maven and gradle configurations. ifeval::["{plugin-type}" == "maven"] diff --git a/jkube-kit/doc/src/main/asciidoc/inc/enricher/well-known-labels/_jkube_well_known_labels.adoc b/jkube-kit/doc/src/main/asciidoc/inc/enricher/well-known-labels/_jkube_well_known_labels.adoc new file mode 100644 index 0000000000..d63574c75b --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/enricher/well-known-labels/_jkube_well_known_labels.adoc @@ -0,0 +1,69 @@ + +[[jkube-well-known-labels]] +==== jkube-well-known-labels + +Enricher that adds https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels[Well Known Labels] recommended by Kubernetes. + +The `jkube-well-known-labels` enricher supports the following configuration options: + +[cols="1,6,1"] +|=== +| Option | Description | Property + +| +| Add Kubernetes Well Known labels to generated resources. + +Defaults to `true` +| `jkube.kubernetes.well-known-labels` + +| *enabled* +| Enable this flag to turn on addition of Kubernetes Well Known labels. + + Defaults to `true`. +| `jkube.enricher.jkube-well-known-labels.enabled` + +| *name* +| The name of the application (`app.kubernetes.io/name`). + +ifeval::["{plugin-type}" == "maven"] +Defaults to the Maven `project.artifactId` property. +endif::[] +ifeval::["{plugin-type}" == "gradle"] +Defaults to the Gradle Project `name` property. +endif::[] +| `jkube.enricher.jkube-well-known-labels.name` + +| *version* +| The current version of the application (`app.kubernetes.io/version`). + +ifeval::["{plugin-type}" == "maven"] +Defaults to the Maven `project.version` property. +endif::[] +ifeval::["{plugin-type}" == "gradle"] +Defaults to the Gradle Project `version` property. +endif::[] +| `jkube.enricher.jkube-well-known-labels.version` + +| *component* +| The component within the architecture (`app.kubernetes.io/component`). +| `jkube.enricher.jkube-well-known-labels.component` + +| *partOf* +| The name of a higher level application this one is part of (`app.kubernetes.io/part-of`). + +ifeval::["{plugin-type}" == "maven"] +Defaults to the Maven `project.groupId` property. +endif::[] +ifeval::["{plugin-type}" == "gradle"] +Defaults to the Gradle Project `group` property. +endif::[] +| `jkube.enricher.jkube-well-known-labels.partOf` + +| *managedBy* +| The tool being used to manage the operation of an application (`app.kubernetes.io/managed-by`). + +Defaults to `jkube` +| `jkube.enricher.jkube-well-known-labels.managedBy` +|=== + +The Well Known Labels which are already specified in the input fragments are not overridden by the enricher.