Skip to content

Uninstalling operator by olm use all the grace_period to terminate the pod_registry. #5866

@avisiedo

Description

@avisiedo

Bug Report

Launching and terminating several times an operator using "operator-sdk" which is installed using OLM, I get for the termination that the registry_pod is not terminated immediately, keeping the pod up until the graceperiod is reached and a SIGKILL is sent to all the process in the container.

What did you do?

For freeipa-operator I ran:

  1. make docker-build docker-push bundle bundle-build bundle-push catalog-build catalog-push (maybe some custom rule to build and push all the necessary information).
  2. Run custom make bundle-install rule which indirectly run at the end operator-sdk run bundle quay.io/avisied0/freeipa-operator-bandle:v0.0.1, and I get the operator installed into the current namespace
  3. Once it has been installed and is attending petitions, I run make bundle-uninstall which is at the end running operator-sdk cleanup freeipa-operator --namespace "ipa".

What did you expect to see?

The pod_registry terminate in a few seconds (no more than 5s).

What did you see instead? Under which circumstances?

The pod registry stay alive until the grace_period is reached.

Environment

Operator type:

/language go

Kubernetes cluster type:

OpenShift

$ operator-sdk version

1.18

$ go version

go version go1.17 linux/amd64

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v0.23.0", GitCommit:"6de42bda13eab9625daa5ce18008f9fca1f7ca0f", GitTreeState:"clean", BuildDate:"2022-03-17T09:53:55Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
error: You must be logged in to the server (the server has asked for the client to provide credentials)

Possible Solution

Execute last process for the pod_registry with 'exec' so that PID 1 is substituted by the last process; so it will receive the SIGTERM signal that is sent by kubernetes when start to terminate the pods.

Additional context

Potential solution: #5818

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions