|
19 | 19 | - [Kubelet Caching](#kubelet-caching)
|
20 | 20 | - [Credential Verification Policies](#credential-verification-policies)
|
21 | 21 | - [Writing to the Cache](#writing-to-the-cache)
|
| 22 | + - [Cache writes upon successful credentials match:](#cache-writes-upon-successful-credentials-match) |
22 | 23 | - [Failure modes:](#failure-modes)
|
23 | 24 | - [Cache Directory Structure](#cache-directory-structure)
|
24 | 25 | - [Kubelet Cache Housekeeping](#kubelet-cache-housekeeping)
|
@@ -422,6 +423,24 @@ to retrieve a record of a successfully *pulled* image, and if it does not find a
|
422 | 423 | it will also attempt to find a record of an image currently being in a *pulling*
|
423 | 424 | state.
|
424 | 425 |
|
| 426 | +##### Cache writes upon successful credentials match: |
| 427 | + |
| 428 | +There are two special cases when a new cache entry would be added during the |
| 429 | +`MustAttemptImagePull()` check: |
| 430 | + |
| 431 | +1. A secret coming from the checked pod matches with cached credential hash but has different coordinates (namespace/name/uid). |
| 432 | +2. A secret coming from the checked pod matches with cached secret coordinates but the credential hash is different. |
| 433 | + |
| 434 | +These writes happen in order to prevent unnecessary registry polling in case the |
| 435 | +cached credentials got rotated. |
| 436 | + |
| 437 | +In order to prevent unbound writes in cases of a high namespace turnover, we limit |
| 438 | +these particular `MustAttemptImagePull()` writes to only occur if the number of |
| 439 | +already cached entries per image isn't greater than 100. |
| 440 | + |
| 441 | +For beta we should consider removing cached credentials upon Kubernetes secret / namespace |
| 442 | +deletions. |
| 443 | + |
425 | 444 | ##### Failure modes:
|
426 | 445 |
|
427 | 446 | We should always fail safe. If there's an error reading from the disk, the record
|
@@ -838,6 +857,7 @@ Why should this KEP _not_ be implemented. TBD
|
838 | 857 | - Set the flag at some other scope e.g. pod spec (doing it at the pod spec was rejected by SIG-Node).
|
839 | 858 | - For beta/ga we may revisit/replace the in memory hash map in kubelet design, with an extension to the CRI API for having the container runtime
|
840 | 859 | ensure the image instead of kubelet.
|
| 860 | +- For beta, we may want to consider deleting cached credentials upon Kubernetes secret / namespace deletion. |
841 | 861 | - Discussions went back and forth as to whether to persist the cache across reboots. It was decided to do so.
|
842 | 862 | - `Never` could be always allowed to use an image on the node, regardless of its presence on the node. However, this would functionally disable this feature from a security standpoint.
|
843 | 863 |
|
|
0 commit comments