だいごろうのブログ

熊本出身で大阪、東京、パリを転勤して、今は福岡でデータエンジニアです

[MEMO] katacodaでLearn Kubernetes ver8 Weave Scope

Installing Weave Scope on Kubernetes

説明見るだけで、魅力的、追加のモジュールとかコードとかなしに、pod感の通信を可視化する!

how to start

すでに、yamlが提供されてるみたいで、それをそのまま入れればいけるっぽい?

kubectl create -f 'https://cloud.weave.works/launch/k8s/weavescope.yaml'

これだけで、pod/service/daemonset/deployment/replicasetがBuildされた。

master $ kubectl get all -n weave
NAME                                             READY   STATUS    RESTARTS   AGE
pod/weave-scope-agent-ftrqd                      1/1     Running   0          48s
pod/weave-scope-app-77c6bbfd94-m77q7             1/1     Running   0          48s
pod/weave-scope-cluster-agent-64cf585649-f8zlj   1/1     Running   0          48s

NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/weave-scope-app   ClusterIP   10.109.55.227   <none>        80/TCP    48s

NAME                               DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR AGE
daemonset.apps/weave-scope-agent   1         1         1       1            1           <none> 48s

NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/weave-scope-app             1/1     1            1           48s
deployment.apps/weave-scope-cluster-agent   1/1     1            1           48s

NAME                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/weave-scope-app-77c6bbfd94             1         1         1       48s
replicaset.apps/weave-scope-cluster-agent-64cf585649   1         1         1       48s

このDaemonSetがPodを全ホストに自動でデプロイするみたい。で、そのPodで全体のネットワークを可視化するみたい。こうすることで、他に何も変更せずに可視化できる。

アクセス

これだけだと、internalにしか公開されないので、externalにするみたい。ただpublic_ipに紐付けるのは推奨されないので、VPNでつなぎましょうと。

つなぐとこんな感じ

f:id:daigorowhite:20190719084138p:plain
weave scope example

なにこれすごい。やばい、感動する。

ちょっと、もっと調べよう

Weave

Weave ScopeはWeaveWorksって会社のプロダクトのうちのひとつなのかな。

www.weave.works

WeaveEnterprizeとOpenSourceに別れてるっぽい トップページからの引用

Automate Enterprise Kubernetes the GitOps way

Operate and manage production ready Kubernetes with Weaveworks' Enterprise Kubernetes Platform. GitOps unlocks cloud native agility, reliability and scalability.

監視、ログとか運用に必要なことをワンパッケージにしつつ、デプロイパイプラインをgitopsでシンプルにできる。みたいなサービスかな。たぶん、かいつまみすぎ。

gitopsのweave記事さくっと読んでみた GitOps

https://www.weave.works/technologies/gitops/#pull-pipeline GitOpsにはPush型とPull型があり、WeaveはPull型Pipelineらしい。

  • Push型 : Gitにコミットしたものをkubectlなどで、手動、もしくはジョブでkubernetesにapplyしていく。

  • Pull型 : Gitにコミットしたら、"Deployment Automator"なるものが、Gitを監視してて、変更があれば、それをkubernetesにapplyしていく。

 なるほどね、Chefの適応と似てるなと思った、ChefServerのレシピに変更があれば、自動で適応していくのを思い出した。開発者とサーバの実作業のdependencyが剥がされて良い設計だなと思ってたけど、Pull型Pipelineっていうのか。

ほかのWeave Opensource

Weave Net

cloud native networking toolkitらしい。VirtualNetworkを複数のDockerホスト上に構築して、自動でdiscoveryをし、 ‘invisible infrastructure’を実現するみたい。(ちょっと、ぼくもまだ理解できてない。)

Weave Flux

Weave Cortex

TimeSerieaseDataBase。Scalabeで Cloud-native Prometheus !で、データの永続化も大丈夫だぞ。みたいな。正直Prometheus を永続化問題で、サーバ立てて管理してるので、ちょっと、気になる。

Flagger

Automate and manage canary and other advanced deployments with Istio, Linkerd, AWS App Mesh or NGINX for traffic shifting. Integrated Prometheus metrics control canary deployment success or failure. https://www.weave.works/oss/flagger/

これ、すごいんじゃないかな。 Prometheusと連携して、メトリクスをコントロールしながら、 canaryリリースを可能にする。で、 Istioとかサービスメッシュとかを一緒に使うことができる。これも、もっと深くまで勉強したい。リリース周りの自動化が捗る。

eksctl

Create a cluster in minutes with just one command and manage the entire cluster lifecycle with GitOps. https://www.weave.works/oss/eksctl/

AWSのEKS上に、ワンクリックでgitopsのクラスターを構築するっていう、用途特化のツール。ただ、初期構築には、かなり便利なんじゃないかなー。正直、ちょっと、ブラックボックス感があるから、好きではないが、こういう自動化はいいよね。

あとで、読まねば

www.weave.works