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
We will add support in kubelet for the `pullIfNotPresent` image pull policy, for
@@ -136,6 +133,9 @@ runtimes through the CRI wrt. how they should treat the caching of images on a
136
133
node. Such as store for public use but only if encrypted. Or Store for private
137
134
use un-encrypted...
138
135
136
+
This feature will not change the behavior of pod with image pull policy `Always`
137
+
and `Never`.
138
+
139
139
## Proposal
140
140
141
141
For alpha `kubelet` will keep a list, across reboots of host and restart of
@@ -149,14 +149,15 @@ used is not present, thus enforcing authentication / re-authentication.
149
149
### User Stories
150
150
151
151
#### Story 1
152
+
152
153
User with multiple tenants will be able to support all image pull policies without
153
154
concern that one tenant will gain access to an image that they don't have rights to.
154
155
155
156
#### Story 2
157
+
156
158
User will will no longer have to inject the Pull Always Image Pull Policy to
157
159
ensure all tenants have rights to the images that are already present on a host.
158
160
159
-
160
161
### Notes/Constraints/Caveats (Optional)
161
162
162
163
With the default of the feature gate being off, users / cloud providers will have
@@ -183,8 +184,8 @@ or expect preloaded images since boot.
183
184
184
185
## Design Details
185
186
186
-
Kubelet will track, in memory, a hash map for the credentials that were successfully used to pull an image. The hash map
187
-
will not be persisted to disk, in alpha. For alpha explicitly, we will not reuse or add other state manager concepts to kubelet.
187
+
Kubelet will track, in memory, a hash map for the credentials that were successfully
188
+
used to pull an image.
188
189
189
190
See PR linked above for detailed design / behavior documentation.
190
191
@@ -193,15 +194,18 @@ the expired duration configurable. The default value could be 1d. For a pod with
193
194
IfNotPresent image pull policy and an image pull secret, kubelet will recheck
194
195
the secret after `PullImageSecretRecheckDuration`.
195
196
196
-
To make the cluster in most secure situation, set `PullImageSecretRecheckDuration` to 0,
197
-
which means always recheck.
197
+
Use image pull policy `Always` if user want to recheck the secret everytime.
198
198
199
-
If user doesn't want to do recheck, set `PullImageSecretRecheckDuration` to -1 to disable recheck.
199
+
For image pull policy "if not present", when admin/user doesn't want to automatically
200
+
recheck the secret, set `PullImageSecretRecheckDuration` to 0 to disable it(which means
201
+
never recheck).
200
202
201
-
For kubelet restart, recheck is acceptable, because kubelet only restart when upgrade or in maintennance modes in most cases.
203
+
Note: using the tag `:latest`is equivalent to using the image pull policy `Always.`
202
204
203
-
- upgrade: user needs to drain the node according to the best practice, and re-check is acceptable. (Honestly, many users don't)
204
-
- other scanerios(like changing a configuration or some restart scripts for memory leak): still some maintenance modes.
205
+
Note: since the cache is not persisted to disk, a recheck will happen every kubelet restart.
206
+
This is acceptable because kubelet only restarts during upgrades or in maintenance modes.
207
+
In other words, it should be relatively infrequent(and much less frequent than the default
208
+
value of `PullImageSecretRecheckDuration`).
205
209
206
210
### Test Plan
207
211
@@ -211,39 +215,43 @@ necessary to implement this enhancement.
211
215
212
216
##### Prerequisite testing updates
213
217
214
-
215
218
##### Unit tests
216
219
217
220
For alpha, exhaustive Kubelet unit tests will be provided. Functions affected by the feature gate will be run with the feature gate on and with the feature gate off. Unit buckets will be provided for:
221
+
218
222
- HashAuth - (new, small) returns a hash code for a CRI pull image auth [link](https://github.com/kubernetes/kubernetes/pull/94899/files#diff-ca08601dfd2fdf846f066d0338dc332beddd5602ab3a71b8fac95b419842da63R704-R751)** per review comment will use SHA256 **
219
223
- shouldPullImage - (modified, large sized change) determines if image should be pulled based on presence, and image pull policy, and now with the feature gate on if the image has been pulled/ensured by a secret. A unit test bucket did not exist for this function. The unit bucket will cover a matrix for:
Additionally, for Alpha we will update this readme with an enumeration of the core packages being touched by the PR to implement this enhancement and provide the current unit coverage for those in the form of:
0 commit comments