+ All Categories
Home > Documents > Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software...

Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software...

Date post: 07-Aug-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
121
Microservices On GKE At Mercari GCPUG Tokyo Kubernetes Engine Day @deeeet
Transcript
Page 1: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Microservices On GKE At MercariGCPUG Tokyo Kubernetes Engine Day @deeeet

Page 2: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

@deeeet

Page 3: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Background

Page 4: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Start with Monolith

Page 5: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Small Overhead for cross domains 👍 Reusable code across domains 👍Effective operation by SRE team 👍

Page 6: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

3 scalabilities

Page 7: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Growth of business Growth of features Growth of organization

Page 8: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Growth of business Growth of features Growth of organization

Page 9: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Growth of business Growth of features Growth of organization

Page 10: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Huge Monolith

Page 11: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Difficult to understand change effect 👎 Difficult to test 👎 Difficult to on-board👎 Difficult to isolate failure 👎 Difficult to scale independently 👎 Difficult to try new technologies 👎

Page 12: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Growth of business Growth of features Growth of organization

Page 13: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Unclear ownership 😩 Communication overhead 😩

Page 14: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Velocity is stalled ☔

Page 15: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Microservices

Page 16: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Microservices is a software development technique that structures an application as a collection of loosely coupled services with the smallest autonomous boundary.

Page 17: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Technical benefit Organization benefit

Page 18: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Technical benefit Organization benefit

Page 19: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Easy to test 👍 Easy to deploy 👍 Easy to on-board 👍 Easy to isolate failure 👍 Easy to scale independently 👍

Page 20: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Technical benefit Organization benefit

Page 21: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Clear ownership 😁 Minimum communication overhead 😁

Page 22: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Deliver new features faster ☀

Page 23: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

How Microservices?

Page 24: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Gateway pattern Strangler pattern

Page 25: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Gateway pattern Strangler pattern

Page 26: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Service A

Service B

Mercari API

Page 27: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Service A

Service B

Mercari API

Page 28: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Service A

Service B

Service X

Mercari API

Page 29: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Service A

Service B

Service X

Multiple services on a single endpoint SSL Termination DDoS Protection Common AuthZ/AuthN

Mercari API

Page 30: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Gateway pattern Strangler pattern

Page 31: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Service A

Service B

Service X

Page 32: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Service B

Service X Service A

Page 33: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Service X Service A Service B

Page 34: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Function X

Function Y

Function Z

Service C

Page 35: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Function X

Facade C

Function Y

Function Z

Service C

Page 36: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Facade C

Function Y

Function Z

Service C

Function X

Page 37: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Facade C

Function Z

Service C

Function X

Function Y

Page 38: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Facade C

Service C

Function X

Function Y

Function Z

Page 39: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Service C

Function X

Function Y

Function Z

Page 40: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari API

API Gateway

Service C

Function X

Function Y

Service D

Function Z

Page 41: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Current Status

Page 42: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Service A

Service B

Service X

Mercari API

Page 43: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Technical Stack

Page 44: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API GatewayAuthority

Service A

Service B

Sakura

Service X

Mercari API

Page 45: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Page 46: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Cloud Resources Managed Services

Page 47: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Cloud Resources Managed Services

Container

Page 48: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Cloud Resources Managed Services

Container

Over HTTP

Page 49: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Cloud Resources Managed Services

Container

Over HTTP

SSL Termination DDoS Protection Cloud Amor?

Page 50: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Cloud Resources Managed Services

Container

Over HTTP

Routing to microservices Protocol tranformation (HTTP to gRPC) Common logging & Tracing Request buffering

SSL Termination DDoS Protection Cloud Amor?

Page 51: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Cloud Resources Managed Services

Container

Over HTTP

Routing to microservices Protocol tranformation (HTTP to gRPC) Common logging & Tracing Request buffering

SSL Termination DDoS Protection Cloud Amor?

Common AuthZ/AuthN

Page 52: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service A

Service B

Sakura

Service X

Mercari API

GCPKubernetes Engine

Cloud Resources Managed Services

Container

Over HTTP

Routing to microservices Protocol tranformation (HTTP to gRPC) Common logging & Tracing Request buffering

SSL Termination DDoS Protection Cloud Amor?

Common AuthZ/AuthN

Managed DB

Page 53: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 54: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 55: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 56: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 57: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 58: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 59: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Another important takeaway is that even though all of these listed items are important, ultimately the most critical thing is observability. As I like to say: observability, observability, observability

- Matt Klein, Seeking SRE (Chapter6)

Page 60: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Service A Service BNetwork

Logging? Tracing? (Observability)

Network

Logging? Tracing? (Observability)

Page 61: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Service A Service BNetwork

AuthN and AuthZ? API limit ?

Load balancing ? Request timeout ? Request retry with backoff? Circuit breaking ?

Logging? Tracing? (Observability)

Network

Logging? Tracing? (Observability)

Page 62: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Service A Service BNetwork

AuthN and AuthZ? API limit ?

Load balancing ? Request timeout ? Request retry with backoff? Circuit breaking ?

Logging? Tracing? (Observability)

Network

Logging? Tracing? (Observability)

Different protocols..

Page 63: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Service A Service B

Service C

Service D

Page 64: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Service A Service B

Service C

Service D

Service B

Service B

Service B

Page 65: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 66: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 67: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 68: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

How we use GCP?

Page 69: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service XGCP

Kubernetes Engine

Page 70: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service XGCP

Kubernetes Engine

How we use GKE?

Page 71: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Cluster strategy GCP project strategy Node pool strategy Namespace strategy

Page 72: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Cluster strategy GCP project strategy Node pool strategy Namespace strategy

Page 73: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

asia-northeast1us-west1

europe-west1

Each region has its own Cluster

Page 74: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Production Cluster

Development Cluster

Testing/QA will be done in development cluster

All services in 1 cluster No special cluster for specific service

Page 75: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Production Cluster

In future, 1 region 1 cluster like Google Borg

Page 76: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Cluster strategy GCP project strategy Node pool strategy Namespace strategy

Page 77: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP project: GKE Production

Production Cluster

GCP project: GKE Development

Development Cluster

IAM: SRE IAM: SRE + α

1 cluster for 1 GCP project

Only SRE can access cluster nodes

Page 78: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Cluster strategy GCP project strategy Node pool strategy Namespace strategy

Page 79: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP project: GKE Production

Production Cluster

n1-standard-16 node pool

n1-highmem-16 node poolMachine learning workloads

Normal applications

Auto scaling Enabled Automatic node repair Enabled Preemptible Enabled (only in US)

Page 80: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Cluster strategy GCP project strategy Node pool strategy Namespace strategy

Page 81: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Each services has its own kubernetes namespace

GCP project: GKE Production

Namespace: Service A

Pod: A Pod: A Pod: A

Namespace: Service B

Pod: B Pod: B

Production Cluster

RBAC: Team X

RBAC: Team X

Each team can only access its own kubernetes namespace

Page 82: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

API Gateway

Google Cloud Load balancing

Authority

Service XGCP

Kubernetes Engine

How we use GCP services?

Page 83: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

How access limit GCP services? Each service should be allowed to access only its own GCP resources

Page 84: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 85: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP project: GKE ProductionIAM: SRE

Namespace: Service A

Pod: A Pod: A Pod: A

Namespace: Service B

Pod: B Pod: B

Production Cluster

RBAC: Team X

RBAC: Team Y

Page 86: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP project: GKE ProductionIAM: SRE

Namespace: Service A

Pod: A Pod: A Pod: A

Namespace: Service B

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRE

GCP project: Service B

IAM: Team Y + SRE

Production Cluster

Each services has its own GCP project

RBAC: Team X

RBAC: Team Y

Page 87: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP project: GKE ProductionIAM: SRE

Namespace: Service A

Pod: A Pod: A Pod: A

Namespace: Service B

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Each services has its own GCP project

RBAC: Team X

RBAC: Team Y

Service resources in its own GCP project

Page 88: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP project: GKE ProductionIAM: SRE

Namespace: Service A

Pod: A Pod: A Pod: A

Namespace: Service B

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Each services has its own GCP project

Each namespace has its own service account for its own GCP project

RBAC: Team X

RBAC: Team Y

Service resources in its own GCP project

Page 89: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Each namespace has its own service account

Page 90: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP project: GKE ProductionIAM: SRE

Namespace: Service ARBAC: Team X

Pod: A Pod: A Pod: A

Namespace: Service BRBAC: Team Y

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Each services has its own GCP project

Each namespace has its own service account for its own GCP project

Service resources in its own GCP project

Page 91: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

IAM: SRE

Namespace: Service ARBAC: Team X

Pod: A Pod: A Pod: A

Namespace: Service BRBAC: Team Y

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

GCP project creation…? Setup Spanner or Cloud SQL ..?

GCP project: GKE Production

Page 92: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Infrastructure as Code

Page 93: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 94: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

CloudSQL instance creation

Page 95: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Spanner instance creation

Page 96: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

mercari / microservices-terraform Private

Page 97: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Just create a PR to create new GCP project

Page 98: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Terraform plan on CI

Page 99: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Terraform apply on CI

Page 100: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Tool for notifying terraform result is open sourced https://github.com/mercari/tfnotify

Terraform apply on CI

Page 101: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Common part (GCP project creation, Pagerduty setup) can be bootstrapped

Page 102: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

IAM: SRE

Namespace: Service ARBAC: Team X

Pod: A Pod: A Pod: A

Namespace: Service BRBAC: Team Y

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Stackdriver

GCP project: GKE Production

Page 103: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

IAM: SRE

Namespace: Service ARBAC: Team X

Pod: A Pod: A Pod: A

Namespace: Service BRBAC: Team Y

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Logging…?Stackdriver

GCP project: GKE Production

Page 104: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

How access limit stackdriver logging? Each team should be allowed to access only its service log

Page 105: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 106: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

IAM: SRE

Namespace: Service ARBAC: Team X

Pod: A Pod: A Pod: A

Namespace: Service BRBAC: Team Y

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Logging…?Stackdriver

GCP project: GKE Production

Page 107: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

IAM: SRE

Namespace: Service ARBAC: Team X

Pod: A Pod: A Pod: A

Namespace: Service BRBAC: Team Y

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Stackdriver

Big Query

Big Query

GCP project: GKE Production

Create BQ for each services

Page 108: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

IAM: SRE

Namespace: Service ARBAC: Team X

Pod: A Pod: A Pod: A

Namespace: Service BRBAC: Team Y

Pod: B Pod: B

GCP project: Service A

IAM: Team X + SRECloud SQL

GCP project: Service B

SpannerIAM: Team Y + SRE

Production Cluster

Create BQ sink for each services

Stackdriver

Big Query

Big Query

sink

sink

GCP project: GKE Production

Create BQ for each services

Page 109: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

BigQuery sink creation

Page 110: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering
Page 111: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

GCP and k8s Ecosystem

Page 112: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Just create ingress it automatically creates DNS records

with Cloud DNS

Page 113: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Disaster Recovering Take backups of your cluster and restore in case of loss.

with Cloud Storage

Page 114: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Non GCP?

Page 115: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Notification or Integration with GitHub

vs. Container Builder

Page 116: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Integration with external services like CDN or AWS

vs. Stackdriver monitoring

Page 117: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

vs. Stackdriver error reportNotification and Integration with GitHub

Page 118: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

vs. ??GCP does not have chaos as a service

Page 119: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Conclusion

Page 120: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

Mercari ❤

Page 121: Microservices on GKE at Mercari - crash.academy · 2018-06-01 · Microservices is a software development technique that structures an ... Common logging & Tracing Request buffering

@deeeet


Recommended