<p>Include:</p>

<ul>
<li>Daemon Sets</li>
<li>Deployments</li>
<li>Jobs</li>
<li>Pods</li>
<li>Replica Sets</li>
<li>Replication Controllers</li>
<li>Stateful Sets</li>
<li>Services</li>
<li>...</li>
</ul>

<p>If has replicationcontroller, when delete some deployments they will regenerate. Is there a way to make kubenetes back to initialize status?</p>

<p><strong>Method 1</strong>: To delete everything from the current namespace (which is normally the <em>default</em> namespace) using <code>kubectl delete</code>:</p>

<pre><code>kubectl delete all --all
</code></pre>

<p><code>all</code> refers to all resource types such as pods, deployments, services, etc. <code>--all</code> is used to delete every object of that resource type instead of specifying it using its name or label.  </p>

<p>To delete everything from a certain namespace you use the -n flag:</p>

<pre><code>kubectl delete all --all -n {namespace}
</code></pre>

<p><strong>Method 2</strong>: You can also delete a namespace and re-create it. This will delete everything that belongs to it:</p>

<pre><code>kubectl delete namespace {namespace}
kubectl create namespace {namespace}
</code></pre>

<p><strong>Note</strong> (thanks <a href="https://stackoverflow.com/users/2604813/marcus">@Marcus</a>): <code>all</code> in kubernetes <a href="https://github.com/kubernetes/kubectl/issues/151" rel="noreferrer">does not refers to every kubernetes object</a>, such as admin level resources (limits, quota, policy, authorization rules). If you really want to make sure to delete eveything, it's better to delete the namespace and re-create it. Another way to do that is to use <code>kubectl api-resources</code> to get all resource types, <a href="https://gist.github.com/superbrothers/b428cd021e002f355ffd6dd421b75f70" rel="noreferrer">as seen here</a>:</p>

<pre><code>kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all
</code></pre>
