<p>I want to configure Kubernetes Dashboard on a remote server using this guide: <a href="https://k21academy.com/docker-kubernetes/kubernetes-dashboard/" rel="nofollow noreferrer">https://k21academy.com/docker-kubernetes/kubernetes-dashboard/</a></p>
<p>I installed it using:</p>
<pre><code>kubernetes@kubernetes1:~$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.1/aio/deploy/recommended.yaml
</code></pre>
<p>List service:</p>
<pre><code>kubernetes@kubernetes1:~$ kubectl get all -n kubernetes-dashboard
NAME                                             READY   STATUS    RESTARTS   AGE
pod/dashboard-metrics-scraper-64bcc67c9c-q8f7j   1/1     Running   0          71m
pod/kubernetes-dashboard-66c887f759-pq58q        1/1     Running   0          71m

NAME                                TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
service/dashboard-metrics-scraper   ClusterIP   10.105.143.75    &lt;none&gt;        8000/TCP   71m
service/kubernetes-dashboard        ClusterIP   10.102.209.213   &lt;none&gt;        443/TCP    71m

NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/dashboard-metrics-scraper   1/1     1            1           71m
deployment.apps/kubernetes-dashboard        1/1     1            1           71m

NAME                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/dashboard-metrics-scraper-64bcc67c9c   1         1         1       71m
replicaset.apps/kubernetes-dashboard-66c887f759        1         1         1       71m
kubernetes@kubernetes1:~$
</code></pre>
<p>But when I try to edit the port according to the guide I get:</p>
<pre><code>kubernetes@kubernetes1:~$ kubectl edit service/kubernetes-dashboard
Error from server (NotFound): services &quot;kubernetes-dashboard&quot; not found
kubernetes@kubernetes1:~$
</code></pre>
<p>Do you know how I can change the port?</p>

Peter Penzov
<p>Seems like you are looking into <code>default</code> or some other namespace.</p>
<p>you can try</p>
<pre><code>kubectl edit service/kubernetes-dashboard -n kubernetes-dashboard
</code></pre>
<p>A nice tool for namespace switching</p>
<pre><code>curl -LO https://github.com/kvaps/kubectl-use/raw/master/kubectl-use
chmod +x ./kubectl-use
sudo mv ./kubectl-use /usr/local/bin/kubectl-use
</code></pre>
<p>then</p>
<pre><code>kubectl use kubernetes-dashboard
</code></pre>
<p>After this, you do not need to specify <strong>namespace</strong> <code>-n kubernetes-dashboard</code> in the edit command, or <code>kubectl get pods</code>, it will use <code>kubernetes-dashboard</code> as a default context.</p>
<p><a href="https://github.com/kvaps/kubectl-use" rel="nofollow noreferrer">kubectl-use</a></p>
