splunk / splunk-operator

Splunk Operator for Kubernetes
Other
210 stars 115 forks source link

Splunk Operator: indexers statefulset deleted after image upgrade when using ClusterManager #1151

Open tmaltaverne opened 1 year ago

tmaltaverne commented 1 year ago

Please select the type of request

Bug

Tell us more

Describe the request When doing a minor Splunk image version upgrade (for example, 9.0.4 to 9.0.4.1) in the indexercluster custom resource, the statefulset of the indexers is deleted, resulting in all the indexers being terminated at the same time. There was a fix that was addressing this issue. However, the code change was done only in ApplyIndexerCluster function, which is called when the ClusterMasterRef is used. When the deployment is migrated to ClusterManagerRef, the function called is ApplyIndexerClusterManager. The fix wasn't done it this one, which keeps the old behaviour of deleting the statefulset when there is an image change.

Expected behavior Rolling restart of the indexers when docker image version is updated in the custom resource.

Splunk setup on K8S Multisite indexer cluster, migrated to the ClusterManager custom resource.

Reproduction/Testing steps Upgrade the image of an IndexerCluster. The statefulset managed by this IndexerCluster is deleted and recreated.

K8s environment Kubernetes 1.23

Proposed changes(optional) Do the same fix in the ApplyIndexerClusterManager function. I have tested that locally and validated the rolling restart in a development cluster. I can raise a pull request if it's fine.

akondur commented 1 year ago

Hi @tmaltaverne , thank you for opening the issue as well as identifying the root cause. Please open the suggested pull request.

tmaltaverne commented 1 year ago

Hi, thanks for the quick answer. Here is the PR: #1153