- Take me to the Lab
Solutions Lab - Image Security:
-
The
nginx:alpine
image is the application using. -
Use the
kubectl edit deployment
command to edit the image name tomyprivateregistry.com:5000/nginx:alpine
.$ kubectl edit deployment web
-
Run the command
kubectl get pods
command and check the status of the pods.$ kubectl get pods
-
Create a secret object with the credentials required to access the registry.
$ kubectl create secret docker-registry private-reg-cred --docker-username=dock_user --docker-password=dock_password --docker-server=myprivateregistry.com:5000 [email protected]
-
Configure the deployment to use credentials from the new secret to pull images from the private registry
$ Edit deployment using kubectl edit deploy web command and add imagePullSecrets section. Use private-reg-cred
-
To Check the status of PODs, Run
$ kubectl get pods