0

I have a Kubernetes cluster which has 5 different services. After cluster deployment I can run:

kubectl get pods

and see all my pods. But after a few minutes when I run the same command again, I see:

No resources found.

And I'm able to see my pods only after running:

kubectl get pods --all-namespaces

Can someone explain what is my problem?

PjoterS
  • 12,841
  • 1
  • 22
  • 54
alexarsh
  • 5,123
  • 12
  • 42
  • 51
  • on which namespace do your containers run? make sure that your current config is set to this namespace – Amityo Mar 10 '19 at 20:46
  • That's exactly the problem. Kuberenetes adds namespace: dev to my ~/.kube/config. If I delete it, all works, but then Kuberenetes put it there once again after some time. Can't understand when and why – alexarsh Mar 11 '19 at 09:45
  • what's your kubernetes distribution? maybe your setup has a weird controller that does that. also are your pods crashing or they stay in ready state? Maybe `--all-namespaces` shows stopped pods as well. – ahmet alp balkan Mar 11 '19 at 15:14
  • My kubernetes is 1.10.11. My pods staying in the 'Running' state. – alexarsh Mar 12 '19 at 06:36
  • @alexarsh, could you share your deployments, services and kube config? Also `kubectl get pods --all-namespaces -o wide` would be appreciated. – PjoterS Apr 02 '19 at 09:17

0 Answers0