Skip to content

Commit 304c494

Browse files
committed
review feedback
Signed-off-by: Anish Ramasekar <[email protected]>
1 parent 609d47c commit 304c494

File tree

1 file changed

+36
-41
lines changed

1 file changed

+36
-41
lines changed

content/en/blog/_posts/XXXX-XX-XX-kubernetes-1-34-sa-tokens-image-pulls-beta.md

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
layout: blog
33
title: "Kubernetes v1.34: Service Account Token Integration for Image Pulls Graduates to Beta"
4-
date: XXXX-XX-XX
4+
date: 2025-08-15
55
slug: kubernetes-v1-34-sa-tokens-image-pulls-beta
6-
draft: true
6+
draft: false
77
author: >
88
[Anish Ramasekar](https://github.com/aramase) (Microsoft)
99
---
1010

1111
The Kubernetes community continues to advance security best practices
1212
by reducing reliance on long-lived credentials.
1313
Following the successful [alpha release in Kubernetes v1.33](/blog/2025/05/07/kubernetes-v1-33-wi-for-image-pulls/),
14-
**Service Account Token Integration for Kubelet Credential Providers**
14+
*Service Account Token Integration for Kubelet Credential Providers*
1515
has now graduated to **beta** in Kubernetes v1.34,
1616
bringing us closer to eliminating long-lived image pull secrets from Kubernetes clusters.
1717

@@ -31,6 +31,7 @@ in the credential provider configuration when using service account tokens.
3131
This field is new in beta and must be specified to ensure proper caching behavior.
3232

3333
```yaml
34+
# CAUTION: this is not a complete configuration example, just a reference for the 'tokenAttributes.cacheType' field.
3435
tokenAttributes:
3536
serviceAccountTokenAudience: "my-registry-audience"
3637
cacheType: "ServiceAccount" # Required field in beta
@@ -47,40 +48,33 @@ Choose between two caching strategies:
4748
- **`ServiceAccount`**: Cache credentials per service account identity
4849
(use when credentials are valid for all pods using the same service account)
4950

50-
### Full integration with Ensure Secret Pull Images
51-
52-
Beta brings **complete compatibility**
53-
with the [Ensure Secret Pull Images](/docs/concepts/containers/images/#ensureimagepullcredentialverification) feature.
54-
This integration ensures that:
55-
56-
- **Service account coordinates are tracked**:
57-
The system tracks which ServiceAccount (namespace, name, UID) was used to pull each image
58-
- **Proper authorization enforcement**:
59-
Pods can only access images that were pulled using credentials
60-
from ServiceAccounts they're authorized to use
61-
- **Lifecycle management**:
62-
Administrators can revoke access by deleting and recreating ServiceAccounts,
63-
which invalidates cached credentials
64-
65-
The authorization model works as follows:
66-
67-
- **Different ServiceAccounts for the same image**:
68-
Pods using different ServiceAccounts will trigger a fresh image pull from the registry
69-
since they have different service account coordinates
70-
- **Same ServiceAccount for the same image**:
71-
Pods using the exact same ServiceAccount (matching namespace, name, and UID)
72-
will be allowed to reuse the previously pulled image without triggering a new registry pull
73-
- **ServiceAccount lifecycle management**:
74-
If administrators want to revoke access to previously pulled images for a ServiceAccount,
75-
they can delete and recreate the ServiceAccount.
76-
This changes the UID, which invalidates any cached image credentials
77-
associated with the old ServiceAccount coordinates
51+
### Isolated image pull credentials
52+
53+
The beta release provides stronger security isolation for container images
54+
when using service account tokens for image pulls.
55+
It ensures that pods can only access images that were pulled using ServiceAccounts they're authorized to use.
56+
This prevents unauthorized access to sensitive container images
57+
and enables granular access control where different workloads can have different registry permissions
58+
based on their ServiceAccount.
59+
60+
When credential providers use service account tokens,
61+
the system tracks ServiceAccount identity (namespace, name, and [UID](/docs/concepts/overview/working-with-objects/names/#uids)) for each pulled image.
62+
When a pod attempts to use a cached image,
63+
the system verifies that the pod's ServiceAccount matches exactly with the ServiceAccount
64+
that was used to originally pull the image.
65+
66+
Administrators can revoke access to previously pulled images
67+
by deleting and recreating the ServiceAccount,
68+
which changes the UID and invalidates cached image access.
69+
70+
For more details about this capability,
71+
see the [image pull credential verification](/docs/concepts/containers/images/#ensureimagepullcredentialverification) documentation.
7872

7973
## How it works
8074

8175
### Configuration
8276

83-
Credential providers opt into using service account tokens
77+
Credential providers opt into using ServiceAccount tokens
8478
by configuring the `tokenAttributes` field:
8579

8680
```yaml
@@ -131,7 +125,7 @@ and the container runtime as follows:
131125
- If they differ, `kubelet` performs a fresh pull
132126
using credentials for the new ServiceAccount
133127

134-
- With Ensure Secret Pull Images enabled:
128+
- With image pull credential verification enabled:
135129
- Authorization is enforced using the recorded ServiceAccount coordinates,
136130
ensuring pods only use images pulled by a ServiceAccount
137131
they are authorized to use
@@ -140,9 +134,9 @@ and the container runtime as follows:
140134

141135
### Audience restriction
142136

143-
The beta release builds on the `ServiceAccountNodeAudienceRestriction` feature
137+
The beta release builds on service account node audience restriction
144138
(beta since v1.33) to ensure `kubelet` can only request tokens for authorized audiences.
145-
Administrators configure allowed audiences using RBAC:
139+
Administrators configure allowed audiences using RBAC to enable kubelet to request service account tokens for image pulls:
146140

147141
```yaml
148142
#
@@ -180,12 +174,13 @@ the migration to beta requires minimal changes:
180174
2. **Review caching strategy**:
181175
Choose between `Token` and `ServiceAccount` cache types based on your provider's behavior
182176
3. **Test audience restrictions**:
183-
Ensure your RBAC configuration properly restricts token audiences
177+
Ensure your RBAC configuration, or other cluster authorization rules, will properly restrict token audiences
184178

185179
### Example setup
186180

187181
Here's a complete example
188-
for setting up a credential provider with service account tokens:
182+
for setting up a credential provider with service account tokens
183+
(this example assumes your cluster uses RBAC authorization):
189184

190185
```yaml
191186
#
@@ -235,12 +230,12 @@ spec:
235230
serviceAccountName: registry-access-sa
236231
containers:
237232
- name: my-app
238-
image: myregistry.io/my-app:latest
233+
image: myregistry.example/my-app:latest
239234
```
240235

241236
## What's next?
242237

243-
For Kubernetes v1.35, we expect the feature to stay in beta,
238+
For Kubernetes v1.35, we - Kubernetes SIG Auth - expect the feature to stay in beta,
244239
and we will continue to solicit feedback.
245240

246241
You can learn more about this feature
@@ -254,9 +249,9 @@ to track progress across the coming Kubernetes releases.
254249
## Call to action
255250

256251
In this blog post,
257-
we have covered the beta graduation of Service Account Token Integration
252+
I have covered the beta graduation of ServiceAccount token integration
258253
for Kubelet Credential Providers in Kubernetes v1.34.
259-
We have discussed the key improvements,
254+
I discussed the key improvements,
260255
including the required `cacheType` field
261256
and enhanced integration with Ensure Secret Pull Images.
262257

0 commit comments

Comments
 (0)