<p>I tried multiple times and searched a lot but could not figure out why my pod is still in Pending status.</p>
<p>I have a very simple <code>docker-compose.yml</code> file as below:</p>
<pre><code>version: '3'

services:
  nginx:
    build: .
    container_name: &quot;something_cool&quot;
    ports:
      - '80:80'
</code></pre>
<p>and converted it to Kubernetes syntax with <code>kompose</code> command, so it created the two <code>deployment</code> and <code>service</code> files as below.</p>
<p>Deployment:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.22.0 (955b78124)
  creationTimestamp: null
  labels:
    io.kompose.service: nginx
  name: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: nginx
  strategy: {}
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.22.0 (955b78124)
      creationTimestamp: null
      labels:
        io.kompose.service: nginx
    spec:
      containers:
        - image: nginx
          name: something-cool
          ports:
            - containerPort: 80
          resources: {}
      restartPolicy: Always
status: {}
</code></pre>
<p>Service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.22.0 (955b78124)
  creationTimestamp: null
  labels:
    io.kompose.service: nginx
  name: nginx
spec:
  ports:
    - name: &quot;80&quot;
      port: 80
      targetPort: 80
  selector:
    io.kompose.service: nginx
status:
  loadBalancer: {}
</code></pre>
<p>Now that when I run <code>kubectl apply -k .</code>, I see <code>service/nginx configured</code> and <code>deployment.apps/nginx configured</code>, but <code>kubectl get pods</code> shows it in Pending status.</p>
<p>This is the result of grepping pod name in events:</p>
<pre><code>6s        Warning   FailedScheduling               pod/nginx-77546f7866-j5gmd              0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 node(s) had taint {node.kubernetes.io/unreachable: }, that the pod didn't tolerate.
4m4s        Warning   FailedScheduling               pod/nginx-77546f7866-j5gmd              0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 node(s) had taint {node.kubernetes.io/unreachable: }, that the pod didn't tolerate.
5m6s        Normal    SuccessfulCreate               replicaset/nginx-77546f7866             Created pod: nginx-77546f7866-j5gmd
</code></pre>
<p>If I'm correct, I see that I can ping and nslookup kubernetes.io fine, but I'm not sure why I'm getting this error.</p>

Saeed
<p>I solve the issue first by resetting the Kubernetes by the below ways:</p>
<ol>
<li><code>kubeadm reset</code></li>
<li><code>rm ~/.kube/config</code></li>
<li><code>kubeadm init --pod-network-cidr=10.244.0.0/16</code></li>
<li><code>kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml</code></li>
<li><code>kubectl apply -k .</code></li>
</ol>
