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
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ authentication.)
110
110
### Goals
111
111
112
112
Modify the current pullIfNotPresent policy management enforced by `kubelet` to
113
-
ensure the images pulled with a secret by `kublet` since boot. During the
113
+
ensure the images pulled with a secret by `kubelet` since boot. During the
114
114
EnsureImagesExist step `kubelet` will require authentication of present images
115
115
pulled with auth since boot.
116
116
@@ -132,8 +132,10 @@ use un-encrypted...
132
132
133
133
## Proposal
134
134
135
-
`kubelet` will keep a list, since boot, of container images that required
135
+
For alpha `kubelet` will keep a list, since boot, of container images that required
136
136
authentication and a list of the authentications that successfully pulled the image.
137
+
For beta the list will be persisted across reboot of host, and restart of kubelet.
138
+
Additionally, an API will be considered to manage the ensure metadata.
137
139
138
140
`kubelet` will ensure any image in the list is always pulled if an authentication
139
141
used is not present, thus enforcing authentication / re-authentication.
@@ -161,12 +163,18 @@ Image authentications with a registry may expire. To mitigate expirations a
161
163
a timeout could be used to force re-authentication. The timeout could be a
162
164
container runtime feature or a `kubelet` feature. If at the container runtime,
163
165
images would not be present during the EnsureImagesExist step, thus would have
164
-
to be pulled and authenticated if necessary.
166
+
to be pulled and authenticated if necessary. This timeout feature will be
167
+
implemented in beta.
165
168
166
169
Since images can be pre-loaded, loaded outside the `kubelet` process, and
167
170
garbage collected.. the list of images that required authentication in `kubelet`
168
171
will not be a source of truth for how all images were pulled that are in the
169
172
container runtime cache. To mitigate, images can be garbage collected at boot.
173
+
And for beta, we will persist ensure metadata across reboot of host, and restart
174
+
of kubelet, and possibly look at a way to add ensure metadata for images loaded
175
+
outside of kubelet. In beta we will add a switch to enable re-auth on boot for
176
+
admins seeking that instead of having to garbage collect where they do not use
177
+
or expect preloaded images since boot.
170
178
171
179
172
180
## Design Details
@@ -178,7 +186,35 @@ See PR for detailed design / behavior documentation.
178
186
179
187
### Test Plan
180
188
181
-
See PR (exhaustive unit tests added for alpha covering feature gate on and off for new and modified functions)
189
+
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:
190
+
- 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)
191
+
- 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:
At beta we should revisit if integration buckets are warranted for e2e node and/or cri-tools/critest, and after gathering feedback.
182
218
183
219
### Graduation Criteria
184
220
@@ -341,7 +377,7 @@ Why should this KEP _not_ be implemented. N/A
341
377
## Alternatives [optional]
342
378
343
379
- Make the behavior change enabled by default by changing the feature gate to true by default instead of false by default.
344
-
- Discussions went back and forth on whether this should go directly to GA as a fix or alpha as a feature gate. It seems this should be the default security posture for pullIfNotPresent as it is not clear to admins/users that an image pulled by a first pod with authentication can be used by a second pod without authentication. The performance cost should be minimal as only the manifest needs to be re-authenticated. But after further review and discussion with MrunalP we'll go ahead and have a kubelet feature gate with default off for alpha in v1.22.
380
+
- Discussions went back and forth on whether this should go directly to GA as a fix or alpha as a feature gate. It seems this should be the default security posture for pullIfNotPresent as it is not clear to admins/users that an image pulled by a first pod with authentication can be used by a second pod without authentication. The performance cost should be minimal as only the manifest needs to be re-authenticated. But after further review and discussion with MrunalP we'll go ahead and have a kubelet feature gate with default off for alpha in v1.23.
345
381
- Set the flag at some other scope e.g. pod spec (doing it at the pod spec was rejected by SIG-Node).
346
382
- 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
0 commit comments