Skip to content

Commit b0c771c

Browse files
xeniapeTechassi
andauthored
feat: Add uninstall demo/stack feature (#429)
* feat: Add uninstall demo/stack feature * changelog, some fixes after merge, cargo clippy * pre-commit fixes * pre-commit fix * regenerate-nix * adjustments after main merge * further uninstall adjustments * small word fix * cargo update * add documentation * delete namespace function * use Label struct for label * rename function * code readability * reduce nesting * delete object refactoring * small docs adjustment * Revert "small docs adjustment" This reverts commit 7dfe50e. * Update rust/stackablectl/src/cmds/demo.rs Co-authored-by: Techassi <git@techassi.dev> * stackspec in uninstall refactoring * confirm dialog for canceling delete, refactor install confim dialog * function comment for helm uninstall * rename variable * refactor namespace confirmation * add stack parameter on demo uninstall * Update rust/stackable-cockpit/src/utils/k8s/client.rs Co-authored-by: Techassi <git@techassi.dev> * import deref * refactor namespace assignment * refactor namespace deletion function * bump operator-rs and use deref on label key * add assume-yes argument and some small fixes * adjust changelog entry * fix changelog order --------- Co-authored-by: Techassi <git@techassi.dev>
1 parent eae3324 commit b0c771c

26 files changed

Lines changed: 2316 additions & 482 deletions

File tree

Cargo.lock

Lines changed: 187 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 360 additions & 197 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ clap = { version = "4.5", features = ["derive", "env"] }
2828
clap_complete = "4.5"
2929
clap_complete_nushell = "4.5"
3030
comfy-table = { version = "7.1", features = ["custom_styling"] }
31+
dialoguer = "0.12.0"
3132
directories = "6.0"
3233
dotenvy = "0.15"
34+
either = "1.15.0"
3335
futures = "0.3"
3436
indexmap = { version = "2.2", features = ["serde"] }
3537
indicatif = "0.18"
@@ -49,7 +51,7 @@ serde_json = "1.0"
4951
serde_yaml = "0.9"
5052
sha2 = "0.10"
5153
snafu = { version = "0.9", features = ["futures"] }
52-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.108.0", default-features = false, features = ["crds", "kube-ws"] }
54+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.109.0", default-features = false, features = ["crds", "kube-ws"] }
5355
tera = "1.20"
5456
termion = "4.0"
5557
tokio = { version = "1.38", features = ["rt-multi-thread", "macros", "fs", "process", "io-std"] }

crate-hashes.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/modules/stackablectl/pages/commands/demo.adoc

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,31 @@ $ stackablectl stacklets list
159159

160160
== Uninstalling a Demo
161161

162-
Currently, there is no support for uninstalling a demo again. However, this functionality will come soon.
162+
To uninstall a demo, you can run the following command, specifying the namespace the demo was installed in.
163+
164+
[source,console]
165+
----
166+
$ stackablectl demo uninstall trino-taxi-data -n <NAMESPACE>
167+
168+
----
169+
170+
[NOTE]
171+
====
172+
The uninstall command deletes the namespace the demo was installed in. Therefore it is not possible to uninstall demos in the `default` namespace.
173+
====
174+
175+
[WARNING]
176+
====
177+
Currently, some resources deployed by the demo are either still lingering after the deletion process or need to be deleted before running the uninstall command.
178+
179+
* All demos
180+
** MutatingWebhookConfiguration `restarter-sts-enricher.stackable.tech` is not deleted
181+
* end-to-end-security, argo-cd-git-ops, hbase-hdfs-load-cycling-data, jupyterhub-pyspark-hdfs-anomaly-detection-taxi-data
182+
** ClusterroleBinding `hdfs-clusterrolebinding-nodes` is not deleted
183+
* argo-cd-git-ops
184+
** Delete the ArgoCD Applications `airflow`, `airflow-postgres`, `minio`, and `sealed-secrets`
185+
** Then you can delete the namespaces `stackable-airflow`, `minio`, and `sealed-secrets`
186+
** Delete the ArgoCD ApplicationSet `stackable-operators` and wait for ArgoCD to delete the Applications of that ApplicationSet
187+
** Only after deleting the above, run the `stackablectl demo uninstall` command, otherwise the deletion might get stuck
188+
** `*.argoproj.io` CRDs and `sealedsecrets.bitnami.com` CRD are not deleted
189+
====

docs/modules/stackablectl/pages/commands/stack.adoc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,39 @@ Installed stack logging
8989
Use "stackablectl operator installed" to display the installed operators
9090
Use "stackablectl stacklet list" to display the installed stacklets
9191
----
92+
93+
== Uninstalling a Stack
94+
95+
To uninstall a stack, you can run the following command, specifying the namespace the stack was installed in.
96+
97+
[source,console]
98+
----
99+
$ stackablectl stack uninstall logging -n <NAMESPACE>
100+
101+
----
102+
103+
[NOTE]
104+
====
105+
The uninstall command deletes the namespace the stack was installed in. Therefore it is not possible to uninstall stacks in the `default` namespace.
106+
====
107+
108+
[WARNING]
109+
====
110+
Currently, some resources deployed by the stack are either still lingering after the deletion process or need to be deleted before running the uninstall command.
111+
112+
* All stacks
113+
** MutatingWebhookConfiguration `restarter-sts-enricher.stackable.tech` is not deleted
114+
* argo-cd-git-ops, hdfs-hbase, jupyterhub-pyspark-hdfs
115+
** ClusterroleBinding `hdfs-clusterrolebinding-nodes` is not deleted
116+
* argo-cd-git-ops
117+
** Delete the ArgoCD Applications `airflow`, `airflow-postgres`, `minio`, and `sealed-secrets`
118+
** Then you can delete the namespaces `stackable-airflow`, `minio`, and `sealed-secrets`
119+
** Delete the ArgoCD ApplicationSet `stackable-operators` and wait for ArgoCD to delete the Applications of that ApplicationSet
120+
** Only after deleting the above, run the `stackablectl stack uninstall` command, otherwise the deletion might get stuck
121+
** `*.argoproj.io` CRDs and `sealedsecrets.bitnami.com` CRD are not deleted
122+
* monitoring
123+
** `*.monitoring.coreos.com` CRDs are not deleted
124+
* observability
125+
** Delete OpenTelemetryCollector `otel-collector-grpc-external` and `otel-collector-grpc`
126+
** Only after deleting the above, run the `stackablectl stack uninstall` command, otherwise the deletion might get stuck
127+
====

docs/modules/stackablectl/partials/commands/demo.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ Interact with demos, which are end-to-end usage demonstrations of the Stackable
66
Usage: stackablectl demo [OPTIONS] <COMMAND>
77
88
Commands:
9-
list List available demos
10-
describe Print out detailed demo information
11-
install Install a specific demo
12-
help Print this message or the help of the given subcommand(s)
9+
list List available demos
10+
describe Print out detailed demo information
11+
install Install a specific demo
12+
uninstall Uninstall a specific stack. Caution: This will delete the provided stack namespace, the operators and provided operator namespace, and all Stackable CRDs
13+
help Print this message or the help of the given subcommand(s)
1314
1415
Options:
1516
-l, --log-level <LOG_LEVEL>

docs/modules/stackablectl/partials/commands/stack.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ Interact with stacks, which are ready-to-use product combinations
66
Usage: stackablectl stack [OPTIONS] <COMMAND>
77
88
Commands:
9-
list List available stacks
10-
describe Describe a specific stack
11-
install Install a specific stack
12-
help Print this message or the help of the given subcommand(s)
9+
list List available stacks
10+
describe Describe a specific stack
11+
install Install a specific stack
12+
uninstall Uninstall a specific stack. Caution: This will delete the provided stack namespace, the operators and provided operator namespace, and all Stackable CRDs
13+
help Print this message or the help of the given subcommand(s)
1314
1415
Options:
1516
-l, --log-level <LOG_LEVEL>

0 commit comments

Comments
 (0)