Skip to content

Commit 0262549

Browse files
committed
KEP-2535: document writes during MustAttemptImagePull()
1 parent e49b717 commit 0262549

File tree

1 file changed

+20
-0
lines changed
  • keps/sig-node/2535-ensure-secret-pulled-images

1 file changed

+20
-0
lines changed

keps/sig-node/2535-ensure-secret-pulled-images/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Kubelet Caching](#kubelet-caching)
2020
- [Credential Verification Policies](#credential-verification-policies)
2121
- [Writing to the Cache](#writing-to-the-cache)
22+
- [Cache writes upon successful credentials match:](#cache-writes-upon-successful-credentials-match)
2223
- [Failure modes:](#failure-modes)
2324
- [Cache Directory Structure](#cache-directory-structure)
2425
- [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
422423
it will also attempt to find a record of an image currently being in a *pulling*
423424
state.
424425

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+
425444
##### Failure modes:
426445

427446
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
838857
- Set the flag at some other scope e.g. pod spec (doing it at the pod spec was rejected by SIG-Node).
839858
- 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
840859
ensure the image instead of kubelet.
860+
- For beta, we may want to consider deleting cached credentials upon Kubernetes secret / namespace deletion.
841861
- Discussions went back and forth as to whether to persist the cache across reboots. It was decided to do so.
842862
- `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.
843863

0 commit comments

Comments
 (0)