<p>How do I determine which  <code>apiGroup</code> any given resource belongs in?</p>

<pre><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  namespace: default
  name: thing
rules:
- apiGroups: ["&lt;wtf goes here&gt;"]
  resources: ["deployments"]
  verbs: ["get", "list"]
  resourceNames: []
</code></pre>

Cole Bittel
<p>To get API resources - supported by your Kubernetes cluster:</p>

<pre><code> kubectl api-resources -o wide

example:
NAME                              SHORTNAMES   APIGROUP                       NAMESPACED   KIND                             VERBS
deployments                       deploy       apps                           true         Deployment                   [create delete deletecollection get list patch update watch]
deployments                       deploy       extensions                     true         Deployment                   [create delete deletecollection get list patch update watch]
</code></pre>

<p>To get API versions -  supported by your Kubernetes cluster:</p>

<pre><code>kubectl api-versions
</code></pre>

<p>You can verify f.e. deployment:</p>

<pre><code>kubectl explain deploy 

KIND:     Deployment
VERSION:  extensions/v1beta1

DESCRIPTION:
     DEPRECATED - This group version of Deployment is deprecated by
     apps/v1beta2/Deployment.
</code></pre>

<p>Furthermore you can investigate with api-version:</p>

<pre><code>kubectl explain deploy --api-version apps/v1
</code></pre>

<p>Shortly you an specify in you apiGroups like:</p>

<pre><code>apiGroups: ["extensions", "apps"]
</code></pre>

<p>You can also configure those settings for your cluster using (for example to test it will work with next <a href="https://kubernetes.io/docs/reference/using-api/api-overview/#enabling-api-groups" rel="noreferrer">1.16 release</a>) by passing options into <code>--runtime-config</code>  in <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/#kube-apiserver" rel="noreferrer">kube-apiserver</a>. </p>

<p>Additional resources:</p>

<ul>
<li><a href="https://akomljen.com/kubernetes-api-resources-which-group-and-version-to-use/" rel="noreferrer">api Resources</a>: </li>
<li><a href="https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-parts-of-the-api" rel="noreferrer">Kubernetes Deprecation Policy</a>  </li>
<li><p>Additional Notable Feature Updates <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.15.md#kubernetes-v115-release-notes" rel="noreferrer">for specific release please follow</a>  like:</p>

<p><code>Continued deprecation of extensions/v1beta1, apps/v1beta1, and apps/v1beta2 APIs; these extensions will be retired in 1.16!</code></p></li>
</ul>
