Hands-on Lab·Kubernetes and Cloud Native Security Associate
Private Registry Authentication
Private images need a credential, and Kubernetes stores it as an ordinary Secret with the password in clear. This guide reads it back out, watches a pull fail without it and again with it, and attaches it once to a ServiceAccount instead of to every Pod.
Platform Security Guide 34 of 42 Beginner
- Kubernetesapiserver v1.36.4, kubelet v1.36.3
- Runtimecontainerd 2.2.6
- CNICilium 1.18.1 - tunnel/VXLAN, with Hubble relay and UI
- Host OSUbuntu 26.04 LTS, kernel 7.0.0-29
- Built withkubeadm v1.36.3 - podSubnet 10.244.0.0/16, serviceSubnet 10.96.0.0/12
- TimeAbout 15 min
- Reviewed25 August 2026
Written against the versions above. `kubernetes.io/dockerconfigjson` is base64, not encryption. `imagePullSecrets` on a ServiceAccount is applied to Pods by the ServiceAccount admission plugin.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA5001 | 192.168.0.41 | Ubuntu 26.04 LTS | Control Plane Node (tainted NoSchedule) | 2 Core | 4 GB | 50 GB |
| CKA5001-NODE01 | 192.168.0.42 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA5001-NODE02 | 192.168.0.43 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA5001-NODE03 | 192.168.0.44 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
Before you start
-
A Secret that is a registry login
-
The auth field, which is the same thing twice
-
A Pod that needs the credential and has not got it
-
The same image with the Secret attached
-
Attaching it once instead of on every Pod