This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tech:k8s:start [2019/01/23 02:37] rk4n3 |
tech:k8s:start [2019/11/03 22:02] (current) rk4n3 |
||
---|---|---|---|
Line 1: | Line 1: | ||
<typo fs:xx-large; fw:bold>Kubernetes Topics</typo> \\ | <typo fs:xx-large; fw:bold>Kubernetes Topics</typo> \\ | ||
- | [[https://kubernetes.io/docs/home/?path=users&persona=app-developer&level=foundational|Documentation]] | + | [[https://kubernetes.io/docs/home/?path=users&persona=app-developer&level=foundational|Documentation]] \\ |
+ | ====== Resources ====== | ||
+ | ==== Quick Links ==== | ||
+ | * Dashboard: [[http://k8s:8080/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy|(local cluster - k8s)]] | ||
+ | * Dashboard (proxied): | ||
+ | * Tunnel: ''ssh -L 18443:<DashboardIP>:443 k8s'' //(discover DashboardIP as in instructions below)// | ||
+ | * [[https://localhost:18443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/]] | ||
====== Installation & Configuration ====== | ====== Installation & Configuration ====== | ||
**Ubuntu:**[[https://microk8s.io/#quick-start]]<code>snap install microk8s --classic</code> | **Ubuntu:**[[https://microk8s.io/#quick-start]]<code>snap install microk8s --classic</code> | ||
+ | **Start & Stop:** | ||
+ | * ''microk8s.start'' | ||
+ | * ''microk8s.stop'' | ||
+ | **Standard Services:** | ||
+ | <code>microk8s.enable dns storage istio registry ingress dashboard metrics-server</code> | ||
+ | * ''microk8s.enable dashboard'' | ||
+ | * ''microk8s.enable registry'' | ||
+ | * ''microk8s.enable istio'' | ||
+ | * ''microk8s.enable ...'' | ||
+ | * ''microk8s.disable ...'' | ||
+ | **Tricks:** | ||
+ | * Shell in pod: | ||
+ | * ''kubectl get pods'' | ||
+ | * ''kubectl get pod garden-7dd9f6bc88-pp87l'' | ||
+ | * ''kubectl exec -it garden-7dd9f6bc88-pp87l -- /bin/bash'' \\ | ||
+ | * Discover dashboard IP:<code>microk8s.kubectl get all --all-namespaces |grep kubernetes-dashboard | grep ClusterIP</code> | ||
+ | * Discover dashboard token:<code> | ||
+ | microk8s.kubectl -n kube-system get secret | ||
+ | microk8s.kubectl -n kube-system describe secret default-token-{xxxxx} | ||
+ | </code> | ||
+ | * ''ln -s /snap/bin/microk8s.docker /usr/local/bin/docker'' | ||
+ | * Install ''S2I'' from: [[https://github.com/openshift/source-to-image/releases]] | ||
+ | |||
+ | * Build docker image elsewhere and save/load into local k8s: | ||
+ | * ''docker save mynewimage > mynewimage-docker.tar'' | ||
+ | * Transfer file to microk8s server | ||
+ | * ''microk8s.docker load < mynewimage-docker.tar'' | ||
+ | |||
+ | * Move a running container: | ||
+ | * First, commit a snapshot to a new image: ''docker commit //<containerId>// mynewimage'' | ||
+ | * Then, follow the load/save steps above | ||