Kubernetesの学習環境としてsnapのmicrok8sは良さそう

f:id:yassan0627:20190424062319p:plain

って @jyoshise さんがつぶやいてたので、ほんまかねぇと思って、snapだし良いかってくらいのノリで入れてみた。

元ネタはこっち

speakerdeck.com

MicroK8s は、snapでインストールが可能です。

インストールはほんとに簡単で、、、

$ sudo snap install microk8s --classic
Download snap "microk8s" (522) from channel "stable"
microk8s v1.14.1 from Canonical✓ installed

以上。むっちゃ簡単。

MicroK8sの情報から、コマンドやサービスを確認。

snap info microk8s
name:      microk8s
summary:   Kubernetes for workstations and appliances
publisher: Canonical✓
contact:   https://github.com/ubuntu/microk8s
license:   unset
description: |
  MicroK8s is a small, fast, secure, single node Kubernetes that installs on just about any Linux
  box. Use it for offline development, prototyping, testing, or use it on a VM as a small, cheap,
  reliable k8s for CI/CD. It's also a great k8s for appliances - develop your IoT apps for k8s and
  deploy them to MicroK8s on your boxes.
commands:
  - microk8s.config
  - microk8s.ctr
  - microk8s.disable
  - microk8s.enable
  - microk8s.inspect
  - microk8s.istioctl
  - microk8s.kubectl
  - microk8s.reset
  - microk8s.start
  - microk8s.status
  - microk8s.stop
services:
  microk8s.daemon-apiserver:          simple, enabled, active
  microk8s.daemon-apiserver-kicker:   simple, enabled, active
  microk8s.daemon-containerd:         simple, enabled, active
  microk8s.daemon-controller-manager: simple, enabled, active
  microk8s.daemon-etcd:               simple, enabled, active
  microk8s.daemon-kubelet:            simple, enabled, active
  microk8s.daemon-proxy:              simple, enabled, active
  microk8s.daemon-scheduler:          simple, enabled, active
snap-id:      EaXqgt1lyCaxKaQCU349mlodBkDCXRcg
tracking:     stable
refresh-date: today at 06:04 JST
channels:
  stable:         v1.14.1  2019-04-18 (522) 214MB classic
  candidate:      v1.14.1  2019-04-15 (522) 214MB classic
  beta:           v1.14.1  2019-04-15 (522) 214MB classic
  edge:           v1.14.1  2019-04-19 (542) 217MB classic
  1.14/stable:    v1.14.1  2019-04-18 (521) 214MB classic
  1.14/candidate: v1.14.1  2019-04-15 (521) 214MB classic
  1.14/beta:      v1.14.1  2019-04-15 (521) 214MB classic
  1.14/edge:      v1.14.1  2019-04-19 (541) 217MB classic
  1.13/stable:    v1.13.5  2019-04-22 (526) 237MB classic
  1.13/candidate: v1.13.5  2019-04-19 (526) 237MB classic
  1.13/beta:      v1.13.5  2019-04-19 (526) 237MB classic
  1.13/edge:      v1.13.5  2019-04-19 (526) 237MB classic
  1.12/stable:    v1.12.6  2019-04-19 (435) 251MB classic
  1.12/candidate: v1.12.7  2019-04-19 (534) 259MB classic
  1.12/beta:      v1.12.7  2019-04-19 (534) 259MB classic
  1.12/edge:      v1.12.7  2019-04-19 (534) 259MB classic
  1.11/stable:    v1.11.9  2019-04-23 (545) 258MB classic
  1.11/candidate: v1.11.9  2019-04-22 (545) 258MB classic
  1.11/beta:      v1.11.9  2019-04-22 (545) 258MB classic
  1.11/edge:      v1.11.9  2019-04-20 (545) 258MB classic
  1.10/stable:    v1.10.13 2019-04-22 (546) 222MB classic
  1.10/candidate: v1.10.13 2019-04-22 (546) 222MB classic
  1.10/beta:      v1.10.13 2019-04-22 (546) 222MB classic
  1.10/edge:      v1.10.13 2019-04-22 (546) 222MB classic
installed:        v1.14.1             (522) 214MB classic

お勉強に必要そうなものは揃ってそう。

さらに、アドオンを確認

microk8s.status
microk8s is running
addons:
jaeger: disabled
fluentd: disabled
gpu: disabled
storage: disabled
registry: disabled
ingress: disabled
dns: disabled
metrics-server: disabled
prometheus: disabled
istio: disabled
dashboard: disabled

registry、fluentd、ingress、istioだけじゃなく、、、

分散トレーシングのjaeger も入っているし www.jaegertracing.io

Prometheusもあるじゃん。

snapってUbuntuだけじゃなく、CentOSにも対応していているので、以下を参考にしたらCentOSでもsnapからMicroK8s入れられるかも。

Installing snap on CentOS - Documentation for snaps: Universal Linux packages

という事で、学習用にはしばらくこれを使ってみよう。