Skip to content

Commit

Permalink
doc: documentation for helm-lint feature
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa committed Feb 7, 2024
1 parent 5006149 commit e57f138
Show file tree
Hide file tree
Showing 21 changed files with 193 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ include::_jkube-resource.adoc[]

include::_jkube-apply.adoc[]

include::_jkube-helm.adoc[]
include::{kitdoc-path}/inc/helm/_jkube_helm.adoc[]

include::_jkube-helm-push.adoc[]
include::{kitdoc-path}/inc/helm/_jkube_helm_push.adoc[]

include::{kitdoc-path}/inc/helm/_jkube_helm_lint.adoc[]

This file was deleted.

This file was deleted.

96 changes: 52 additions & 44 deletions jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm.adoc
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@


ifeval::["{plugin-type}" == "maven"]
This goal is for creating
https://helm.sh/docs/topics/charts[Helm charts]
for your Maven project so that you can install, update, or delete your app in Kubernetes
using https://github.com/helm/helm[Helm].
To generate the Helm chart you simply need to call `{goal-prefix}:helm` goal on the command line:

include::maven/_resource_helm.adoc[]

[NOTE]
The `{goal-prefix}:resource` goal is required to create the resource descriptors that are included in the Helm chart.
If you have already generated the resources in a previous step then you can omit this goal.
[[jkube:helm]]
== *{goal-prefix}:helm*
endif::[]

ifeval::["{plugin-type}" == "gradle"]
This task is for creating
https://helm.sh/docs/topics/charts[Helm charts]
for your Gradle project so that you can install, update, or delete your app in Kubernetes
using https://github.com/helm/helm[Helm].
To generate the Helm chart you simply need to call `{task-prefix}Helm` task on the command line:

include::gradle/_resource_helm.adoc[]
[[jkubeHelm]]
=== *{task-prefix}Helm*
endif::[]

[NOTE]
The `{task-prefix}Resource` goal is required to create the resource descriptors that are included in the Helm chart.
If you have already generated the resources in a previous step then you can omit this task.
This feature allows you to create https://helm.sh/docs/topics/charts[Helm charts] from the Kubernetes resources Eclipse JKube generates for your project.
You can then use the generated charts to leverage https://github.com/helm/helm[Helm]'s capabilities to install, update, or delete your app in Kubernetes.
ifeval::["{plugin-type}" == "maven"]
include::maven/_mvn_helm.adoc[]
endif::[]
ifeval::["{plugin-type}" == "gradle"]
include::gradle/_gradle_helm.adoc[]
endif::[]
There are multiple ways to configure the generated Helm Chart:
Expand Down Expand Up @@ -58,45 +46,50 @@ This configuration section knows the following sub-elements in order to configur
| `jkube.helm.apiVersion`
| *chart*
| The Chart name
| The Chart name.
ifeval::["{plugin-type}" == "maven"]
, which is `${project.artifactId}` if not provided.
Defaults to `${project.artifactId}`.
endif::[]
| `jkube.helm.chart`
| *version*
| The Chart SemVer version
| The Chart SemVer version.
ifeval::["{plugin-type}" == "maven"]
, which is `${project.version}` if not provided.
Defaults to `${project.version}`.
endif::[]
| `jkube.helm.version`
| *description*
| The Chart single-sentence description
| The Chart single-sentence description.
ifeval::["{plugin-type}" == "maven"]
, which is `${project.description}` if not provided.
Defaults to `${project.description}`.
endif::[]
| `jkube.helm.description`
| *home*
| The Chart URL for this project's home page
| The Chart URL for this project's home page.
ifeval::["{plugin-type}" == "maven"]
, which is `${project.url}` if not provided.
Defaults to `${project.url}`.
endif::[]
| `jkube.helm.home`
| *sources*
| The Chart list of URLs to source code for this project
| The Chart list of URLs to source code for this project.
ifeval::["{plugin-type}" == "maven"]
, defaults to the list of `${project.scm.url}` if not provided.
Defaults to the list of `${project.scm.url}`.
endif::[]
|
| *<<helm-maintainers, maintainers>>*
| The Chart list of maintainers (name+email)
| The Chart list of maintainers (name+email).
ifeval::["{plugin-type}" == "maven"]
, defaults to the list of
`${project.developers.name}:${project.developers.name}` if not provided.
Defaults to the list of `${project.developers.name}:${project.developers.name}`.
endif::[]
|
Expand All @@ -106,9 +99,10 @@ endif::[]
| `jkube.helm.icon`
| *appVersion*
| The version of the application that Chart contains
| The version of the application that Chart contains.
ifeval::["{plugin-type}" == "maven"]
, defaults to `${project.version}` if not provided.
Defaults to `${project.version}`.
endif::[]
| `jkube.helm.appVersion`
Expand Down Expand Up @@ -136,11 +130,13 @@ OpenShift specific resources in the chart. You can also add both values as a com
|
ifeval::["{plugin-type}" == "maven"]
Where to find the resource descriptors generated with `{goal-prefix}:resource`.
By default this is `${basedir}/target/classes/META-INF/jkube., which is also the output directory used by `{goal-prefix}:resource`.
By default, this is `${basedir}/target/classes/META-INF/jkube., which is also the output directory used by `{goal-prefix}:resource`.
endif::[]
ifeval::["{plugin-type}" == "gradle"]
Where to find the resource descriptors generated with `{task-prefix}Resource`.
By default this is `${basedir}/build/classes/java/main/classes/META-INF/jkube`, which is also the output directory used by `{task-prefix}Resource`.
By default, this is `${basedir}/build/classes/java/main/classes/META-INF/jkube`, which is also the output directory used by `{task-prefix}Resource`.
endif::[]
| `jkube.helm.sourceDir`
Expand All @@ -157,7 +153,7 @@ endif::[]
| `jkube.helm.outputDir`
| *tarballOutputDir*
| Where to create the the Helm chart archive, which is same as `outputDir` if not provided.
| Where to create the Helm chart archive, which is same as `outputDir` if not provided.
| `jkube.helm.tarballOutputDir`
| *tarFileClassifier*
Expand Down Expand Up @@ -192,13 +188,13 @@ Defaults to empty string.
| Element | Description
| *name*
| The maintainer user name or organization.
| The maintainer's name or organization.
| *email*
| The maintainer's contact email address.
| *url*
| The maintainer URL address.
| The maintainer's URL address.
|===
Expand Down Expand Up @@ -246,7 +242,13 @@ Defaults to empty string.
|===
// TODO: Remove if Once header depth is aligned in both plugins
ifeval::["{plugin-type}" == "maven"]
=== Helm-specific fragments
endif::[]
ifeval::["{plugin-type}" == "gradle"]
==== Helm-specific fragments
endif::[]
In addition to the standard Kubernetes <<introduction-examples-resource-fragments, resource fragments>>, you can also provide fragments for Helm `Chart.yaml` and `values.yaml` files.
Expand All @@ -257,7 +259,13 @@ For the `values.yaml` file you can provide a `values.helm.yaml` fragment in the
These fragments will be merged with the opinionated and configured defaults.
The values provided in the fragments will override any of the generated default values taking precedence over them.
// TODO: Remove if Once header depth is aligned in both plugins
ifeval::["{plugin-type}" == "maven"]
=== Installing the generated Helm chart
endif::[]
ifeval::["{plugin-type}" == "gradle"]
==== Installing the generated Helm chart
endif::[]
In a next step you can install this via the https://github.com/helm/helm/releases[helm command line tool] as follows:
Expand Down
43 changes: 43 additions & 0 deletions jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_lint.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
ifeval::["{plugin-type}" == "maven"]
[[jkube:helm-lint]]
== *{goal-prefix}:helm-lint*
endif::[]
ifeval::["{plugin-type}" == "gradle"]
[[jkubeHelmLint]]
=== *{task-prefix}HelmLint*
endif::[]

This feature allows you to lint your Eclipse JKube-generated
https://helm.sh/docs/topics/charts[Helm charts] and examine it for possible issues.

It provides the same output as the https://helm.sh/docs/helm/helm_lint[`helm lint`] command.

ifeval::["{plugin-type}" == "maven"]
include::maven/_mvn_helm_lint.adoc[]
endif::[]
ifeval::["{plugin-type}" == "gradle"]
include::gradle/_gradle_helm_lint.adoc[]
endif::[]

.Helm lint configuration
[cols="1,5,1"]
|===
| Element | Description | Property

| *lintStrict*
| Enable strict mode, fails on lint warnings.
| `jkube.helm.lint.strict`

| *lintQuiet*
| Enable quiet mode, only shows warnings and errors.
| `jkube.helm.lint.quiet`

|===

.Example Helm lint configuration
ifeval::["{plugin-type}" == "maven"]
include::maven/_example_helm_lint_config.adoc[]
endif::[]
ifeval::["{plugin-type}" == "gradle"]
include::gradle/_example_helm_lint_config.adoc[]
endif::[]
26 changes: 10 additions & 16 deletions jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_push.adoc
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@

This goal is for pushing
https://helm.sh/docs/topics/charts[Helm charts]
in a remote repository [Artifactory, Chartmuseum, Nexus].

ifeval::["{plugin-type}" == "maven"]
To publish a Helm chart you simply call `{goal-prefix}:helm-push` goal on the command line:

include::maven/_resource_helm_push.adoc[]
[[jkube:helm-push]]
== *{goal-prefix}:helm-push*
endif::[]
ifeval::["{plugin-type}" == "gradle"]
To publish a Helm chart you simply call `{task-prefix}HelmPush` task on the command line:

include::gradle/_resource_helm_push.adoc[]
[[jkubeHelmPush]]
=== *{task-prefix}HelmPush*
endif::[]

This feature allows you to upload your Eclipse JKube-generated
https://helm.sh/docs/topics/charts[Helm charts]
to one of the supported repositories: Artifactory, Chartmuseum, Nexus, and OCI.

ifeval::["{plugin-type}" == "maven"]
The `{goal-prefix}:resource` and the `{goal-prefix}:helm` goals are required to create the resource descriptors which are included in the Helm chart and the Helm chart itself.
include::maven/_mvn_helm_push.adoc[]
endif::[]
ifeval::["{plugin-type}" == "gradle"]
The `{task-prefix}Resource` and the `{task-prefix}Helm` tasks are required to create the resource descriptors which are included in the Helm chart and the Helm chart itself.
include::gradle/_gradle_helm_push.adoc[]
endif::[]
If you have already built the resource and create the chart, then you can omit these goals.

The configuration is defined in a `helm` section within the plugin's configuration:

Expand All @@ -32,7 +27,6 @@ ifeval::["{plugin-type}" == "gradle"]
include::gradle/_example_helm_push_config.adoc[]
endif::[]


ifeval::["{plugin-type}" == "maven"]
You can provide helm repository authentication credentials either via properties or using environment variables. It's also possible to specify credentials in maven settings as well. You just
need to add a server entry for your repo like this:
Expand Down Expand Up @@ -96,7 +90,7 @@ This configuration section knows the following sub-elements in order to configur
| `jkube.helm.stableRepository.password`

| *type*
| The type of the repository. One of ARTIFACTORY, NEXUS, CHARTMUSEUM
| The type of the repository. One of ARTIFACTORY, NEXUS, CHARTMUSEUM, OCI
| `jkube.helm.stableRepository.type`

|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
----
kubernetes {
helm {
lintStrict = true
lintQuiet = true
}
}
----
10 changes: 10 additions & 0 deletions jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To generate the Helm chart you need to invoke the `{task-prefix}Helm` Gradle task on the command line:

[source, sh, subs="+attributes"]
----
gradle {task-prefix}Resource {task-prefix}Helm
----

[NOTE]
The `{task-prefix}Resource` goal is required to create the resource descriptors that are included in the Helm chart.
If you have already generated the resources in a previous step then you can omit this task.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To lint a Helm chart you need to invoke the `{task-prefix}HelmLint` Gradle task on the command line:

[source, sh, subs="+attributes"]
----
gradle {task-prefix}Resource {task-prefix}Helm {task-prefix}HelmLint
----

[NOTE]
The `{task-prefix}Resource` and the `{task-prefix}Helm` tasks are required to create the resource descriptors which are included in the Helm chart and the Helm chart itself.
If you have already built the resource and created the chart, then you can omit these tasks.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To publish a Helm chart you need to invoke the `{task-prefix}HelmPush` Gradle task on the command line:

[source, sh, subs="+attributes"]
----
gradle {task-prefix}Resource {task-prefix}Helm {task-prefix}HelmPush
----

[NOTE]
The `{task-prefix}Resource` and the `{task-prefix}Helm` tasks are required to create the resource descriptors which are included in the Helm chart and the Helm chart itself.
If you have already built the resource and created the chart, then you can omit these tasks.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
----
<plugin>
<configuration>
<helm>
<lintStrict>true</lintStrict>
<lintQuiet>true</lintQuiet>
</helm>
</configuration>
</plugin>
----
10 changes: 10 additions & 0 deletions jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To generate the Helm chart you need to invoke the`{goal-prefix}:helm` Maven goal on the command line:

[source, sh, subs="+attributes"]
----
mvn {goal-prefix}:resource {goal-prefix}:helm
----

[NOTE]
The `{goal-prefix}:resource` goal is required to create the resource descriptors that are included in the Helm chart.
If you have already generated the resources in a previous step then you can omit this goal.
Loading

0 comments on commit e57f138

Please sign in to comment.