Skip to content

Latest commit

 

History

History
81 lines (47 loc) · 1.56 KB

20-Practice-Test-Cluster-Roles.md

File metadata and controls

81 lines (47 loc) · 1.56 KB

Practice Test - Cluster Roles

Solutions to practice test - cluster roles

  • Run the command kubectl get clusterroles --no-headers | wc -l or kubectl get clusterroles --no-headers -o json | jq '.items | length'

    $ kubectl get clusterroles --no-headers | wc -l (or)
    $ kubectl get clusterroles --no-headers -o json | jq '.items | length'
    
  • Run the command kubectl get clusterrolebindings --no-headers | wc -l or kubectl get clusterrolebindings --no-headers -o json | jq '.items | length'

    $ kubectl get clusterrolebindings --no-headers | wc -l (or)
    $ kubectl get clusterrolebindings --no-headers -o json | jq '.items | length'
    
  • What namespace is the cluster-admin clusterrole part of?

    $ Cluster roles are cluster wide and not part of any namespace
    
  • Run the command kubectl describe clusterrolebinding cluster-admin

    $ kubectl describe clusterrolebinding cluster-admin
    
  • Run the command kubectl describe clusterrole cluster-admin

    $ kubectl describe clusterrole cluster-admin
    
  • Check answer at /var/answers

    $ kubectl create -f /var/answers/michelle-node-admin.yaml
    
  • Check answer at /var/answers

    $ kubectl create -f /var/answers/michelle-storage-admin.yaml