Skip to content

Commit 655d4f3

Browse files
committed
address review comments for minor fixes
Signed-off-by: Andrew Sy Kim <[email protected]>
1 parent a8929d8 commit 655d4f3

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

content/en/blog/_posts/2022-12-22-kubelet-credential-providers/index.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ slug: kubelet-credential-providers
77

88
**Authors:** Andrew Sy Kim (Google), Dixita Narang (Google)
99

10-
Kubernetes v1.26 introduced generally available (GA) support for _kubelet credential
11-
provider plugins_, offering an extensible plugin framework to dynamically fetch credentials
10+
Kubernetes v1.26 introduced generally available (GA) support for [_kubelet credential
11+
provider plugins_]( /docs/tasks/kubelet-credential-provider/kubelet-credential-provider/),
12+
offering an extensible plugin framework to dynamically fetch credentials
1213
for any container image registry.
1314

1415
## Background
@@ -20,7 +21,7 @@ Amazon Elastic Container Registry, Azure Container Registry, and Google Cloud Co
2021
{{< figure src="kubelet-credential-providers-in-tree.png" caption="Figure 1: Kubelet built-in credential provider support for Amazon Elastic Container Registry, Azure Container Registry, and Google Cloud Container Registry." >}}
2122

2223
Kubernetes v1.20 introduced alpha support for kubelet credential providers plugins,
23-
which provide a mechanism for the kubelet to dynamically authenticate and pull images
24+
which provides a mechanism for the kubelet to dynamically authenticate and pull images
2425
for arbitrary container registries - whether these are public registries, managed services,
2526
or even a self-hosted registry.
2627
In Kubernetes v1.26, this feature is now GA
@@ -35,18 +36,18 @@ other than ACR (Azure Container Registry), ECR (Elastic Container Registry), or
3536
The new plugin mechanism can be used in any cluster, and lets you authenticate to new registries without
3637
any changes to Kubernetes itself. Any cloud provider or vendor can publish a plugin that lets you authenticate with their image registry.
3738

38-
## How it Works
39+
## How it works
3940

40-
The kubelet and the credential provider plugin binary communicate through stdio (stdin, stdout, and stderr) by sending and receiving
41+
The kubelet and the exec plugin binary communicate through stdio (stdin, stdout, and stderr) by sending and receiving
4142
json-serialized api-versioned types. If the exec plugin is enabled and the kubelet requires authentication information for an image
42-
that matches against a plugin, the kubelet will exec the plugin binary, passing the `CredentialProviderRequest` API via stdin. Then
43+
that matches against a plugin, the kubelet will execute the plugin binary, passing the `CredentialProviderRequest` API via stdin. Then
4344
the exec plugin communicates with the container registry to dynamically fetch the credentials and returns the credentials in an
4445
encoded response of the `CredentialProviderResponse` API to the kubelet via stdout.
4546

4647
{{< figure src="kubelet-credential-providers-how-it-works.png" caption="Figure 3: Kubelet credential provider plugin flow" >}}
4748

48-
On receiving credentials from the Kubelet, the plugin can also indicate how long credentials can be cached for, to prevent unecessary
49-
execution of the plugin by the Kubelet for subsequent image pull requests to the same registry. In cases where the cache duration
49+
On receiving credentials from the kubelet, the plugin can also indicate how long credentials can be cached for, to prevent unnecessary
50+
execution of the plugin by the kubelet for subsequent image pull requests to the same registry. In cases where the cache duration
5051
is not specified by the plugin, a default cache duration can be specified by the kubelet (more details below).
5152

5253
```json
@@ -56,8 +57,8 @@ is not specified by the plugin, a default cache duration can be specified by the
5657
"auth": {
5758
"cacheDuration": "6h",
5859
"private-registry.io/my-app": {
59-
"username": "“user”",
60-
"password": "token12345"
60+
"username": "exampleuser",
61+
"password": "token12345"
6162
}
6263
}
6364
}
@@ -66,9 +67,9 @@ is not specified by the plugin, a default cache duration can be specified by the
6667
In addition, the plugin can specify the scope in which cached credentials are valid for. This is specified through the `cacheKeyType` field
6768
in `CredentialProviderResponse`. When the value is `Image`, the kubelet will only use cached credentials for future image pulls that exactly
6869
match the image of the first request. When the value is `Registry`, the kubelet will use cached credentials for any subsequent image pulls
69-
that originate from the same registry host, but using different paths (e.g. `gcr.io/foo/bar` and `gcr.io/bar/foo` refer to different images
70-
from the same registry). And lastly, when the value is `Global`, the kubelet will use returned credentials for all images that match against
71-
the plugin, including images that can map to different registry hosts (e.g. gcr.io vs k8s.gcr.io). The `cacheKeyType` field is required by plugin
70+
destined for the same registry host but using different paths (for example, `gcr.io/foo/bar` and `gcr.io/bar/foo` refer to different images
71+
from the same registry). Lastly, when the value is `Global`, the kubelet will use returned credentials for all images that match against
72+
the plugin, including images that can map to different registry hosts (for example, gcr.io vs k8s.gcr.io). The `cacheKeyType` field is required by plugin
7273
implementations.
7374

7475
```json
@@ -78,8 +79,8 @@ implementations.
7879
"auth": {
7980
"cacheKeyType": "Registry",
8081
"private-registry.io/my-app": {
81-
"username": "“user”",
82-
"password": "token12345"
82+
"username": "exampleuser",
83+
"password": "token12345"
8384
}
8485
}
8586
}
@@ -93,7 +94,7 @@ a local directory accessible by the kubelet on every node. Then you set two comm
9394
* `--image-credential-provider-bin-dir`: the path to the directory where credential provider plugin binaries are located.
9495

9596
The configuration file passed into `--image-credential-provider-config` is read by the kubelet to determine which exec plugins should be invoked for a container image used by a Pod.
96-
Note that the name of each "provider" must match the name of the binary located in the local directry specified in `--image-credential-provider-bin-dir`, otherwise the Kubelet
97+
Note that the name of each _provider_ must match the name of the binary located in the local directory specified in `--image-credential-provider-bin-dir`, otherwise the kubelet
9798
cannot locate the path of the plugin to invoke.
9899

99100
```yaml
230 Bytes
Loading

0 commit comments

Comments
 (0)