You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/tasks/configure-pod-container/configure-service-account.md
+34-16Lines changed: 34 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,27 +183,38 @@ The content of `token` is elided here.
183
183
184
184
## Add ImagePullSecrets to a service account
185
185
186
-
First, create an imagePullSecret, as described [here](/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod).
187
-
Next, verify it has been created. For example:
186
+
### Create an imagePullSecret
188
187
189
-
```shell
190
-
kubectl get secrets myregistrykey
191
-
```
188
+
- Create an imagePullSecret, as described in [Specifying ImagePullSecrets on a Pod](/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod).
Now, any new pods created in the current namespace will have this added to their spec:
262
+
### Verify imagePullSecrets was added to pod spec
252
263
253
-
```yaml
254
-
spec:
255
-
imagePullSecrets:
256
-
- name: myregistrykey
264
+
Now, when a new Pod is created in the current namespace and using the default ServiceAccount, the new Pod has its `spec.imagePullSecrets` field set automatically:
265
+
266
+
````shell
267
+
kubectl run nginx --image=nginx --restart=Never
268
+
kubectl get pod nginx -o=jsonpath='{.spec.imagePullSecrets[0].name}'
0 commit comments