<p>I've created a Kubernetes deployment. However, there seem to be additional  pods running - that I'm hoping to be able to delete the unnecessary ones. </p>

<p>I see no need to run the dashboard container. I'd like to remove it to free up CPU resources.</p>

<p>How can I disable this container from starting up? Preferably from the deployment config.</p>

<p>Essentially the following pod:</p>

<pre><code>kubectl get pods --all-namespaces | grep "dashboard"                                  
kube-system   kubernetes-dashboard-490794276-sb6qs                  1/1       Running   1          3d
</code></pre>

<p><strong>Additional information:</strong></p>

<p>Output of <code>kubectl --namespace kube-system get deployment</code>:</p>

<pre><code>NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
heapster-v1.3.0        1         1         1            1           3d
kube-dns               2         2         2            2           3d
kube-dns-autoscaler    1         1         1            1           3d
kubernetes-dashboard   1         1         1            1           11m
l7-default-backend     1         1         1            1           3d
</code></pre>

<p>Output of <code>kubectl --namespace kube-system get rs</code>:</p>

<pre><code>NAME                             DESIRED   CURRENT   READY     AGE
heapster-v1.3.0-191291410        1         1         1         3d
heapster-v1.3.0-3272732411       0         0         0         3d
heapster-v1.3.0-3742215525       0         0         0         3d
kube-dns-1829567597              2         2         2         3d
kube-dns-autoscaler-2501648610   1         1         1         3d
kubernetes-dashboard-490794276   1         1         1         12m
l7-default-backend-3574702981    1         1         1         3d
</code></pre>

<h2>Update 2023-03</h2>
<p>To have a clean removal you must to delete a lot of objects. Overtime removing the dashboard has been a common problem, so you can now do this:</p>
<pre><code>kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
</code></pre>
<p>If you don't want to do a blind thing and you want to know what are you removing just try to execute this:</p>
<pre><code>kubectl get secret,sa,role,rolebinding,services,deployments --namespace=kube-system | grep dashboard
</code></pre>
<p>If the output is empty, just double check your dashboard namespace's with the command</p>
<pre><code>kubectl get namespaces
</code></pre>
<p>The dashboard is stored in a separate namespace and, depending of your context, the dashboard can be not always in the same namespace. If you want have a deeper look start trying with <code>kubernetes-dashboard</code> or <code>kube-system</code> and always specify the namespace while callin <code>kubectl</code>.</p>
