Slide 1

Slide 1 text

Monitoring k8s Prometheus Tokyo Meetup #1 with Prometheus

Slide 2

Slide 2 text

ABOUT ME INTRODUCTION AYA IGARASHI @Ladicle NTT Communications Software Engineer

Slide 3

Slide 3 text

AGENDA INTRODUCTION features 02 01 03 04 Prometheus & Kubernetes Overview Why use Prometheus? Introduce good points Summarize k8s service discovery easy installation and powerful monitoring pros and cons

Slide 4

Slide 4 text

Prometheus? What is

Slide 5

Slide 5 text

What is Prometheus? OVERVIEW ● OSS monitoring & alerting tool ● Built at SoundCloud (inspired by Borgmon) ● Joined the ● Written in Go ● Pull model Characteristics Not Fit ● 100% accuracy, such as billing

Slide 6

Slide 6 text

Architecture OVERVIEW

Slide 7

Slide 7 text

Kubernetes? What is

Slide 8

Slide 8 text

What is Kubernetes(k8s)? OVERVIEW ● OSS management tool of container ● Built at Google (inspired by Borg) ● Joined the CNCF ● Written in Go ● Latest version is 1.6 (Support RBAC) Characteristics Container Runtime ● Docker ● rkt ● frakit etc….

Slide 9

Slide 9 text

Prometheus? Why use

Slide 10

Slide 10 text

Why use Prometheus? Deciding factors ○ Containers are discovered via service discovery ○ Flexible query and dashboarding support ○ Smart alerting system such as grouping OVERVIEW

Slide 11

Slide 11 text

Architecture OVERVIEW ○ NodeExporter ■ VM(baremetal) ○ BlackboxExporter ■ HTTP/TCP/DNS ○ Kube-state-metrix ■ Kubernetes cluster

Slide 12

Slide 12 text

k8s Service Discovery OVERVIEW ● Scrape node, pod, endpoint and service ○ Node: NodeExporter ○ Pod / Endpoint: CustomExporter ○ Service: BlackboxExporter What can it do? ● Provided official prometheus chart ○ https://github.com/kubernetes/charts/tree/master/stable/prometheus How to use it?

Slide 13

Slide 13 text

How to use it? OVERVIEW ● Prometheus Server configuration Scrape pods and endpoints annotations: prometheus.io/scrape: 'true' prometheus.io/port: '2379' prometheus.io/metrics: /metrics

Slide 14

Slide 14 text

How to use it? OVERVIEW Scrape service with BlackboxExporter ● Probe endpoints over HTTP, HTTPS, DNS, TCP and ICMP. ○ https://github.com/prometheus/blackbox_exporter

Slide 15

Slide 15 text

Dashboard OVERVIEW ● Provided official grafana chart ○ https://github.com/kubernetes/charts/tree/master/stable/grafana How to install it? ● Published k8s dashboards ○ https://grafana.com/dashboards?search=kubernetes Beautiful dashboards

Slide 16

Slide 16 text

Summarize OVERVIEW ● 日本で使っているところが少ない ● BlackboxExporterがchartsに入っていない ● K8s 1.6のRBACにchartsが対応していない Cons. Pros. ● β版だが普通に動く(今後のupdateに注意) ● インストール周りが整備済み ● PromQLが強力 ● アラートをまとめるのが楽

Slide 17

Slide 17 text

Thanks For Watching! See you next time