Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: documentation for Helm Uninstall feature #3310

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Usage:
* Fix #2662: Sanitize VCS remote URL used in `jkube.eclipse.org/git-url` annotation
* Fix #2663: Add new helm install goal task (`k8s:helm-install` for maven and `k8sHelmInstall` for gradle)
* Fix #2665: Added support for explicit path for readiness and liveness probes in SpringBootHealthCheckEnricher
* Fix #2666: Add new helm uninstall goal task (`k8s:helm-uninstall` for maven and `k8sHelmUninstall` for gradle)
* Fix #2860: Correctly pass Docker build-arg from the build configuration to the Openshift build strategy
* Fix #2885: Provide a way to set labels on images defined by Generators
* Fix #2901: Ensure Docker build arguments from properties are used during images pre-pulling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ include::{kitdoc-path}/inc/helm/_jkube_helm_lint.adoc[]
include::{kitdoc-path}/inc/helm/_jkube_helm_dependency_update.adoc[]

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

include::{kitdoc-path}/inc/helm/_jkube_helm_uninstall.adoc[]
17 changes: 17 additions & 0 deletions jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,20 @@ include::maven/_jkube_helm_maven_execution.adoc[]
include::_jkube_helm_multimodule.adoc[]
endif::[]

ifeval::["{plugin-type}" == "maven"]
=== Uninstalling the installed Helm release
endif::[]
ifeval::["{plugin-type}" == "gradle"]
==== Uninstalling the installed Helm release
endif::[]


ifeval::["{plugin-type}" == "maven"]
You can uninstall installed Helm release from {cluster} via <<jkube:helm-uninstall, {goal-prefix}:helm-uninstall>> goal as follows:
include::maven/_helm_uninstall.adoc[]
endif::[]
ifeval::["{plugin-type}" == "gradle"]
You can uninstall installed Helm release from {cluster} via <<jkubeHelmUninstall, {task-prefix}HelmUninstall>> task as follows:
include::gradle/_helm_uninstall.adoc[]

endif::[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ifeval::["{plugin-type}" == "maven"]
[[jkube:helm-uninstall]]
== *{goal-prefix}:helm-uninstall*
endif::[]
ifeval::["{plugin-type}" == "gradle"]
[[jkubeHelmUninstall]]
=== *{task-prefix}HelmUninstall*
endif::[]

This feature allows you to remove Helm release from {cluster}

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

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

| *releaseName*
| Name of Helm Release (instance of a chart running in a {cluster} cluster).
| `jkube.helm.release.name`

|===

.Example Helm Uninstall configuration
ifeval::["{plugin-type}" == "maven"]
include::maven/_example_helm_uninstall_config.adoc[]
endif::[]
ifeval::["{plugin-type}" == "gradle"]
include::gradle/_example_helm_uninstall_config.adoc[]
endif::[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
----
kubernetes {
helm {
releaseName = "test-release"
}
}
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To uninstall a Helm release you need to invoke the `{task-prefix}HelmUninstall` gradle task on the command line:

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

[NOTE]
The `{task-prefix}Resource`, `{task-prefix}Helm` and `{task-prefix}HelmInstall` tasks are required to ensure that Helm release gets installed in {cluster}.
If you already have the Helm release installed on {cluster}, then you can omit these tasks.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source, sh, subs="+attributes"]
----
./gradlew {task-prefix}HelmUninstall
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
----
<plugin>
<configuration>
<helm>
<releaseName>test-release</releaseName>
</helm>
</configuration>
</plugin>
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source, sh, subs="+attributes"]
----
mvn {goal-prefix}:helm-uninstall
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To uninstall a Helm release you need to invoke the `{goal-prefix}:helm-uninstall` Maven goal on the command line:

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

[NOTE]
The `{goal-prefix}:resource`, `{goal-prefix}:helm` and `{goal-prefix}:helm-install` goals are required to ensure that Helm release gets installed in {cluster}.
If you already have the Helm release installed on {cluster}, then you can omit these goals.
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ include::{kitdoc-path}/inc/helm/_jkube_helm_push.adoc[]
include::{kitdoc-path}/inc/helm/_jkube_helm_lint.adoc[]
include::{kitdoc-path}/inc/helm/_jkube_helm_dependency_update.adoc[]
include::{kitdoc-path}/inc/helm/_jkube_helm_install.adoc[]
include::{kitdoc-path}/inc/helm/_jkube_helm_uninstall.adoc[]
5 changes: 5 additions & 0 deletions quickstarts/maven/spring-boot-helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ With `helm` CLI, You can also override some of the values defined in the `values
helm install spring-boot-helm target/jkube/helm/spring-boot-helm/kubernetes/ --set deployment.replicas=5 --set service.spec.type=NodePort
```

Once you've finished testing your app, you can remove this installed helm release from cluster via `k8s:helm-uninstall` goal
```shell
mvn k8s:helm-uninstall
```

## Customizing Chart via Maven properties

Helm chart properties can be overridden through command line:
Expand Down