What is the best approach to find the apigroups for a particular resource? Like . . .

Mayur Sharma:
what is the best approach to find the apigroups for a particular resource?
Like for
• pods, apigroups is “”
• Deployment, apigroups is “apps” and “extensions”
But if do run following command, I only see apps in the apigroup

[email protected]:~# kubectl api-resources | grep -i deployment
deployments                       deploy       apps/v1       true        Deployment
[email protected]:~#

MB:
You can check api groups with command : kubectl api-resources
You can see there the api group for each resource

SaidBen:
$ k api-resources | grep deployments

Mayur Sharma:
@MB and @SaidBen Thanks :slightly_smiling_face: Like I mentioned in the post, for deployment I see only apps as apigroup, but for deployment we generally write apps and extensions both in apigroup

For reference please check following lab , https://beta.kodekloud.com/topic/practice-test-role-based-access-controls-2/

Mayur Sharma:
Quoting it from the lab, last question

Grant the dev-user permissions to create deployments in the blue namespace.
Remember to add both groups "apps" and "extensions".

MB:
@Mayur Sharma it seems that extensions is a deprecated api group probably still used for compatibility
https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/