Skip to content

Commit fc27b94

Browse files
shannonxtremefasaxckatcosgroveTim Bannister
committed
Add dependency loop advice.
Source PR: #46798 Co-authored-by: Shaun Crampton <[email protected]> Co-authored-by: Kat Cosgrove <[email protected]> Co-authored-by: Tim Bannister <[email protected]>
1 parent 136525c commit fc27b94

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

content/en/docs/concepts/cluster-administration/admission-webhooks-good-practices.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,27 @@ result, the migration cannot happen.
371371
Exclude the namespace where your webhook is running with a
372372
[`namespaceSelector`](/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-namespaceselector).
373373

374+
### Avoid dependency loops {#avoid-dependency-loops}
375+
376+
Dependency loops can occur in scenarios like the following:
377+
378+
* Two webhooks check each other's Pods. If both webhooks become unavailable
379+
at the same time, neither webhook can start.
380+
* Your webhook intercepts cluster add-on components, such as networking plugins
381+
or storage plugins, that your webhook depends on. If both the webhook and the
382+
dependent add-on become unavailable, neither component can function.
383+
384+
To avoid these dependency loops, try the following:
385+
386+
* Use
387+
[ValidatingAdmissionPolicies](/docs/reference/access-authn-authz/validating-admission-policy/)
388+
to avoid introducing dependencies.
389+
* Prevent webhooks from validating or mutating other webhooks. Consider
390+
[excluding specific namespaces](/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-namespaceselector)
391+
from triggering your webhook.
392+
* Prevent your webhooks from acting on dependent add-ons by using an
393+
[`objectSelector`](/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-objectselector).
394+
374395
### Fail open and validate the final state {#fail-open-validate-final-state}
375396

376397
Mutating admission webhooks support the `failurePolicy` configuration field.

0 commit comments

Comments
 (0)