<p>I installed kubernetes and it all looks alright I think.
( note that those are outputs after editing a file below, changing to NodePort)</p>
<pre><code>sudo kubectl get deployment kubernetes-dashboard -n kubernetes-dashboard
NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
kubernetes-dashboard   1/1     1            1           85m
</code></pre>
<p>and</p>
<pre><code>sudo kubectl describe service kubernetes-dashboard -n kubernetes-dashboard
Name:                     kubernetes-dashboard
Namespace:                kubernetes-dashboard
Labels:                   k8s-app=kubernetes-dashboard
Annotations:              &lt;none&gt;
Selector:                 k8s-app=kubernetes-dashboard
Type:                     NodePort
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.102.39.197
IPs:                      10.102.39.197
Port:                     &lt;unset&gt;  443/TCP
TargetPort:               8443/TCP
NodePort:                 &lt;unset&gt;  30306/TCP
Endpoints:                10.244.0.4:8443
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason  Age   From                Message
  ----    ------  ----  ----                -------
  Normal  Type    45m   service-controller  NodePort -&gt; LoadBalancer
  Normal  Type    16m   service-controller  LoadBalancer -&gt; NodePort
</code></pre>
<p>and</p>
<pre><code>sudo kubectl get all -n kubernetes-dashboard
NAME                                             READY   STATUS    RESTARTS   AGE
pod/dashboard-metrics-scraper-856586f554-5bps6   1/1     Running   0          69m
pod/kubernetes-dashboard-67484c44f6-dtc27        1/1     Running   0          69m

NAME                                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
service/dashboard-metrics-scraper   ClusterIP   10.107.30.72    &lt;none&gt;        8000/TCP        69m
service/kubernetes-dashboard        NodePort    10.102.39.197   &lt;none&gt;        443:30306/TCP   69m

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

NAME                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/dashboard-metrics-scraper-856586f554   1         1         1       69m
replicaset.apps/kubernetes-dashboard-67484c44f6        1         1         1       69m
</code></pre>
<p>and</p>
<pre><code>sudo kubectl get all --all-namespaces
    NAMESPACE              NAME                                             READY   STATUS    RESTARTS   AGE
    kube-system            pod/coredns-558bd4d5db-9fxkw                     1/1     Running   0          71m
    kube-system            pod/coredns-558bd4d5db-bq79s                     1/1     Running   0          71m
    kube-system            pod/etcd-dyd-001                                 1/1     Running   0          71m
    kube-system            pod/kube-apiserver-dyd-001                       1/1     Running   0          71m
    kube-system            pod/kube-controller-manager-dyd-001              1/1     Running   0          71m
    kube-system            pod/kube-flannel-ds-amd64-hh5qm                  1/1     Running   0          71m
    kube-system            pod/kube-proxy-4pg4r                             1/1     Running   0          71m
    kube-system            pod/kube-scheduler-dyd-001                       1/1     Running   0          71m
    kubernetes-dashboard   pod/dashboard-metrics-scraper-856586f554-5bps6   1/1     Running   0          71m
    kubernetes-dashboard   pod/kubernetes-dashboard-67484c44f6-dtc27        1/1     Running   0          71m
    
NAMESPACE              NAME                                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE
default                service/kubernetes                  ClusterIP   10.96.0.1       &lt;none&gt;        443/TCP                  71m
kube-system            service/kube-dns                    ClusterIP   10.96.0.10      &lt;none&gt;        53/UDP,53/TCP,9153/TCP   71m
kubernetes-dashboard   service/dashboard-metrics-scraper   ClusterIP   10.107.30.72    &lt;none&gt;        8000/TCP                 71m
kubernetes-dashboard   service/kubernetes-dashboard        NodePort    10.102.39.197   &lt;none&gt;        443:30306/TCP            71m

NAMESPACE     NAME                                     DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR            AGE
kube-system   daemonset.apps/kube-flannel-ds-amd64     1         1         1       1            1           &lt;none&gt;                   71m
kube-system   daemonset.apps/kube-flannel-ds-arm       0         0         0       0            0           &lt;none&gt;                   71m
kube-system   daemonset.apps/kube-flannel-ds-arm64     0         0         0       0            0           &lt;none&gt;                   71m
kube-system   daemonset.apps/kube-flannel-ds-ppc64le   0         0         0       0            0           &lt;none&gt;                   71m
kube-system   daemonset.apps/kube-flannel-ds-s390x     0         0         0       0            0           &lt;none&gt;                   71m
kube-system   daemonset.apps/kube-proxy                1         1         1       1            1           kubernetes.io/os=linux   71m

NAMESPACE              NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
kube-system            deployment.apps/coredns                     2/2     2            2           71m
kubernetes-dashboard   deployment.apps/dashboard-metrics-scraper   1/1     1            1           71m
kubernetes-dashboard   deployment.apps/kubernetes-dashboard        1/1     1            1           71m

NAMESPACE              NAME                                                   DESIRED   CURRENT   READY   AGE
kube-system            replicaset.apps/coredns-558bd4d5db                     2         2         2       71m
kubernetes-dashboard   replicaset.apps/dashboard-metrics-scraper-856586f554   1         1         1       71m
kubernetes-dashboard   replicaset.apps/kubernetes-dashboard-67484c44f6        1         1         1       71m
    
</code></pre>
<p>Im following a tutorial to install Kubernetes dashboard.
<a href="https://k21academy.com/docker-kubernetes/kubernetes-dashboard/" rel="nofollow noreferrer">https://k21academy.com/docker-kubernetes/kubernetes-dashboard/</a>
This command will NOT show Kubernetes dashboard, it will show only kubernetes.</p>
<p><strong>In his example it showed kubernetes Metrics scraper and kubernetes dashboard, when I do it it only shows kubernetes. I don't know why</strong></p>
<pre><code>sudo kubectl get svc

    NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
    kubernetes   ClusterIP   10.96.0.1    &lt;none&gt;        443/TCP   44m
</code></pre>
<p>And because of that I can only edit kubernetes with the following command, but I don't want to edit kubernetes. I want to edit service/kubernetes-dashboard instead.</p>
<p>Works but not the correct file I think:</p>
<pre><code>sudo kubectl edit service/kubernetes
</code></pre>
<p>Does not work:</p>
<pre><code>sudo kubectl edit service/kubernetes-dashboard
</code></pre>
<p>So had used this command instead to edit Kubernetes-dashboard
but im not sure if they are the same files:</p>
<pre><code>sudo kubectl -n kubernetes-dashboard edit svc kubernetes-dashboard
</code></pre>
<p><strong>Question Nr 1.</strong></p>
<p>Why is kubernetes Dashboard and metrics scraper not showing up when I use this command? And how do I make it show up?</p>
<pre><code>sudo kubectl get svc
</code></pre>
<p><strong>Question Nr 2.</strong></p>
<p>Are those two commands editing the same file?</p>
<pre><code>sudo kubectl edit service/kubernetes-dashboard
</code></pre>
<p>And</p>
<pre><code>sudo kubectl -n kubernetes-dashboard edit svc kubernetes-dashboard
</code></pre>
<p><strong>Question Nr 3.</strong></p>
<p>If the file I edited with :
sudo kubectl -n kubernetes-dashboard edit svc kubernetes-dashboard
Is not the same files that is being edited when I use this command:</p>
<pre><code>sudo kubectl edit service/kubernetes-dashboard
</code></pre>
<p>How do I fix or revert the changes I made with the first command if im not sure how it previously looked like?
Can I delete the file somehow and regenerate it after applying the recommended?</p>
<p>Im trying to install the dashboard and im not getting an external IP.</p>

dev
<p>When you installed <code>dashboard</code> you used the following command.</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
</code></pre>
<p>If you open the <code>recommended.yaml</code> you will find out that it is using <code>namespace</code> as
<code>kubernetes-dashboard</code>. Eg:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
</code></pre>
<p><strong>Answer Nr 2:</strong> NO, You are mixing the namespaces, for few of the commands you have used <code>default</code> namespace. However, for the others you have used <code>kubernetes-dashboard</code> namespace.</p>
<p>Are those two commands editing the same file?</p>
<pre><code>sudo kubectl edit service/kubernetes-dashboard
</code></pre>
<p>And</p>
<pre><code>sudo kubectl -n kubernetes-dashboard edit svc kubernetes-dashboard
</code></pre>
<p>Answer Nr 3: Same as answer#2. You need to use consistent namespace.</p>
<p>To revert back:</p>
<p>You need delete the resources you created on default namespaces and be consistent with the namespaces.  Also, to start fresh, you can use <code>kubectl delete -f &lt;same path as used for installation&gt;</code> to clean the stuff.</p>
<pre><code>kubectl delete -f  https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
</code></pre>
<p>Eg:</p>
<pre><code>kubectl delete -f  https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
namespace &quot;kubernetes-dashboard&quot; deleted
serviceaccount &quot;kubernetes-dashboard&quot; deleted
service &quot;kubernetes-dashboard&quot; deleted
secret &quot;kubernetes-dashboard-certs&quot; deleted
secret &quot;kubernetes-dashboard-csrf&quot; deleted
secret &quot;kubernetes-dashboard-key-holder&quot; deleted
configmap &quot;kubernetes-dashboard-settings&quot; deleted
role.rbac.authorization.k8s.io &quot;kubernetes-dashboard&quot; deleted
clusterrole.rbac.authorization.k8s.io &quot;kubernetes-dashboard&quot; deleted
rolebinding.rbac.authorization.k8s.io &quot;kubernetes-dashboard&quot; deleted
clusterrolebinding.rbac.authorization.k8s.io &quot;kubernetes-dashboard&quot; deleted
deployment.apps &quot;kubernetes-dashboard&quot; deleted
service &quot;dashboard-metrics-scraper&quot; deleted
deployment.apps &quot;dashboard-metrics-scraper&quot; deleted
</code></pre>
