diff --git a/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_index.adoc b/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_index.adoc index 3f6809ad4e..cae78a991f 100644 --- a/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_index.adoc +++ b/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_index.adoc @@ -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[] diff --git a/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_jkube-helm-push.adoc b/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_jkube-helm-push.adoc deleted file mode 100644 index 6704fc1fd8..0000000000 --- a/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_jkube-helm-push.adoc +++ /dev/null @@ -1,5 +0,0 @@ - -[[jkubeHelmPush]] -=== *{task-prefix}HelmPush* - -include::{kitdoc-path}/inc/helm/_jkube_helm_push.adoc[] \ No newline at end of file diff --git a/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_jkube-helm.adoc b/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_jkube-helm.adoc deleted file mode 100644 index f12572709a..0000000000 --- a/gradle-plugin/doc/src/main/asciidoc/inc/tasks/build/_jkube-helm.adoc +++ /dev/null @@ -1,5 +0,0 @@ - -[[jkubeHelm]] -=== *{task-prefix}Helm* - -include::{kitdoc-path}/inc/helm/_jkube_helm.adoc[] diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm.adoc index 8fb467be0f..70bd616afe 100644 --- a/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm.adoc +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm.adoc @@ -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: @@ -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::[] | | *<>* -| 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::[] | @@ -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` @@ -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` @@ -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* @@ -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. |=== @@ -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 <>, you can also provide fragments for Helm `Chart.yaml` and `values.yaml` files. @@ -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: diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_lint.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_lint.adoc new file mode 100644 index 0000000000..a088c86bfb --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_lint.adoc @@ -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::[] diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_push.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_push.adoc index 609d52ae34..a898287699 100644 --- a/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_push.adoc +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm_push.adoc @@ -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: @@ -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: @@ -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` | diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_example_helm_lint_config.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_example_helm_lint_config.adoc new file mode 100644 index 0000000000..ab6bd9eb22 --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_example_helm_lint_config.adoc @@ -0,0 +1,9 @@ +[source,groovy,indent=0,subs="verbatim,quotes,attributes"] +---- +kubernetes { + helm { + lintStrict = true + lintQuiet = true + } +} +---- diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm.adoc new file mode 100644 index 0000000000..fcd1f7c492 --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm.adoc @@ -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. diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm_lint.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm_lint.adoc new file mode 100644 index 0000000000..3c6ea705bf --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm_lint.adoc @@ -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. diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm_push.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm_push.adoc new file mode 100644 index 0000000000..ece3ddf3bc --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_gradle_helm_push.adoc @@ -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. diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_resource_helm.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_resource_helm.adoc deleted file mode 100644 index a662f71d89..0000000000 --- a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_resource_helm.adoc +++ /dev/null @@ -1,4 +0,0 @@ -[source, sh, subs="+attributes"] ----- -gradle {task-prefix}Resource {task-prefix}Helm ----- diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_resource_helm_push.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_resource_helm_push.adoc deleted file mode 100644 index d7a583e925..0000000000 --- a/jkube-kit/doc/src/main/asciidoc/inc/helm/gradle/_resource_helm_push.adoc +++ /dev/null @@ -1,4 +0,0 @@ -[source, sh, subs="+attributes"] ----- -gradle {task-prefix}Resource {task-prefix}Helm {task-prefix}HelmPush ----- \ No newline at end of file diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_example_helm_lint_config.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_example_helm_lint_config.adoc new file mode 100644 index 0000000000..1cfd5da3f6 --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_example_helm_lint_config.adoc @@ -0,0 +1,11 @@ +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + true + true + + + +---- diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm.adoc new file mode 100644 index 0000000000..b0b9a393ec --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm.adoc @@ -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. diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm_lint.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm_lint.adoc new file mode 100644 index 0000000000..1d8de60dfe --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm_lint.adoc @@ -0,0 +1,11 @@ +To lint a Helm chart you need to invoke the `{goal-prefix}:helm-lint` Maven goal on the command line: + +[source, sh, subs="+attributes"] +---- +mvn {goal-prefix}:resource {goal-prefix}:helm {goal-prefix}:helm-lint +---- + +[NOTE] +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. +If you have already built the resource and created the chart, then you can omit these goals. + diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm_push.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm_push.adoc new file mode 100644 index 0000000000..e3aa4841f8 --- /dev/null +++ b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_mvn_helm_push.adoc @@ -0,0 +1,10 @@ +To publish a Helm chart you need to invoke the `{goal-prefix}:helm-push` Maven goal on the command line: + +[source, sh, subs="+attributes"] +---- +mvn {goal-prefix}:resource {goal-prefix}:helm {goal-prefix}:helm-push +---- + +[NOTE] +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. +If you have already built the resource and created the chart, then you can omit these goals. diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_resource_helm.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_resource_helm.adoc deleted file mode 100644 index 984caca1a1..0000000000 --- a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_resource_helm.adoc +++ /dev/null @@ -1,4 +0,0 @@ -[source, sh, subs="+attributes"] ----- -mvn {goal-prefix}:resource {goal-prefix}:helm ----- \ No newline at end of file diff --git a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_resource_helm_push.adoc b/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_resource_helm_push.adoc deleted file mode 100644 index 97600a3786..0000000000 --- a/jkube-kit/doc/src/main/asciidoc/inc/helm/maven/_resource_helm_push.adoc +++ /dev/null @@ -1,4 +0,0 @@ -[source, sh, subs="+attributes"] ----- -mvn {goal-prefix}:resource {goal-prefix}:helm {goal-prefix}:helm-push ----- \ No newline at end of file diff --git a/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_goals.adoc b/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_goals.adoc index 8e951e79b9..6a099ec4f2 100644 --- a/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_goals.adoc +++ b/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_goals.adoc @@ -6,5 +6,6 @@ include::_jkube-resource.adoc[] include::_jkube-build.adoc[] include::_jkube-push.adoc[] include::_jkube-apply.adoc[] -include::_jkube-helm.adoc[] -include::_jkube-helm-push.adoc[] +include::{kitdoc-path}/inc/helm/_jkube_helm.adoc[] +include::{kitdoc-path}/inc/helm/_jkube_helm_push.adoc[] +include::{kitdoc-path}/inc/helm/_jkube_helm_lint.adoc[] diff --git a/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_jkube-helm-push.adoc b/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_jkube-helm-push.adoc deleted file mode 100644 index c25b5d04ee..0000000000 --- a/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_jkube-helm-push.adoc +++ /dev/null @@ -1,5 +0,0 @@ - -[[jkube:helm-push]] -== *{goal-prefix}:helm-push* - -include::{kitdoc-path}/inc/helm/_jkube_helm_push.adoc[] diff --git a/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_jkube-helm.adoc b/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_jkube-helm.adoc deleted file mode 100644 index 82642258c9..0000000000 --- a/kubernetes-maven-plugin/doc/src/main/asciidoc/inc/goals/build/_jkube-helm.adoc +++ /dev/null @@ -1,5 +0,0 @@ - -[[jkube:helm]] -== *{goal-prefix}:helm* - -include::{kitdoc-path}/inc/helm/_jkube_helm.adoc[]