sidrah junaid
sidrah junaid

Reputation: 447

Kubectl : No resource found

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?

Upvotes: 25

Views: 85860

Answers (5)

Ayesha
Ayesha

Reputation: 311

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

Upvotes: 3

Jonathan Chow
Jonathan Chow

Reputation: 1467

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

Upvotes: 8

Radha
Radha

Reputation: 81

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

Upvotes: 2

Anita Srivastava
Anita Srivastava

Reputation: 61

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

Upvotes: 6

Sachin Prasad
Sachin Prasad

Reputation: 551

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.

Upvotes: 55

Related Questions