CAMPHOR- Day 2019 (https://camphor.connpass.com/event/119434/) での発表資料.
Kubernetes とDeclarative Configuration2019-03-09Tomoya Tabuchi (@tomoyat1)1 / 10
View Slide
本日のお話• Kubernetes とは?• Declarative Configuration• Reconciliation Loop• 具体例 (デモ)2 / 10
Kubernetes1とは?• コンテナを中心としたプラットフォーム?• 計算・ネットワーク・ストレージの管理?• 分散コンピューティング?今日は Declarative Configuration の観点から紹介1https://kubernetes.io/3 / 10
Declarative Configurationどのリソースがどれだけあるかを宣言することで構成を定義する# hello-kube のコンテナを 1 つ動かしたい!# (今日は YAML の仕様を理解しなくてよいです)kind: Deploymentspec:replicas: 1 # 動かす個数template:spec:containers: # コンテナの仕様- image: gcr.io/tomoyat1-artifacts/hello-kube:v0.0.1name: hello-kube宣言するだけで構成が勝手にそれに近づく! →どうやって?4 / 10
Reconciliation Loop• 観測・差分計算・操作のループ• リソースごとに別コンポーネントがループを実行5 / 10
コンテナ (Pod) 数の維持 – 具体例6 / 10
イメージの変更 – 具体例7 / 10
external-dns, cert-manager – 具体例• external-dns2: DNS レコードの管理を行う Add-on• cert-manager3: Let’s Encrypt の証明書を自動で作成する Add-on• 時間がかかるので発表前に仕込んでおきました (終わっていてくれ :pray:)2https://github.com/kubernetes-incubator/external-dns3https://github.com/jetstack/cert-manager8 / 10
まとめ• Kubernetes: Declarative Configuration によるインフラの自動化ができる• 独自のリソースを定義する →自動化するプラットフォーム• 分散させるような大規模環境でなくても便利そう9 / 10
ご清聴ありがとうございましたFurther Reading• 公式• https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/• https://kubernetes.io/docs/concepts/overview/object-management-kubectl/declarative-config/• https://deeeet.com/writing/2018/12/13/how-kubernetes-change-our-way-of-automation/• https://www.slideshare.net/ToruMakabe/kubernetes-12090702010 / 10