Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 974 Bytes

05-Practice-Test-Scheduling.md

File metadata and controls

49 lines (34 loc) · 974 Bytes

Practice Test - Labels and Selectors

Solutions to Practice Test - Labels and Selectors

  • Run the command 'kubectl get pods --selector env=dev'

    $ kubectl get pods --selector env=dev
    
  • Run the command 'kubectl get pods --selector bu=finance'

    $ kubectl get pods --selector bu=finance
    
  • Run the command 'kubectl get all --selector env=prod'

    $ kubectl get all --selector env=prod
    
  • Run the command 'kubectl get all --selector env=prod,bu=finance,tier=frontend'

    $ kubectl get all --selector env=prod,bu=finance,tier=frontend
    
  • Set the labels on the pod definition template to frontend

    $ vi replicaset-definition.yaml
    $ kubectl create -f replicaset-definition.yaml