Top Banner
HashiCorp at JUST EAT ANDREW BROWN - Senior Platform Engineer
34

London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Apr 14, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

HashiCorp at JUST EAT

ANDREW BROWN - Senior Platform Engineer

Page 2: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Overview

Core Platform - Using Consul & Packer

Acquired Platforms - Terraform & Vagrant

Page 3: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

• The world’s leading digital marketplace for takeaway food delivery• Operate in 13 markets around the globe • Platform peak ~ 2,500 orders per minute

JUST EAT

Page 4: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

TECHNOLOGY

• Migrated to AWS (Amazon Web Services) 4 years ago• Run hundreds of Instances at peak - daily scaling to match demand• Heavily utilise CloudFormation

Page 5: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

AWS - Setup

• Multiple AWS Accounts

• QA Daily Launch and Teardown

• On average an instance less than 3 days old

Page 6: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Before Consul…..CONFIGURATION

• JSON file bundled with application package

• Deployment step to “Generate Config”

SETTINGS

• Feature settingsapi • key/values stored in DynamoDB

Page 7: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Before Consul…..

SERVICE DISCOVERY?

• DNS -> Endpoint of the Elastic Load Balancer• Hard-coded Ips

Page 8: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Consul Setup● Consul Cluster per environment

● JSON config stored in GitHub in templated format

● Generator run via TeamCity

● Config committed to “Generated Repository”

Page 9: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco
Page 10: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco
Page 11: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

After Consul….

• Instance joins the Consul Cluster during Deployment

• Service registered on consul cluster

• Consul-Template generates config files

Page 12: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Benefits of Consul• No need to cycle instances (seconds vs minutes)

• PR to Github to change and validate Config

• Consistent Config

• UI - Platform and Health Overview

Page 13: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Consul MetaData• Recently launched a “Platform Consul Cluster”

• MetaData Generated using same mechanism as Features

• Powering other tools used in Just Eat

Page 14: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Finally…. PackerBAKED AMI (Amazon Machine Image)

• All Dependencies Pre-installed• CloudFormation reduced (removed 500 lines of json)• Significantly reduced deployment time (Linux and Windows)

• AMI ID pushed to Consul - Config now stores “AMI Name”

Page 15: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

HashiCorp atAcquired Platforms

ALBERTO BLANCO - Platform Developer

Page 16: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

What we do?

Page 17: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Yes, correct! we acquire platforms

Page 18: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

And we look after them too...

Page 19: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

So we do...

Page 20: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco
Page 21: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco
Page 22: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

What we value the most of Terraform

● Abstraction● Infrastructure versioning● A common language● Lifecycle● Dependency resolution

Page 23: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Starting for scratch

Page 24: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

The three S’s

Stability

Scalability

Security

And also we want to keep releasing!And monitor it properly!

to the cloud!

Page 25: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

A reproducible deployment pipeline

As much as cloud agnostic as we can

Using Terraform as the base

Page 26: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

How we deal with it

Consul for config...and tfstate files

Page 27: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

How we deal with it

On top of the base we put the rest

Page 28: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

How we deal with it

On top of the base we put the rest

Page 29: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

How we deal with it

On top of the base we put the rest

Page 30: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Here our tools...

● Terraform, the base● Ansible for provisioning● Capistrano for some deployments● Consul for configs and tfstate● Vagrant for local development● Jenkins for orchestration

Page 31: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

More HashiCorp to come for us...

● Packer for sharing artifacts and images between providers

● Vault for secrets

Page 32: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Any questions?

Page 33: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

We are hiring!Come talk to us.

Page 34: London HUG 8/3 - JustEat - Andrew Brown / Alberto Blanco

Thank you