Slide 1

Slide 1 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 1/31 Kubernetes Logging Introduction 1 / 31

Slide 2

Slide 2 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 2/31 Kyohei Mizumoto(@kyohmizu) C# Software Engineer Interests Docker/Kubernetes Go Security whoami 2 / 31

Slide 3

Slide 3 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 3/31 Required Kubernetesの概要程度の知識 Targets Kubernetes Logging未経験者 3 / 31

Slide 4

Slide 4 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 4/31 Contents 1. Logging Overview 2. Fluentd 3. Get Started with GKE 4. Demo 5. Other Services 4 / 31

Slide 5

Slide 5 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 5/31 Logging Overview 5 / 31

Slide 6

Slide 6 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 6/31 6 / 31

Slide 7

Slide 7 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 7/31 Logging 標準出⼒と標準エラー出⼒にログを出⼒ "kubectl logs"コマンドで表⽰ 安定保存のため、ログを集約して外部に転送 7 / 31

Slide 8

Slide 8 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 8/31 kubectl logs $ kubectl logs kube-dns-[num] -c kubedns -n kube-system 8 / 31

Slide 9

Slide 9 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 9/31 Landscape 9 / 31

Slide 10

Slide 10 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 10/31 Fluentd 10 / 31

Slide 11

Slide 11 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 11/31 CNCFがホストするプロジェクト DaemonSetを利⽤ 標準出⼒ログを読み出して転送 Fluentd 11 / 31

Slide 12

Slide 12 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 12/31 Before Fluentd 12 / 31

Slide 13

Slide 13 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 13/31 After Fluentd 13 / 31

Slide 14

Slide 14 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 14/31 Architecture Unified Logging with JSON プロセス(収集、フィルタリング、出⼒)の統⼀ Pluggable Architecture フレキシブルな⼊出⼒プラグイン Minimum Resources Required Built-in Reliability バッファ、フェイルオーバーによるHA構成 14 / 31

Slide 15

Slide 15 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 15/31 Forward To CloudWatch Elasticsearch Google Cloud Storage(GCS) Graylog Kafka Kinesis Amazon S3 Stackdriver Syslog etc... 15 / 31

Slide 16

Slide 16 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 16/31 Get Started 公式イメージ 16 / 31

Slide 17

Slide 17 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 17/31 Get Started with GKE 17 / 31

Slide 18

Slide 18 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 18/31 Get Started with GKE GKEではリソース作成済み $ kubectl get po -n kube-system | grep fluentd // 結果は⼀部省略 fluentd-gcp-scaler-8b674f786-jc4wk 1/1 Running fluentd-gcp-v3.2.0-4hqm6 2/2 Running fluentd-gcp-v3.2.0-m5p49 2/2 Running fluentd-gcp-v3.2.0-x6rlq 2/2 Running 18 / 31

Slide 19

Slide 19 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 19/31 Stackdriver Real-time Log Management and Analysis Seamlessly Resolve Issues Scalable and Fully Managed All Your Cloud Logs In One Place Real Time Insights 19 / 31

Slide 20

Slide 20 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 20/31 Stackdriver Monitoring 20 / 31

Slide 21

Slide 21 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 21/31 Stackdriver Logs Viewer 21 / 31

Slide 22

Slide 22 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 22/31 Demo 22 / 31

Slide 23

Slide 23 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 23/31 Other Services 23 / 31

Slide 24

Slide 24 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 24/31 SaaS型の監視&解析ツール 課⾦制 様々なサービスのメトリクスをシー ムレスに集約 Datadog 24 / 31

Slide 25

Slide 25 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 25/31 Log Explorer 25 / 31

Slide 26

Slide 26 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 26/31 Log Management Datadog Agent がログを収集 DaemonSet for Kubernetes 暗号化通信を使⽤してデータを送信 ログのFiltering、Monitoring、Alert機能 Custom Logs 26 / 31

Slide 27

Slide 27 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 27/31 Fluent Bit シンプルかつ軽量なFluentd 既存のプラグインは使⽤不可 27 / 31

Slide 28

Slide 28 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 28/31 Books 28 / 31

Slide 29

Slide 29 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 29/31 Links The Twelve-Factor App https://12factor.net/ Fluentd https://www.fluentd.org/ Fluent Bit https://fluentbit.io/ Stackdriver Logging https://cloud.google.com/logging/ Datadog https://www.datadoghq.com/ 29 / 31

Slide 30

Slide 30 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 30/31 Others fluentd-gcp-scaler のコードについて調べたので、 Qiita記事を投稿しました。 https://qiita.com/kyohmizu/items/cbf9cca76a826d8eb130 30 / 31

Slide 31

Slide 31 text

2019/3/28 Kubernetes Logging Introduction 127.0.0.1:5500/#4 31/31 Thank you! 31 / 31