Pod pending state

I’m just learning to use Kubernetes and I’m confused why my pod is still pending,
I tried to debug it, and show it like this

my yaml code

apiVersion: v1
kind: Pod
  name: posts
    - name: posts
      image: ryangga/posts:0.0.1 

this is just basic so it’s simple. my Kubernetes is running smoothly, I have searched for it on google and asked on StackOverflow but I can’t find the answer. is there something I’m missing?

Documentation states that pods remain in pending state if they can not be scheduled: Troubleshoot Applications | Kubernetes

In the output of the describe pod command, on the Tolerations sections, the node is tainted as not-ready and unreacheable (Taints and Tolerations | Kubernetes).

My next move would be to run kubectl get nodes -o wide to see if any of the nodes is shown as not ready.

I also wanted to include this earlier, but due to new user restrictions, I can only use one image media. This is my question on stackoverflow for more details


You have only one node and has the “MASTER” role; by default, master nodes are not elegible to schedule workloads (they are used only to manage the cluster).

Try joining a new node to the cluster (a WORKER node) or remove the taint from the master node (https://computingforgeeks.com/how-to-schedule-pods-on-kubernetes-control-plane-node/ is the first result searching in Google for “kubernetes schedule pod in master node” :wink:)

I have removed taint on my master node but my pod is still pending

Cloud you please run kubectl get nodes -o wide again to check if the node has been “un-tainted”? If I am not mistaken, to remove a taint you must suffix the “taint” with a “-” at the end… So the command to remove the “taint” from the node would be kubectl taint node docker-desktop node-role.kubernetes.io/master:NoSchedule- (notice the “-” after the NoSchedule).

Is it like this?

this is a really weird error.

Ok, let’s be positive… What about the output of kubectl describe node docker-desktop?
Is there any other taint that may prevent scheduling pods on the node? Is the field Unschedulable: true? What about the Conditions: section of the output? At the end of the output there is an Allocated resources section that will display how much resources are currently used by pods running in the cluster (kubernetes deploys various components to the kube-system namespace).

P.S I’ve failed to locate a funny (or sad) tweet: “How to live a miserable life in 4 words: ‘Install and use Kubernetes’” :smiley:

thanks for helping me to solve this error. now the pod is running after I reset my docker and Kubernetes. Looks like I made a mistake yesterday, I accidentally reset the cluster while installing Kubernetes. maybe that’s the cause. I’m so dumb :kissing_smiling_eyes: