Skip to content

Latest commit

 

History

History
executable file
·
57 lines (34 loc) · 1.18 KB

File metadata and controls

executable file
·
57 lines (34 loc) · 1.18 KB

Lab - Image Security

  • 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 to myprivateregistry.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