@@ -278,21 +278,15 @@ for information on referencing ServiceAccount credentials from within Pods.
278
278
If you are creating a Secret to store credentials for accessing a container image registry,
279
279
you must use one of the following `type` values for that Secret :
280
280
281
- - ` kubernetes.io/dockercfg`
282
- - ` kubernetes.io/dockerconfigjson`
283
-
284
- The `kubernetes.io/dockercfg` type is reserved to store a serialized
285
- ` ~/.dockercfg` which is the legacy format for configuring Docker command line.
286
- When using this Secret type, you have to ensure the Secret `data` field
287
- contains a `.dockercfg` key whose value is content of a `~/.dockercfg` file
288
- encoded in the base64 format.
289
-
290
- The `kubernetes.io/dockerconfigjson` type is designed for storing a serialized
291
- JSON that follows the same format rules as the `~/.docker/config.json` file
292
- which is a new format for `~/.dockercfg`.
293
- When using this Secret type, the `data` field of the Secret object must
294
- contain a `.dockerconfigjson` key, in which the content for the
295
- ` ~/.docker/config.json` file is provided as a base64 encoded string.
281
+ - `kubernetes.io/dockercfg` : store a serialized `~/.dockercfg` which is the
282
+ legacy format for configuring Docker command line. The Secret
283
+ ` data` field contains a `.dockercfg` key whose value is the content of a
284
+ base64 encoded `~/.dockercfg` file.
285
+ - `kubernetes.io/dockerconfigjson` : store a serialized JSON that follows the
286
+ same format rules as the `~/.docker/config.json` file, which is a new format
287
+ for `~/.dockercfg`. The Secret `data` field must contain a
288
+ ` .dockerconfigjson` key for which the value is the content of a base64
289
+ encoded `~/.docker/config.json` file.
296
290
297
291
Below is an example for a `kubernetes.io/dockercfg` type of Secret :
298
292
@@ -312,7 +306,7 @@ If you do not want to perform the base64 encoding, you can choose to use the
312
306
` stringData` field instead.
313
307
{{< /note >}}
314
308
315
- When you create these types of Secrets using a manifest, the API
309
+ When you create Docker config Secrets using a manifest, the API
316
310
server checks whether the expected key exists in the `data` field, and
317
311
it verifies if the value provided can be parsed as a valid JSON. The API
318
312
server doesn't validate if the JSON actually is a Docker config file.
@@ -328,15 +322,16 @@ kubectl create secret docker-registry secret-tiger-docker \
328
322
--docker-server=my-registry.example:5000
329
323
` ` `
330
324
331
- That command creates a Secret of type `kubernetes.io/dockerconfigjson`.
332
- If you dump the `.data.dockerconfigjson` field from that new Secret and then
333
- decode it from base64 :
325
+ This command creates a Secret of type `kubernetes.io/dockerconfigjson`.
326
+
327
+ Retrieve the `.data.dockerconfigjson` field from that new Secret and decode the
328
+ data :
334
329
335
330
` ` ` shell
336
331
kubectl get secret secret-tiger-docker -o jsonpath='{.data.*}' | base64 -d
337
332
` ` `
338
333
339
- then the output is equivalent to this JSON document (which is also a valid
334
+ The output is equivalent to the following JSON document (which is also a valid
340
335
Docker configuration file) :
341
336
342
337
` ` ` json
0 commit comments