Skip to content

Commit ff3c38c

Browse files
Apply changes from code review
* Fix wording in some items. * Add some tooltips. * Add blurbs in topics useful for static Pods. * Fix some Pod references to use upper camel case. * Fix title to use sentence case.
1 parent cd00638 commit ff3c38c

File tree

1 file changed

+79
-64
lines changed

1 file changed

+79
-64
lines changed

content/en/docs/concepts/containers/images.md

+79-64
Original file line numberDiff line numberDiff line change
@@ -248,36 +248,53 @@ a name for an image (for example: `pause`, `example/mycontainer`, `kube-apiserve
248248
and allow different systems to fetch the right binary image for the machine
249249
architecture they are using.
250250

251-
Kubernetes itself typically names container images with a suffix `-$(ARCH)`. For
252-
backward compatibility, generate older images with suffixes. For instance,
253-
an image named as `pause` would be a multi-architecture image containing manifests
254-
for all supported architectures, while `pause-amd64` would be a backward-compatible
255-
version for older configurations, or for YAML files with hardcoded image names
256-
containing suffixes.
251+
The Kubernetes project typically creates container images for its releases with
252+
names that include the suffix `-$(ARCH)`. For backward compatibility, generate
253+
older images with suffixes. For instance, an image named as `pause` would be a
254+
multi-architecture image containing manifests for all supported architectures,
255+
while `pause-amd64` would be a backward-compatible version for older configurations,
256+
or for YAML files with hardcoded image names containing suffixes.
257257

258258
## Using a private registry
259259

260-
Private registries may require keys to read images from them.
260+
Private registries may require authentication to be able to discover and/or pull
261+
images from them.
261262
Credentials can be provided in several ways:
262263

264+
- [Specifying `imagePullSecrets` when you define a Pod](#specifying-imagepullsecrets-on-a-pod)
265+
266+
Only Pods which provide their own keys can access the private registry.
267+
263268
- [Configuring Nodes to Authenticate to a Private Registry](#configuring-nodes-to-authenticate-to-a-private-registry)
264-
- all pods can read any configured private registries
265-
- requires node configuration by cluster administrator
266-
- [Kubelet Credential Provider to dynamically fetch credentials for private registries](#kubelet-credential-provider)
267-
- kubelet can be configured to use credential provider exec plugin
268-
for the respective private registry.
269+
- All Pods can read any configured private registries.
270+
- Requires node configuration by cluster administrator.
271+
- Using a _kubelet credential provider_ plugin to [dynamically fetch credentials for private registries](#kubelet-credential-provider)
272+
273+
The kubelet can be configured to use credential provider exec plugin for the
274+
respective private registry.
275+
269276
- [Pre-pulled Images](#pre-pulled-images)
270-
- all pods can use any images cached on a node
271-
- requires root access to all nodes to set up
272-
- [Specifying ImagePullSecrets on a Pod](#specifying-imagepullsecrets-on-a-pod)
273-
- only pods which provide their own keys can access the private registry
277+
- All Pods can use any images cached on a node.
278+
- Requires root access to all nodes to set up.
274279
- Vendor-specific or local extensions
275-
- if you're using a custom node configuration, you (or your cloud
276-
provider) can implement your mechanism for authenticating the node
277-
to the container registry.
280+
281+
If you're using a custom node configuration, you (or your cloud provider) can
282+
implement your mechanism for authenticating the node to the container registry.
278283

279284
These options are explained in more detail below.
280285

286+
### Specifying `imagePullSecrets` on a Pod
287+
288+
{{< note >}}
289+
This is the recommended approach to run containers based on images
290+
in private registries.
291+
{{< /note >}}
292+
293+
Kubernetes supports specifying container image registry keys on a Pod.
294+
All `imagePullSecrets` must be Secrets that exist in the same
295+
{{< glossary_tooltip term_id="namespace" >}} as the
296+
Pod. These Secrets must be of type `kubernetes.io/dockercfg` or `kubernetes.io/dockerconfigjson`.
297+
281298
### Configuring nodes to authenticate to a private registry
282299

283300
Specific instructions for setting credentials depends on the container runtime and registry you
@@ -289,14 +306,17 @@ task. That example uses a private registry in Docker Hub.
289306

290307
### Kubelet credential provider for authenticated image pulls {#kubelet-credential-provider}
291308

292-
{{< note >}}
293-
This approach is especially suitable when the kubelet needs to fetch registry credentials
294-
dynamically. Most commonly used for registries provided by cloud providers where
295-
authentication tokens are short-lived.
296-
{{< /note >}}
309+
You can configure the kubelet to invoke a plugin binary to dynamically fetch
310+
registry credentials for a container image. This is the most robust and versatile
311+
way to fetch credentials for private registries, but also requires kubelet-level
312+
configuration to enable.
297313

298-
You can configure the kubelet to invoke a plugin binary to dynamically fetch registry credentials for a container image.
299-
This is the most robust and versatile way to fetch credentials for private registries, but also requires kubelet-level configuration to enable.
314+
This technique can be especially useful for running {{< glossary_tooltip term_id="static-pod" text="static Pods" >}}
315+
that require container images hosted in a private registry.
316+
Using a {{< glossary_tooltip term_id="service-account" >}} or a
317+
{{< glossary_tooltip term_id="secret" >}} to provide private registry credentials
318+
is not possible in the specification of a static Pod, because it _cannot_
319+
have references to other API resources in its specification.
300320

301321
See [Configure a kubelet image credential provider](/docs/tasks/administer-cluster/kubelet-credential-provider/) for more details.
302322

@@ -321,8 +341,8 @@ This means that a `config.json` like this is valid:
321341
```json
322342
{
323343
"auths": {
324-
"my-registry.io/images": { "auth": "" },
325-
"*.my-registry.io/images": { "auth": "" }
344+
"my-registry.example/images": { "auth": "" },
345+
"*.my-registry.example/images": { "auth": "" }
326346
}
327347
}
328348
```
@@ -331,33 +351,33 @@ Image pull operations pass the credentials to the CRI container runtime for ever
331351
valid pattern. For example, the following container image names would match
332352
successfully:
333353

334-
- `my-registry.io/images`
335-
- `my-registry.io/images/my-image`
336-
- `my-registry.io/images/another-image`
337-
- `sub.my-registry.io/images/my-image`
354+
- `my-registry.example/images`
355+
- `my-registry.example/images/my-image`
356+
- `my-registry.example/images/another-image`
357+
- `sub.my-registry.example/images/my-image`
338358

339359
However, these container image names would *not* match:
340360

341-
- `a.sub.my-registry.io/images/my-image`
342-
- `a.b.sub.my-registry.io/images/my-image`
361+
- `a.sub.my-registry.example/images/my-image`
362+
- `a.b.sub.my-registry.example/images/my-image`
343363

344364
The kubelet performs image pulls sequentially for every found credential. This
345365
means that multiple entries in `config.json` for different paths are possible, too:
346366

347367
```json
348368
{
349369
"auths": {
350-
"my-registry.io/images": {
370+
"my-registry.example/images": {
351371
"auth": ""
352372
},
353-
"my-registry.io/images/subpath": {
373+
"my-registry.example/images/subpath": {
354374
"auth": ""
355375
}
356376
}
357377
}
358378
```
359379

360-
If now a container specifies an image `my-registry.io/images/subpath/my-image`
380+
If now a container specifies an image `my-registry.example/images/subpath/my-image`
361381
to be pulled, then the kubelet will try to download it using both authentication
362382
sources if one of them fails.
363383

@@ -376,33 +396,27 @@ then a local image is used (preferentially or exclusively, respectively).
376396
If you want to rely on pre-pulled images as a substitute for registry authentication,
377397
you must ensure all nodes in the cluster have the same pre-pulled images.
378398

379-
This can be used to preload certain images for speed or as an alternative to authenticating to a
380-
private registry.
399+
This can be used to preload certain images for speed or as an alternative to
400+
authenticating to a private registry.
401+
402+
Similar to the usage of the [kubelet credential provider](#kubelet-credential-provider),
403+
pre-pulled images are also suitable for launching
404+
{{< glossary_tooltip text="static Pods" term_id="static-pod" >}} that depend
405+
on images hosted in a private registry.
381406

382407
{{< note >}}
383408
{{< feature-state feature_gate_name="KubeletEnsureSecretPulledImages" >}}
384409
Access to pre-pulled images may be authorized according to [image pull credential verification](#ensureimagepullcredentialverification).
385410
{{< /note >}}
386411

387-
### Specifying `imagePullSecrets` on a Pod
388-
389-
{{< note >}}
390-
This is the recommended approach to run containers based on images
391-
in private registries.
392-
{{< /note >}}
393-
394-
Kubernetes supports specifying container image registry keys on a Pod.
395-
All `imagePullSecrets` must be Secrets that exist in the same namespace as the
396-
Pod. These Secrets must be of type `kubernetes.io/dockercfg` or `kubernetes.io/dockerconfigjson`.
397-
398-
#### Ensure Image Pull Credential Verification {#ensureimagepullcredentialverification}
412+
#### Ensure image pull credential verification {#ensureimagepullcredentialverification}
399413

400414
{{< feature-state feature_gate_name="KubeletEnsureSecretPulledImages" >}}
401415

402-
If the `KubeletEnsureSecretPulledImages` feature gate is enabled, Kubernetes will
403-
validate image credentials for every image that requires credentials to be pulled,
404-
even if that image is already present on the node. This validation ensures that
405-
images in a Pod request which have not been successfully pulled
416+
If the `KubeletEnsureSecretPulledImages` feature gate is enabled for your cluster,
417+
Kubernetes will validate image credentials for every image that requires credentials
418+
to be pulled, even if that image is already present on the node. This validation
419+
ensures that images in a Pod request which have not been successfully pulled
406420
with the provided credentials must re-pull the images from the registry.
407421
Additionally, image pulls that re-use the same credentials
408422
which previously resulted in a successful image pull will not need to re-pull from
@@ -535,17 +549,18 @@ If you need access to multiple registries, you can create one Secret per registr
535549

536550
## Legacy built-in kubelet credential provider
537551

538-
In older versions of Kubernetes, the kubelet had a direct integration with cloud provider credentials.
539-
This gave it the ability to dynamically fetch credentials for image registries.
552+
In older versions of Kubernetes, the kubelet had a direct integration with cloud
553+
provider credentials. This provided the ability to dynamically fetch credentials
554+
for image registries.
540555

541-
There were three built-in implementations of the kubelet credential provider integration:
542-
ACR (Azure Container Registry), ECR (Elastic Container Registry), and GCR (Google Container Registry).
556+
There were three built-in implementations of the kubelet credential provider
557+
integration: ACR (Azure Container Registry), ECR (Elastic Container Registry),
558+
and GCR (Google Container Registry).
543559

544-
For more information on the legacy mechanism, read the documentation for the version of Kubernetes that you
545-
are using. Kubernetes v1.26 through to v{{< skew latestVersion >}} do not include the legacy mechanism, so
546-
you would need to either:
547-
- configure a kubelet image credential provider on each node
548-
- specify image pull credentials using `imagePullSecrets` and at least one Secret
560+
Starting with version 1.26 of Kubernetes, the legacy mechanism has been removed,
561+
so you would need to either:
562+
- configure a kubelet image credential provider on each node; or
563+
- specify image pull credentials using `imagePullSecrets` and at least one Secret.
549564

550565
## {{% heading "whatsnext" %}}
551566

0 commit comments

Comments
 (0)