Welcome to the Linux Foundation Forum!

Difference in a requesting objects in kubernetes

davidfedor
davidfedor Posts: 3
edited September 8 in LFD259 Class Forum

Can anybody help to find answer to a question what is the difference requesting deployment object like this two ways?

kubectl get deployment name-of-deployment
kubectl get deployments.apps name-of-deployment

I have seen this ways of requesting also in the labs e.g.
[email protected]: ̃$ kubectl create deployment design2 --image=nginx
[email protected]: ̃$ kubectl get deployments.apps design2 -o wide

Best Answer

  • chrispokorni
    chrispokorni Posts: 1,214
    Accepted Answer

    Hi @davidfedor,

    There should be no difference between kubectl get deployment and kubectl get deployments.apps commands. The API object type can include the API group, such as .apps, added by the kubectl autocompletion feature.

    Did you happen to notice any differences in output?

    Regards,
    -Chris

Answers

  • Also similar selection seen at cronjobs:
    [email protected]: ̃$ kubectl get cronjobs.batch

  • @chrispokorni thanks, no I forgot to mention that the result was actually the same, so I just wanted to know whether it has something to do with more then just executing the same thing in a different way. So thank you!

  • chrispokorni
    chrispokorni Posts: 1,214

    Hi @davidfedor,

    A feature that may look confusing, but helpful when using API resources that are maturing, or may be migrating between API groups. Being able to see the API group confirms the use of the desired API object definition with all relevant properties and features.

    Regards,
    -Chris

Categories

Upcoming Training