If a pod with a Couchbase Server container is deleted from Kubernetes, would the underlying Couchbase Server be shut down gracefully and automatically?
Do I have to explicitly set up a “preStop” hook in the PodSpec of the Couchbase Server container ? E.g
command: ["/bin/sh","-c",“systemctl stop Couchbase-server”]
The normal way to go about this is to change the size per the CRD, and the Couchbase Operator will delete the pods on your behalf after relocating the data.
As of Operator 2.0, we don’t rely on systemd in any way, but when a pod is terminated it we will attempt shutdown with a SIGTERM followed by a SIGKILL. There are some tune-ables for that. To make it graceful though, you need to relocate those services.
What is it you’re trying to accomplish with the pod deletion?
I was wondering if a Couchbase server would be shut down gracefully if its host pod was deleted due to whatever reason.
Actually, it was related to my other question which you have already answered.
By the way, I am not using Operator , but I am aware of prior to shutting down a CB server, I should first remove/failover the server and then rebalance the cluster.
But thanks again.
at the end, the whole CBC has been recreated . but this can be accepted only in non-prod environments