<p>I accidentally deleted the core DNS using kubectl delete deployment coredns -n kube-system
how to do I get the coredns pods to run again....</p>
<pre><code>I recreated the coredns using kubectl create deployment coredns -n kube-system --image=k8s.gcr.io/coredns:1.7.0 but nslookup is failing is there any way to correct it. root@km1:~# kubectl get pods --all-namespaces -o wide
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE   IP              NODE   NOMINATED NODE   READINESS GATES
default       dnsutils                                   2/2     Running   9          22h   10.10.159.72    kw1    &lt;none&gt;           &lt;none&gt;
kube-system   calico-kube-controllers-5c6f6b67db-mp9jg   1/1     Running   2          26h   10.10.132.201   km1    &lt;none&gt;           &lt;none&gt;
kube-system   calico-node-fscgw                          1/1     Running   2          26h   192.168.0.215   km1    &lt;none&gt;           &lt;none&gt;
kube-system   calico-node-m78kx                          1/1     Running   1          25h   192.168.0.204   kw1    &lt;none&gt;           &lt;none&gt;
kube-system   coredns-5646d5bb85-77pxl                   1/1     Running   0          12m   10.10.159.74    kw1    &lt;none&gt;           &lt;none&gt;
kube-system   etcd-km1                                   1/1     Running   2          26h   192.168.0.215   km1    &lt;none&gt;           &lt;none&gt;
kube-system   kube-apiserver-km1                         1/1     Running   2          26h   192.168.0.215   km1    &lt;none&gt;           &lt;none&gt;
kube-system   kube-controller-manager-km1                1/1     Running   3          26h   192.168.0.215   km1    &lt;none&gt;           &lt;none&gt;
kube-system   kube-proxy-h5pz5                           1/1     Running   1          25h   192.168.0.204   kw1    &lt;none&gt;           &lt;none&gt;
kube-system   kube-proxy-qdp4w                           1/1     Running   2          26h   192.168.0.215   km1    &lt;none&gt;           &lt;none&gt;
kube-system   kube-scheduler-km1                         1/1     Running   3          26h   192.168.0.215   km1    &lt;none&gt;           &lt;none&gt;

</code></pre>

<p>Official coredns repo on github provides deploy.sh script that generates coredns yaml file. <a href="https://github.com/coredns/deployment/tree/master/kubernetes#deploysh-and-corednsyamlsed" rel="nofollow noreferrer">Checkout this link</a>.</p>
<p>All you need to do is to clone the repo, go to <em>deployment/kubernetes</em> directory and run:</p>
<pre><code>$ ./deploy.sh | kubectl apply -f -
</code></pre>
