Bug 2011369 - [4.9.z] caBundle not updated on kube-admission-webhook pods: etcdserver: request is too large
Summary: [4.9.z] caBundle not updated on kube-admission-webhook pods: etcdserver: requ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Networking
Version: 4.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.9.1
Assignee: Ram Lavi
QA Contact: Meni Yakove
URL:
Whiteboard:
: 2011636 (view as bug list)
Depends On:
Blocks: 2011376 2011746
TreeView+ depends on / blocked
 
Reported: 2021-10-06 13:54 UTC by Ram Lavi
Modified: 2024-12-20 21:19 UTC (History)
4 users (show)

Fixed In Version: kubemacpool-v4.9.1-3 kubernetes-nmstate-handler-v4.9.1-4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2011376 (view as bug list)
Environment:
Last Closed: 2021-12-13 19:59:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:5091 0 None None None 2021-12-13 19:59:15 UTC

Description Ram Lavi 2021-10-06 13:54:44 UTC
Description of problem:
caBundles are stored on the mutatingWebhookConfiguration instance.
Kubemacpool and kubernetes-nmstate components use kube-admission-webhook (https://github.com/qinqon/kube-admission-webhook) pod to rotate ca certs and append them to the appropriate mutatingWebhookConfiguration.
After a large amount of rotations (~700+) then the caBundle appended to mutatingWebhookConfiguration cannot be applied due to etcd's APPLY side restirction (1.5Mb)

This results with the kubemacpool/kubernetes pods to decline requests on 
```
x509: certificate has expired or is not yet valid
```

on the kube-admission-webhook logs one can see that it fails to apply the caBundle:
```
failed rotating all certs: failed adding new CA cert to CA bundle at webhook: failed to update webhook CABundle: failed to update webhook CABundle: etcdserver: request is too large
```


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. manually cause a lot of ca rotations on kubemacpool/kubernetes-nmstate.
2.
3.

Actual results:
VM cannot be created, due to "x509: certificate has expired or is not yet valid"

Expected results:
VM should be able to be created with no errors.

Additional info:

Comment 2 Ram Lavi 2021-10-07 12:27:04 UTC
KAW bump on KMP: https://github.com/k8snetworkplumbingwg/kubemacpool/pull/338

Comment 3 Ram Lavi 2021-10-07 13:29:14 UTC
KAW bump in KNMSTATE: https://github.com/nmstate/kubernetes-nmstate/pull/851

Comment 4 Petr Horáček 2021-10-21 13:02:27 UTC
*** Bug 2011636 has been marked as a duplicate of this bug. ***

Comment 5 Ram Lavi 2021-10-31 21:14:03 UTC
change merged to CNV4.9 since http://cnv-version-explorer.apps.cnv.engineering.redhat.com/BundleDetails?ver=v4.9.0-260

Comment 6 Yossi Segev 2021-11-22 16:34:48 UTC
Verified the following way:
1. I deleted the nmstate secret (in openshift-cnv namespace) infinitely every 5 seconds using a script.
2. I sampled the output of the nmstate mutatingwebhookconfiguration after several iterations.
The output size kept growing, until it remained steady after ~100 iterations. On the point, I verified that the caBundle part in the continued to update.


OCP 4.9.6
CNV 4.9.1
nmstate-handler v4.9.1-7
kubemacpool v4.9.1-3

Comment 12 errata-xmlrpc 2021-12-13 19:59:01 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 (OpenShift Virtualization 4.9.1 Images), 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/RHBA-2021:5091


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