Immutable infrastructure with Boxfuse

26
Immutable infrastructure with Boxfuse Lars Östling [email protected] @larsostling

Transcript of Immutable infrastructure with Boxfuse

Immutable infrastructure

with BoxfuseLars Östling

[email protected]@larsostling

Agenda

• Immutable infrastructure

• Boxfuse

• Conclusions

Back in the day…

• Big up-front design

• Long development cycles

• Scary updates

In an agile world…• Short iterations

• Continuous integration /delivery / deployment

• Delivery pipe-lines

• We do it for code …

• … what about our infrastructure?

The software stack

• App - Your code

• App server - Tomcat

• Runtime - JVM

• Libraries - glibc …

• OS Kernel - Linux

Multiple environments

What could possibly go wrong?

• Missing libraries

• Incompatible versions

• Incorrect permissions

• Occupied resources

• … and so on

The solution

Immutable infrastructure

DEV TEST PROD

Machine Image

Machine Image

Machine Image

What is Boxfuse?

• Tool for implementing immutable infrastructure

• Available since April 2015

• Founded by Axel Fontaine (creator of Flyway)

• https://www.boxfuse.com

Demohttps://github.com/larsostling/

immutable-infrastructure-demo

What does it do?

• Analyzes your Java application

• Creates the smallest possible machine image

• Handles deployment to VirtualBox and AWS

How does it do it?

Commands

Supported configurations

• Tomcat / WAR

• Dropwizard

• Spring Boot

• Executable jars

Supported environments

• Development - VirtualBox

• Test - AWS

• Production - AWS

Image features

• Immutable

• Secure by design

• Manageable in size

SSH

Configuration?

• Keep it to a minimum

• Embed in application

• Use environment variables for the rest

Database?

• Keep persistent state out of the image

• Hosted solutions like Amazon RDS, Goole Cloud SQL …

• Migrate at application startup (Flyway, Liquibase …)

Logs?

• View console with ‘boxfuse logs’

• Ship logs to a central server

• Hosted solutions like Loggly, Logentries, Papertrail …

Boxfuse vs. Docker

• Virtualization vs. containerization

• Single-purpose vs. multi-purpose

• Smaller images

• Super-easy and ready to go!

Summary• Create a single immutable

unit

• Regenerate after every change

• Promote unchanged from environment to environment

• Do with your infrastructure what you have been doing with your apps

Lessons learned

• Immutable infrastructure is here to stay

• Boxfuse is a good place to start

Q & A

Thanks!Lars Östling

[email protected]@larsostling