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
Copy file name to clipboardExpand all lines: keps/sig-node/2535-ensure-secret-pulled-images/README.md
+16-11Lines changed: 16 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,16 +69,21 @@ when the `ImagePullPolicy` is `IfNotPresent`.
69
69
70
70
In other words: ensure the pull secrets are rechecked for each new set of credentials, and ensure a pod has access to those images.
71
71
72
-
This policy change will have no affect on the `Always``ImagePullPolicy` or for images that are preloaded.
72
+
For the `Never` policy, the behavior also must change. Otherwise, a user who wishes to use the image of another pod could just use `Never` and hope
73
+
another pod have pulled it. Functionally from a security standpoint, we must account for this.
74
+
Thus, `Never``ImagePullPolicy` images will be allowed past the ensure image stage of the pod lifecyle if the image has previously been pulled
75
+
by an `IfNotPresent` pod successfully: either with no auth, or with the same auth as the `Never` policy. The image will continue to never be pulled
76
+
for this pod.
73
77
74
-
However, for the `Never` policy if a first pod successfully pulled an image
75
-
with credential and then a second pod with pull never tried to use the image,
76
-
when the feature gate is on the second pod will receive an error message, where
77
-
before and with the feature gate off the second pod would be able to use the image
78
-
pulled with credentials by the first pod.
78
+
This will be enforced for both policies regardless of whether the image is already present when the kubelet starts. For an image to be allowed to be used,
79
+
the kubelet must be aware of its credentials.
79
80
80
-
This new feature will be enabled with a feature gate in alpha, as well as two kubelet configuration
81
-
fields `pullImageSecretRecheck` and `pullImageSecretRecheckPeriod`.
81
+
This policy change will have no affect on the `Always``ImagePullPolicy`.
82
+
83
+
This new feature will be enabled with a feature gate in alpha, as well as a kubelet configuration
84
+
field `pullImageSecretRecheck`. Another kubelet configuration field `pullImageSecretRecheckPeriod` will be added
85
+
to allow an admin to configure the recheck period. A recheck period may be used to periodically clean the cache, or ensure
86
+
expiring credentials are still valid.
82
87
83
88
*** The issue and these changes improving the security posture without requiring the forcing of pull always, will be documented in the kubernetes image pull policy documentation. The new feature gate should also be documented in release notes. ***
84
89
@@ -105,7 +110,7 @@ regardless of whether the image is already present on the node.
105
110
106
111
### Goals
107
112
108
-
Modify the current behavior of images with an `IfNotPresent``ImagePullPolicy` enforced by the kubelet to
113
+
Modify the current behavior of images with an `IfNotPresent`and `Never``ImagePullPolicy` enforced by the kubelet to
109
114
ensure the images pulled with a secret by the kubelet are authenticated by the CRI implementation. During the
110
115
EnsureImagesExist step the kubelet will require authentication of present images pulled with auth since boot.
111
116
@@ -125,8 +130,7 @@ runtimes through the CRI wrt. how they should treat the caching of images on a
125
130
node. Such as store for public use but only if encrypted. Or Store for private
126
131
use un-encrypted...
127
132
128
-
This feature will not change the behavior of pod with `ImagePullPolicy``Always`
129
-
and `Never`.
133
+
This feature will not change the behavior of pod with `ImagePullPolicy``Always`.
130
134
131
135
## Proposal
132
136
@@ -477,6 +481,7 @@ Why should this KEP _not_ be implemented. TBD
477
481
- 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
478
482
ensure the image instead of kubelet.
479
483
- Discussions went back and forth as to whether to persist the cache across reboots. It was decided to do so.
484
+
-`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.
0 commit comments