Bird
0
0

Given a Custom Resource named myresource in namespace default, what command lists all instances of this resource?

medium📝 Command Output Q4 of 15
Kubernetes - Operators and Custom Resources
Given a Custom Resource named myresource in namespace default, what command lists all instances of this resource?
Akubectl get myresource -n default
Bkubectl describe crd myresource
Ckubectl get pods -n default
Dkubectl get crd myresource
Step-by-Step Solution
Solution:
  1. Step 1: Identify command to list custom resource instances

    To list instances of a custom resource, use kubectl get <resource> with the resource name and namespace.
  2. Step 2: Differentiate from CRD commands

    kubectl describe crd and kubectl get crd show CRD definitions, not instances. kubectl get pods lists pods, unrelated here.
  3. Final Answer:

    kubectl get myresource -n default -> Option A
  4. Quick Check:

    List custom resource instances = kubectl get resource [OK]
Quick Trick: Use kubectl get with resource name and namespace to list instances [OK]
Common Mistakes:
  • Using crd commands to list resource instances
  • Listing pods instead of custom resources

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes