-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
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:
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).- Run custom
make bundle-installrule which indirectly run at the endoperator-sdk run bundle quay.io/avisied0/freeipa-operator-bandle:v0.0.1, and I get the operator installed into the current namespace - Once it has been installed and is attending petitions, I run
make bundle-uninstallwhich is at the end runningoperator-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