@@ -265,38 +265,26 @@ See [Configure a kubelet image credential provider](/docs/tasks/administer-clust
265
265
The interpretation of ` config.json ` varies between the original Docker
266
266
implementation and the Kubernetes interpretation. In Docker, the ` auths ` keys
267
267
can only specify root URLs, whereas Kubernetes allows glob URLs as well as
268
- prefix-matched paths. This means that a ` config.json ` like this is valid:
268
+ prefix-matched paths. The only limitation is that glob patterns (` * ` ) have to
269
+ include the dot (` . ` ) for each subdomain. The amount of matched subdomains has
270
+ to be equal to the amount of glob patterns (` *. ` ), for example:
271
+
272
+ - ` *.kubernetes.io ` will * not* match ` kubernetes.io ` , but ` abc.kubernetes.io `
273
+ - ` *.*.kubernetes.io ` will * not* match ` abc.kubernetes.io ` , but ` abc.def.kubernetes.io `
274
+ - ` prefix.*.io ` will match ` prefix.kubernetes.io `
275
+ - ` *-good.kubernetes.io ` will match ` prefix-good.kubernetes.io `
276
+
277
+ This means that a ` config.json ` like this is valid:
269
278
270
279
``` json
271
280
{
272
281
"auths" : {
273
- "*my-registry.io/images" : {
274
- "auth" : " …"
275
- }
282
+ "my-registry.io/images" : { "auth" : " …" },
283
+ "*.my-registry.io/images" : { "auth" : " …" }
276
284
}
277
285
}
278
286
```
279
287
280
- The root URL (` *my-registry.io ` ) is matched by using the following syntax:
281
-
282
- ```
283
- pattern:
284
- { term }
285
-
286
- term:
287
- '*' matches any sequence of non-Separator characters
288
- '?' matches any single non-Separator character
289
- '[' [ '^' ] { character-range } ']'
290
- character class (must be non-empty)
291
- c matches character c (c != '*', '?', '\\', '[')
292
- '\\' c matches character c
293
-
294
- character-range:
295
- c matches character c (c != '\\', '-', ']')
296
- '\\' c matches character c
297
- lo '-' hi matches character c for lo <= c <= hi
298
- ```
299
-
300
288
Image pull operations would now pass the credentials to the CRI container
301
289
runtime for every valid pattern. For example the following container image names
302
290
would match successfully:
@@ -305,10 +293,14 @@ would match successfully:
305
293
- ` my-registry.io/images/my-image `
306
294
- ` my-registry.io/images/another-image `
307
295
- ` sub.my-registry.io/images/my-image `
296
+
297
+ But not:
298
+
308
299
- ` a.sub.my-registry.io/images/my-image `
300
+ - ` a.b.sub.my-registry.io/images/my-image `
309
301
310
302
The kubelet performs image pulls sequentially for every found credential. This
311
- means, that multiple entries in ` config.json ` are possible, too:
303
+ means, that multiple entries in ` config.json ` for different paths are possible, too:
312
304
313
305
``` json
314
306
{
0 commit comments