Certified Kubernetes Administrator (CKA) · Free practice question 3 of 12
Listing cluster-scoped API resources
While writing ClusterRoles at Saffron Lane Hotels, an admin needs a list of all resource types that are not namespaced. Which command produces it?
- A.kubectl explain --scope=cluster
- B.kubectl api-versions --cluster-scoped
- C.kubectl api-resources --namespaced=false
- D.kubectl get all --all-namespaces=false
Show answer and explanation
Correct answer: C. kubectl api-resources --namespaced=false
Why: kubectl api-resources lists every resource the API server serves, with short names, API groups and whether each is namespaced, and --namespaced=false filters to cluster-scoped kinds such as nodes and persistentvolumes. api-versions only lists group versions, get all returns a subset of namespaced objects, and explain documents fields of one resource.
More free Certified Kubernetes Administrator (CKA) questions
- Drain flags for DaemonSets and emptyDir
- CronJob concurrencyPolicy Forbid
- Setting the default namespace in a context
- Session affinity by client IP
- Pod dnsPolicy Default versus ClusterFirst
- Raw block volumes with volumeMode
- Debugging a node with kubectl debug
- CreateContainerConfigError from missing ConfigMap
- Approving a client CertificateSigningRequest
- NetworkPolicy ipBlock with except
- Restoring a PVC from a VolumeSnapshot