Can't delete kogito deployment - keeps reinstalling in Kubernetes / Minikube

67 views
Skip to first unread message

Adrian Apthorp

unread,
May 7, 2023, 4:05:39 AM5/7/23
to Kogito development mailing list
Hi,

I'm not sure if this is a Kogito operator issue or kubernetes / Minikube. I followed the instructions on the Kogito Operator dev page to use the CLI to deploy kogito into Kubernetes / MiniKube. All is fine until I try to delete my deployment.

kubectl delete completes succesfully.

However, when I check, the deployment is still there or rather it seems to be a new deployment. I can successfully delete other non-Kogito deployments.

Daniele Zonca

unread,
May 7, 2023, 5:49:23 AM5/7/23
to kogito-de...@googlegroups.com
Hi,

Are you removing the K8s Deployment directly?
As far as I remember Kogito CLI creates multiple CR (see this example https://github.com/kiegroup/kogito-examples/blob/stable/kogito-quarkus-examples/decisiontable-quarkus-example/operator/decisiontable-quarkus-example.yaml ) and the actual Kogito application is usually represented by a KogitoRuntime CR. When this resource is created the Kogito Operator is triggered and does all the necessary action to the run the application (create Deployment but maybe also ConfigMap etc).
If you directly remove one of the child resources (i.e. the deployment) the reconciliation loop of the operator is going to recreate it because the desired state is still represented in the cluster (aka KogitoRuntime resource describes the expectation to have a Kogito application running).

My suggestion is to use the Kogito CLI also to remove the service or check at least all the resources in the namespace to see what is going on.
You can use for example the tree plugin (https://github.com/ahmetb/kubectl-tree) to help checking resource relationship/ownership.

If you are already removing the KogitoRuntime CR and you are getting the problem please share the steps to reproduce the issue so it is easier to provide more advises :)

Daniele
--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-development+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/cce065eb-f493-42a7-971f-5012dfebb3d1n%40googlegroups.com.

Adrian Apthorp

unread,
May 8, 2023, 10:24:26 AM5/8/23
to kogito-de...@googlegroups.com
Thanks, I’ll give that a try. I stopped using the CLI as the Kogito operator doc (https://github.com/kiegroup/kogito-operator/blob/main/docs/GUIDE_FOR_KOGITO_DEVS.md) guided me away from it

 While deploying via CLI is somewhat convenient, deploying via image/YAML is the recommended method of deployment and the only available method if you are using minikube.”

But I guess that doesn’t mean it doesn’t work for deletion.

On 7 May 2023, at 5:49 PM, Daniele Zonca <dzo...@redhat.com> wrote:

Hi,
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/CAPpKWi4y2rAV%3DyH-gABOGqx0LSb%2BQg0JE2VN54n4wjqfhM7haA%40mail.gmail.com.

Spolti

unread,
May 8, 2023, 10:47:59 AM5/8/23
to kogito-de...@googlegroups.com
Hi Adrian, if the CLI is not deleting all the resources managed by the Kogito Runtime CR, we might have a bug, can you please give more details about how you are deleting and what is not getting deleted?
As workaround, you can delete the entire project as well, with, kogito delete-project <project_name>

Keep in mind that the kogito-delete service command will not delete any infra service, like kafka, etc..

Em seg., 8 de mai. de 2023 às 11:24, Adrian Apthorp <aapt...@gmail.com> escreveu:
Thanks, I’ll give that a try. I stopped using the CLI as the Kogito operator doc (https://github.com/kiegroup/kogito-operator/blob/main/docs/GUIDE_FOR_KOGITO_DEVS.md) guided me away from it

 While deploying via CLI is somewhat convenient, deploying via image/YAML is the recommended method of deployment and the only available method if you are using minikube.”

But I guess that doesn’t mean it doesn’t work for deletion.

On 7 May 2023, at 5:49 PM, Daniele Zonca <dzo...@redhat.com> wrote:

Hi,

Are you removing the K8s Deployment directly?
As far as I remember Kogito CLI creates multiple CR (see this example https://github.com/kiegroup/kogito-examples/blob/stable/kogito-quarkus-examples/decisiontable-quarkus-example/operator/decisiontable-quarkus-example.yaml ) and the actual Kogito application is usually represented by a KogitoRuntime CR. When this resource is created the Kogito Operator is triggered and does all the necessary action to the run the application (create Deployment but maybe also ConfigMap etc).
If you directly remove one of the child resources (i.e. the deployment) the reconciliation loop of the operator is going to recreate it because the desired state is still represented in the cluster (aka KogitoRuntime resource describes the expectation to have a Kogito application running).

My suggestion is to use the Kogito CLI also to remove the service or check at least all the resources in the namespace to see what is going on.
You can use for example the tree plugin (https://github.com/ahmetb/kubectl-tree) to help checking resource relationship/ownership.

If you are already removing the KogitoRuntime CR and you are getting the problem please share the steps to reproduce the issue so it is easier to provide more advises :)

Daniele

On Sunday, May 7, 2023, Adrian Apthorp <aapt...@gmail.com> wrote:
Hi,

I'm not sure if this is a Kogito operator issue or kubernetes / Minikube. I followed the instructions on the Kogito Operator dev page to use the CLI to deploy kogito into Kubernetes / MiniKube. All is fine until I try to delete my deployment.

kubectl delete completes succesfully.

However, when I check, the deployment is still there or rather it seems to be a new deployment. I can successfully delete other non-Kogito deployments.

--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/cce065eb-f493-42a7-971f-5012dfebb3d1n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/CAPpKWi4y2rAV%3DyH-gABOGqx0LSb%2BQg0JE2VN54n4wjqfhM7haA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.


--
Regards,
--Filippe

Adrian Apthorp

unread,
May 13, 2023, 6:53:14 AM5/13/23
to kogito-de...@googlegroups.com, Spolti
Hi, I've just tested again. The CLI does delete the resources. The slightly confusing thing is the CLI can't be used to create resources when using minikube (Kubernetes). Hence I tried deleting without using the CLI.

Also, I spotted one or two other things that are a bit confusing if not using OpenShift:

$ kogito delete-service process-business-rules-quarkus
Successfully deleted Kogito Service process-business-rules-quarkus in the Project kogito
Delete Kogito Build is only supported on OpenShift.

What is the Kogito Build issue when deleting?

And

$ kogito install infra kogito-infinispan-infra --kind Infinispan --apiVersion infinispan.org/v1 --resource-name kogito-infinispan
Kogito Infra Service successfully installed in the Project kogito.
Check the Service status by running 'oc describe kogitoinfra/kogito-infinispan-infra -n kogito'

The reference to 'oc' is not helpful if using Kubernetes.

Tristan Radisson

unread,
May 16, 2023, 10:53:52 AM5/16/23
to kogito-de...@googlegroups.com
Hi Adrian,

The CLI was primarily designed for Openshift and thus comes with Source-to-image builds.
KogitoBuild is just a way to configure your S2I builds for Kogito. On Kubernetes, this will not work.
And it also explains the reference to `oc` client instead of `kubectl`.

Regards,

Tristan Radisson

Principal Software Quality Engineer

Business Automation Cloud

Red Hat France

trad...@redhat.com   

+33 (1) 41912322



Reply all
Reply to author
Forward
0 new messages