Rahul
Rahul

Reputation: 1579

Kubectl : No resource found even tough there are pods running in the namespace

I have 2 pods running on default namespace as shown below

 NAMESPACE     NAME                               READY   STATUS    RESTARTS      AGE
default       alpaca-prod                        1/1     Running   0             36m
default       alpaca-test                        1/1     Running   0             4m26s
kube-system   coredns-78fcd69978-xd7jw           1/1     Running   0             23h

But when I try to get deployments I do not see any

kubectl get deployments 
No resources found in default namespace.

Can someone explain this behavior ?

I am running k8 on Minikube.

Upvotes: 0

Views: 1592

Answers (1)

laimison
laimison

Reputation: 1698

I think these are pods which were spawned without Deployment, StatefulSet or DaemonSet.


You can run pod like this using the command, e.g.:

kubectl run nginx-test --image=nginx -n default

pods created via DaemonSet usually end with -xxxxx

pods created via Deployment usually end with -xxxxxxxxxx-xxxxx

pods created via StatefulSet usually end with -0, -1 etc.

pods created without upper resource, usually have exact name as you specified e.g. nginx-test, nginx, etc.


So my guess that is a standalone Pod resource (last option)

Upvotes: 1

Related Questions