<p>It works in dotted notation (Object.apiVersion.APIGroup), for e.g. deployments this way: <code>kubectl get deployments.v1.apps</code> In your case just try:</p>

<pre><code>kubectl get issuer.v1alpha2.cert-manager.io -n=default
</code></pre>

CC BY-SA 4.0
2020-04-03T11:58:43.547Z
Thanks. It worked.
Jagrut Trivedi
CC BY-SA 4.0
2020-04-03T10:06:31.183Z
2020-04-03T10:06:31.183Z
Anton Matsiuk
<p>I am trying to list down resources which is in different api group. I am running the below command</p>

<pre><code>[jk@ome-esrs-adapter-master csadmin]# kubectl get issuers -n default
Error from server (NotFound): Unable to list "certmanager.k8s.io/v1alpha1, Resource=issuers": the server could not find the requested resource (get issuers.certmanager.k8s.io)
</code></pre>

<p>As you can see it is not listing any issuer which is in default space because it is searching in this api group "certmanager.k8s.io/v1alpha1" and acutal resource is in "cert-manager.io/v1alpha2" this API group so, I have specify api group in rest call and it is listing the issuer</p>

<pre><code>[jk@ome-esrs-adapter-master csadmin]# curl http://localhost:8080/apis/cert-manager.io/v1alpha2/issuers | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   975  100   975    0     0  47140      0 --:--:-- --:--:-- --:--:-- 48750
{
  "apiVersion": "cert-manager.io/v1alpha2",
  "items": [
    {
      "apiVersion": "cert-manager.io/v1alpha2",
      "kind": "Issuer",
      "metadata": {
        "annotations": {
          "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"cert-manager.io/v1alpha2\",\"kind\":\"Issuer\",\"metadata\":{\"annotations\":{},\"name\":\"ca-issuer\",\"namespace\":\"default\"},\"spec\":{\"ca\":{\"secretName\":\"nginxsecret\"}}}\n"
        },
        "creationTimestamp": "2020-04-02T13:05:56Z",
        "generation": 1,
        "name": "ca-issuer",
        "namespace": "default",
        "resourceVersion": "67806",
        "selfLink": "/apis/cert-manager.io/v1alpha2/namespaces/default/issuers/ca-issuer",
        "uid": "2970a3e5-6d0c-4f2b-964d-4598be9beaa3"
      },
      "spec": {
        "ca": {
          "secretName": "nginxsecret"
        }
      },
      "status": {
        "conditions": [
          {
            "lastTransitionTime": "2020-04-02T13:05:53Z",
            "message": "Signing CA verified",
            "reason": "KeyPairVerified",
            "status": "True",
            "type": "Ready"
          }
        ]
      }
    }
  ],
  "kind": "IssuerList",
  "metadata": {
    "continue": "",
    "resourceVersion": "284959",
    "selfLink": "/apis/cert-manager.io/v1alpha2/issuers"
  }
}
</code></pre>

<p>can anyone please help how to tell kubectl to look into diffrent API groups? Because I am sure that resource is there as rest api is working and when I reapply yaml file it says Issuer unchanged.</p>

<kubernetes><cert-manager>
How to tell kubectl to use different api groups
Jagrut Trivedi
# How to tell kubectl to use different api groups

(Asked by: username_0 on 2020-04-03)

I am trying to list down resources which is in different api group. I am running the below command
[jk@ome-esrs-adapter-master csadmin]# kubectl get issuers -n default
Error from server (NotFound): Unable to list "certmanager.k8s.io/v1alpha1, Resource=issuers": the server could not find the requested resource (get issuers.certmanager.k8s.io)

As you can see it is not listing any issuer which is in default space because it is searching in this api group "certmanager.k8s.io/v1alpha1" and acutal resource is in "cert-manager.io/v1alpha2" this API group so, I have specify api group in rest call and it is listing the issuer
[jk@ome-esrs-adapter-master csadmin]# curl http://localhost:8080/apis/cert-manager.io/v1alpha2/issuers | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   975  100   975    0     0  47140      0 --:--:-- --:--:-- --:--:-- 48750
{
  "apiVersion": "cert-manager.io/v1alpha2",
  "items": [
    {
      "apiVersion": "cert-manager.io/v1alpha2",
      "kind": "Issuer",
      "metadata": {
        "annotations": {
          "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"cert-manager.io/v1alpha2\",\"kind\":\"Issuer\",\"metadata\":{\"annotations\":{},\"name\":\"ca-issuer\",\"namespace\":\"default\"},\"spec\":{\"ca\":{\"secretName\":\"nginxsecret\"}}}\n"
        },
        "creationTimestamp": "2020-04-02T13:05:56Z",
        "generation": 1,
        "name": "ca-issuer",
        "namespace": "default",
        "resourceVersion": "67806",
        "selfLink": "/apis/cert-manager.io/v1alpha2/namespaces/default/issuers/ca-issuer",
        "uid": "2970a3e5-6d0c-4f2b-964d-4598be9beaa3"
      },
      "spec": {
        "ca": {
          "secretName": "nginxsecret"
        }
      },
      "status": {
        "conditions": [
          {
            "lastTransitionTime": "2020-04-02T13:05:53Z",
            "message": "Signing CA verified",
            "reason": "KeyPairVerified",
            "status": "True",
            "type": "Ready"
          }
        ]
      }
    }
  ],
  "kind": "IssuerList",
  "metadata": {
    "continue": "",
    "resourceVersion": "284959",
    "selfLink": "/apis/cert-manager.io/v1alpha2/issuers"
  }
}

can anyone please help how to tell kubectl to look into diffrent API groups? Because I am sure that resource is there as rest api is working and when I reapply yaml file it says Issuer unchanged.

**Tags:** kubernetes, cert-manager


---

## 1 answers

### Answer by username_1 on 2020-04-03. Score: 1 | Accepted answer

It works in dotted notation (Object.apiVersion.APIGroup), for e.g. deployments this way: kubectl get deployments.v1.apps In your case just try:
kubectl get issuer.v1alpha2.cert-manager.io -n=default

> **Comments:**
> **username_0**: Thanks. It worked.  

---

