From 293668978403fa7f399f946459402defbabd44e8 Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Mon, 1 Jul 2024 14:48:57 +0200 Subject: [PATCH] fix(ci): delete deployment before other resources Closes #5671 --- docs/modules/ROOT/pages/installation/uninstalling.adoc | 7 +++++-- script/Makefile | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/modules/ROOT/pages/installation/uninstalling.adoc b/docs/modules/ROOT/pages/installation/uninstalling.adoc index 7cd1f746ff..a309770a69 100644 --- a/docs/modules/ROOT/pages/installation/uninstalling.adoc +++ b/docs/modules/ROOT/pages/installation/uninstalling.adoc @@ -49,12 +49,15 @@ Another alternative is to delete the resources the operator is using in a contro == Uninstall operator only (keeps CRDs and any running Integration) -In order to remove the operator and any configuration resource it uses you'll need to perform the following cleaning operation: +In order to remove the operator and any configuration resource it uses you'll need to perform the following cleaning operation. Here we're assuming you have installed an operator in the namespace camel-k: ``` -$ kubectl delete deploy,configmap,secret,sa,rolebindings,clusterrolebindings,roles,clusterroles,integrationplatform -l app=camel-k +$ kubectl delete deploy -l app=camel-k -n camel-k +$ kubectl delete configmap,secret,sa,rolebindings,clusterrolebindings,roles,clusterroles,integrationplatform -l app=camel-k -n camel-k ``` +Notice that you need to perform two operation to let the Kubernetes finalizers running in the Deployment object to complete before removing any required additional resource (ie, the ServiceAccount holding such privileges). + NOTE: CRDs and Integration will be maintained alive and running. == Uninstall CRDs (and running Integration) diff --git a/script/Makefile b/script/Makefile index 11b317fc9d..a1c8abc065 100644 --- a/script/Makefile +++ b/script/Makefile @@ -832,9 +832,11 @@ install-openshift-ns: install-operator install-clean-kustomize uninstall: ifdef NAMESPACE - kubectl delete deploy,configmap,secret,sa,rolebindings,clusterrolebindings,roles,clusterroles,integrationplatform -l app=camel-k -n $(NAMESPACE) + kubectl delete deploy -l app=camel-k -n $(NAMESPACE) + kubectl delete configmap,secret,sa,rolebindings,clusterrolebindings,roles,clusterroles,integrationplatform -l app=camel-k -n $(NAMESPACE) else - kubectl delete deploy,configmap,secret,sa,rolebindings,clusterrolebindings,roles,clusterroles,integrationplatform -l app=camel-k + kubectl delete deploy -l app=camel-k + kubectl delete configmap,secret,sa,rolebindings,clusterrolebindings,roles,clusterroles,integrationplatform -l app=camel-k endif uninstall-crds: