Kubectl : No resource found

81.5k Views Asked by At

I’ve installed ICP4Data successfully. I am pretty green in respect to ICP4Data and Kubernetes. I’m trying to use kubectl command for listing the pods in ICP4D but “kubectl get pods” returns “No resource found”. Am I missing something?

5

There are 5 best solutions below

0
On

Please try adding namespace to the command as well. In the case for ICP4D try kubectl get pods -n zen.

0
On

icp4d uses 'zen' namespaces to logically separate its assets and resources from the core native icp/kube platform. In the default installation of ICP4D, there are no pods deployed on 'default' namespace and hence you get "no resources found" cause if you don't provide the namespace while trying to get pods, kubectl assumes its default namespace.

To List the pods from zen namespace

  kubectl get pods -n zen

To list all the namespaces available to you - try

kubectl get namespaces

To list pods from all the namespaces, you might want to append --all-namespaces

kubectl get pods --all-namespaces

This should list all the pods from zen, kubesystem and possibly others.

0
On

Check you are currently on which namespace.

To find out your pod is created in which namespace, you can run this command

kubectl get pods --all-namespaces
0
On

On the other hand, you could switch your namespace to zen at the beginning by

kubectl config set-context --current --namespace=zen

Then you will be able to see all the information by running without the -n argument

kubectl get pods
0
On

Also just to add, since I was in default workspace and I wanted to get logs of a pod in another namespace, just doing

kubectl get logs -f <pod_name>

was giving output "Error from server (NotFound): pods "pod_name" not found".

So I specified the namespace as well.

kubectl logs -f <pod_name> -n namespace