Bug 1989772 - openshift-controller-manager and operator needs to handle API server downtime gracefully in SNO
Summary: openshift-controller-manager and operator needs to handle API server downtime...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-controller-manager
Version: 4.9
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: ---
: 4.9.0
Assignee: jawed
QA Contact: Jitendar Singh
URL:
Whiteboard: chaos
Depends On:
Blocks: 1984730
TreeView+ depends on / blocked
 
Reported: 2021-08-04 00:08 UTC by Naga Ravi Chaitanya Elluri
Modified: 2021-10-18 17:44 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:44:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift openshift-controller-manager pull 195 0 None None None 2021-08-20 13:26:01 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:44:37 UTC

Description Naga Ravi Chaitanya Elluri 2021-08-04 00:08:15 UTC
Description of problem:
openshift-controller-manager as well as the operator is restarting/crashing, going through leader election during the kube-apiserver rollout which currently 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 ). openshift-controller-manager leader election timeout should be set to > 60 seconds to handle the downtime gracefully in SNO.


We can see that leader lease failures in the log: http://dell-r510-01.perf.lab.eng.rdu2.redhat.com/chaos/sno/openshift-controller-manager/openshift-controller-manager.log and that maps to the pod restart: http://dell-r510-01.perf.lab.eng.rdu2.redhat.com/chaos/sno/openshift-controller-manager/cerberus_cluster_state.log. The leader election can also be disabled given that there's no HA 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


Version-Release number of selected component (if applicable):
4.9.0-0.nightly-2021-08-01-132055

How reproducible:
Always

Steps to Reproduce:
1. Install a SNO cluster using the latest nightly payload.
2. Trigger kube-apiserver rollout or outage which lasts for at least 60 seconds ( kube-apiserver rollout on a cluster built using payload with https://github.com/openshift/cluster-kube-apiserver-operator/pull/1168 should take ~60 seconds ) - $ oc patch kubeapiserver/cluster --type merge -p '{"spec":{"forceRedeploymentReason":"ITERATIONX"}}' where X can be 1,2...n
3. Observe the state of openshift-controller-manager and it's operator.

Actual results:
openshift-controller-manager as well as the operator goes through leader election and restarts.

Expected results:
openshift-controller-manager as well as the operator should handle the API rollout/outage gracefully.

Additional info:
Logs including must-gather:
openshift-controller-manager: http://dell-r510-01.perf.lab.eng.rdu2.redhat.com/chaos/sno/openshift-controller-manager/
controller-manager-operator: http://dell-r510-01.perf.lab.eng.rdu2.redhat.com/chaos/sno/controller-manager-operator/

Comment 7 wewang 2021-09-06 09:28:58 UTC
Verified in version:

4.9.0-0.nightly-2021-09-06-004132


steps:
1. install sno cluster
2. Trigger kube-apiserver rollout 
[wewang@localhost image_registry]$ oc patch kubeapiserver/cluster --type merge -p '{"spec":{"forceRedeploymentReason":"ITERATION2"}}'
kubeapiserver.operator.openshift.io/cluster patched
[wewang@localhost image_registry]$ oc get kubeapiserver/cluster -o=jsonpath={.spec.forceRedeploymentReason}
ITERATION2
3. Check the ocm and ocm operator, works
[wewang@localhost image_registry]$ oc get pods -n openshift-controller-manager
NAME                       READY   STATUS    RESTARTS   AGE
controller-manager-7jw6t   1/1     Running   0          93m
controller-manager-d6zv6   1/1     Running   0          93m
controller-manager-x74nr   1/1     Running   0          93m
[wewang@localhost image_registry]$ oc get co/openshift-controller-manager
NAME                           VERSION                             AVAILABLE   PROGRESSING   DEGRADED   SINCE   MESSAGE
openshift-controller-manager   4.9.0-0.nightly-2021-09-06-004132   True        False         False      102m

Comment 10 errata-xmlrpc 2021-10-18 17:44:27 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


Note You need to log in before you can comment on or make changes to this bug.