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

HashiCorp at Just Eat

Apr 16, 2017

Download

Software

Andrew Brown
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: HashiCorp at Just Eat

HashiCorp at JUST EAT

ANDREW BROWN - Senior Platform Engineer

Page 2: HashiCorp at Just Eat

Overview

Core Platform - Using Consul & Packer

Acquired Platforms - Terraform & Vagrant

Page 3: HashiCorp at Just Eat

• 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: HashiCorp at Just Eat

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: HashiCorp at Just Eat

AWS - Setup

• Multiple AWS Accounts

• QA Daily Launch and Teardown

• On average an instance less than 3 days old

Page 6: HashiCorp at Just Eat

Before Consul…..CONFIGURATION

• JSON file bundled with application package

• Deployment step to “Generate Config”

SETTINGS

• Feature settingsapi • key/values stored in DynamoDB

Page 7: HashiCorp at Just Eat

Before Consul…..

SERVICE DISCOVERY?

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

Page 8: HashiCorp at Just Eat

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: HashiCorp at Just Eat
Page 10: HashiCorp at Just Eat
Page 11: HashiCorp at Just Eat

After Consul….

• Instance joins the Consul Cluster during Deployment

• Service registered on consul cluster

• Consul-Template generates config files

Page 12: HashiCorp at Just Eat

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: HashiCorp at Just Eat

Consul MetaData• Recently launched a “Platform Consul Cluster”

• MetaData Generated using same mechanism as Features

• Powering other tools used in Just Eat

Page 14: HashiCorp at Just Eat

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: HashiCorp at Just Eat

HashiCorp atAcquired Platforms

ALBERTO BLANCO - Platform Developer

Page 16: HashiCorp at Just Eat

What we do?

Page 17: HashiCorp at Just Eat

Yes, correct! we acquire platforms

Page 18: HashiCorp at Just Eat

And we look after them too...

Page 19: HashiCorp at Just Eat

So we do...

Page 20: HashiCorp at Just Eat
Page 21: HashiCorp at Just Eat
Page 22: HashiCorp at Just Eat

What we value the most of Terraform

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

Page 23: HashiCorp at Just Eat

Starting for scratch

Page 24: HashiCorp at Just Eat

The three S’s

Stability

Scalability

Security

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

to the cloud!

Page 25: HashiCorp at Just Eat

A reproducible deployment pipeline

As much as cloud agnostic as we can

Using Terraform as the base

Page 26: HashiCorp at Just Eat

How we deal with it

Consul for config...and tfstate files

Page 27: HashiCorp at Just Eat

How we deal with it

On top of the base we put the rest

Page 28: HashiCorp at Just Eat

How we deal with it

On top of the base we put the rest

Page 29: HashiCorp at Just Eat

How we deal with it

On top of the base we put the rest

Page 30: HashiCorp at Just Eat

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: HashiCorp at Just Eat

More HashiCorp to come for us...

● Packer for sharing artifacts and images between providers

● Vault for secrets

Page 32: HashiCorp at Just Eat

Any questions?

Page 33: HashiCorp at Just Eat

We are hiring!Come talk to us.

Page 34: HashiCorp at Just Eat

Thank you