Bug 1986418

Summary: kube-storage-version-migrator-operator needs to handle API server downtime gracefully in SNO
Product: OpenShift Container Platform Reporter: Naga Ravi Chaitanya Elluri <nelluri>
Component: kube-storage-version-migratorAssignee: Luis Sanchez <sanchezl>
Status: CLOSED ERRATA QA Contact: Rahul Gangwar <rgangwar>
Severity: high Docs Contact:
Priority: high    
Version: 4.9CC: aojeagar, aos-bugs, nelluri, rgangwar, sanchezl
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard: chaos
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-18 17:42:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1984730    

Description Naga Ravi Chaitanya Elluri 2021-07-27 13:44:45 UTC
Description of problem:
kube-storage-version-migrator-operator is crashing/restarting and is going though leader elections during the kube-apiserver rollout which takes around ~60 seconds with shutdown-delay-duration and gracefulTerminationDuration is now set to 0 and 15 seconds ( https://github.com/openshift/cluster-kube-apiserver-operator/pull/1168 and https://github.com/openshift/library-go/pull/1104 ). kube-storage-version-migrator-operator leader election timeout should be set to > 60  seconds to handle the downtime gracefully in SNO.

Recommended lease duration values to be considered for reference as noted in https://github.com/openshift/enhancements/pull/832/files#diff-2e28754e69aa417e5b6d89e99e42f05bfb6330800fa823753383db1d170fbc2fR183:

LeaseDuration=137s, RenewDealine=107s, RetryPeriod=26s.
These are the configurable values in k8s.io/client-go based leases and controller-runtime exposes them.
This gives us
   1. clock skew tolerance == 30s
   2. kube-apiserver downtime tolerance == 78s
   3. worst non-graceful lease reacquisition == 163s
   4. worst graceful lease reacquisition == 26s


Here is the trace of the events during the rollout: 
http://dell-r510-01.perf.lab.eng.rdu2.redhat.com/chaos/sno/kube-storage-version-migrator-operator/cerberus_cluster_state.log. We can see that leader lease failures in the log: http://dell-r510-01.perf.lab.eng.rdu2.redhat.com/chaos/sno/kube-storage-version-migrator-operator/openshift-kube-storage-version-migrator-operator.log. The leader election can also be disabled given that there's no HA in SNO.


Version-Release number of selected component (if applicable):
4.9.0-0.nightly-2021-07-26-031621

How reproducible:
Always

Steps to Reproduce:
1. Install a SNO cluster using the latest nightly payload.
2. Trigger kube-apiserver rollout/outage 
3. Observe the state of kube-storage-version-migrator-operator

Actual results:
kube-storage-version-migrator-operator is crashing/restarting and going through leader elections.

Expected results:
kube-storage-version-migrator-operator should handle the API rollout/outage gracefully.

Additional info:
Logs including must-gather: http://dell-r510-01.perf.lab.eng.rdu2.redhat.com/chaos/sno/kube-storage-version-migrator-operator/

Comment 1 Antonio Ojea 2021-07-28 10:04:01 UTC
I've done a similar one before, so I think that same solution applies, bumping openshift-api to bring the new leader election defaults timeouts
https://github.com/openshift/cluster-kube-storage-version-migrator-operator/pull/63

Please check if this is correct

Comment 6 errata-xmlrpc 2021-10-18 17:42:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759