Kubectl : No resource found
Asked Answered
P

5

25

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?

Prolamine answered 16/11, 2018 at 20:54 Comment(1)
What output do you get from kubectl cluster-info? You might not be correctly configured to access the cluster. See this kubernetes doc page. You might also need to specify a namespace in your command.Embrey
W
55

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.

Weekly answered 19/11, 2018 at 21:12 Comment(0)
A
8

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
Animatism answered 28/10, 2020 at 12:11 Comment(0)
F
6

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

Forefront answered 19/11, 2018 at 20:59 Comment(0)
P
3

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
Pegram answered 4/8, 2021 at 7:52 Comment(0)
T
2

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
Trotline answered 18/6, 2020 at 11:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.