Install and Deploy Kubernetes on Ubuntu 19


swapon -s
sudo snap install microk8s --classic --edge
sudo usermod -a -G microk8s ye;
sudo chown -f -R ye ~/.kube;
microk8s.kubectl get all --all-namespaces
microk8s.enable dashboard dns
microk8s.kubectl get all --all-namespaces
[email protected]:~$ watch microk8s.kubectl get all --all-namespaces
Every 2.0s: microk8s.kubectl get all --all-namespaces                                                                                                                                                      ubuntu: Wed Apr  8 21:11:39 2020
NAMESPACE     NAME                                                  READY   STATUS    RESTARTS   AGE
kube-system   pod/coredns-588fd544bf-mwwjg                          1/1     Running   1          22m
kube-system   pod/dashboard-metrics-scraper-db65b9c6f-tdpms         1/1     Running   1          22m
kube-system   pod/heapster-v1.5.2-58fdbb6f4d-cfddq                  4/4     Running   2          22m
kube-system   pod/kubernetes-dashboard-67765b55f5-f5g2s             1/1     Running   1          22m
kube-system   pod/monitoring-influxdb-grafana-v4-6dc675bf8c-bjfn5   2/2     Running   1          22m
NAMESPACE     NAME                                TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
default       service/kubernetes                  ClusterIP     <none>        443/TCP                  61m
kube-system   service/dashboard-metrics-scraper   ClusterIP    <none>        8000/TCP                 22m
kube-system   service/heapster                    ClusterIP   <none>        80/TCP                   22m
kube-system   service/kube-dns                    ClusterIP    <none>        53/UDP,53/TCP,9153/TCP   22m
kube-system   service/kubernetes-dashboard        ClusterIP    <none>        443/TCP                  22m
kube-system   service/monitoring-grafana          ClusterIP   <none>        80/TCP                   22m
kube-system   service/monitoring-influxdb         ClusterIP    <none>        8083/TCP,8086/TCP        22m
NAMESPACE     NAME                                             READY   UP-TO-DATE   AVAILABLE   AGE
kube-system   deployment.apps/coredns                          1/1     1            1           22m
kube-system   deployment.apps/dashboard-metrics-scraper        1/1     1            1           22m
kube-system   deployment.apps/heapster-v1.5.2                  1/1     1            1           22m
kube-system   deployment.apps/kubernetes-dashboard             1/1     1            1           22m
kube-system   deployment.apps/monitoring-influxdb-grafana-v4   1/1     1            1           22m
NAMESPACE     NAME                                                        DESIRED   CURRENT   READY   AGE
kube-system   replicaset.apps/coredns-588fd544bf                          1         1         1       22m
kube-system   replicaset.apps/dashboard-metrics-scraper-db65b9c6f         1         1         1       22m
kube-system   replicaset.apps/heapster-v1.5.2-58fdbb6f4d                  1         1         1       22m
kube-system   replicaset.apps/kubernetes-dashboard-67765b55f5             1         1         1       22m
kube-system   replicaset.apps/monitoring-influxdb-grafana-v4-6dc675bf8c   1         1         1       22m
[email protected]:~$ token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)                                                                                                                                    
[email protected]:~$ microk8s kubectl -n kube-system describe secret $token
Name:         default-token-ztf7s
Namespace:    kube-system
Labels:       <none>
Annotations: default
ca.crt:     1103 bytes
namespace:  11 bytes
token:      eyJhbGciO...EolgcJnAnVrdQ
microk8s.kubectl proxy
  Starting to serve on
C:\Users\ye>ssh -L localhost:8001:localhost:8001 -NT ye@
  K8S dashboard v2
  K8S dashboard v1

Kubernetes Cheat Sheet
Docker Cheat Sheet

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.