You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webhooks can cause deadlocks in several ways, expand the list to cover more subtle cases.
Co-authored-by: Kat Cosgrove <[email protected]>
Co-authored-by: Tim Bannister <[email protected]>
* If the cluster has multiple webhooks configured (possibly from independent applications deployed on
1257
+
the cluster), they can form a cycle. Webhook A must be called to process startup of webhook B's
1258
+
pods and vice versa. If both webhook A and webhook B ever become unavailable at the same time (for
1259
+
example, due to a cluster-wide outage or a node failure where both pods run on the same node)
1260
+
deadlock occurs because neither webhook pod can be recreated without the other already running.
1261
+
1262
+
One way to prevent this is to exclude webhook A's pods from being acted on be webhook B. This
1263
+
allows webhook A's pods to start, which in turn allows webhook B's pods to start. If you had a
1264
+
third webhook, webhook C, you'd need to exclude both webhook A and webhook B's pods from
1265
+
webhook C. This ensures that webhook A can _always_ start, which then allows webhook B's pods
1266
+
to start, which in turn allows webhook C's pods to start.
1267
+
1268
+
If you want to ensure protection that avoids these risks, [ValidatingAdmissionPolicies](/docs/reference/access-authn-authz/validating-admission-policy/)
1269
+
can
1270
+
provide many protection capabilities without introducing dependency cycles.
1271
+
1272
+
* Admission webhooks can intercept resources used by critical cluster add-ons, such as CoreDNS,
1273
+
network plugins, or storage plugins. These add-ons may be required to schedule or successfully run the
1274
+
pods for a particular admission webhook on the cluster. This can cause a deadlock if both the
1275
+
webhook and critical add-on is unavailable at the same time.
1276
+
1277
+
You may wish to exclude cluster infrastructure namespaces from webhooks, or make sure that
1278
+
the webhook does not depend on the particular add-on that it acts on. For exmaple, running
1279
+
a webhook as a host-networked pod ensures that it does not depend on a networking plugin.
1280
+
1281
+
If you want to ensure protection for a core add-on / or its namespace,
0 commit comments