@axelfontaine Immut able Infrastructure Rise of the Machine Images
About Axel Fontaine • Founder and CEO of Boxfuse • Over 15 years industry experience • Continuous Delivery expert • Regular speaker at tech conferences • JavaOne RockStar @axelfontaine
flywaydb.org
boxfuse.com
about questions
sometime in the 20 th century …
http://en.wikipedia.org/wiki/File:Tdkc60cassette.jpg
Challenges = + + ON PREM Power OS Install Procurement Network OS Patching Vendor Mgmt Cooling App Install Capacity Plan. Phys. Security App Updates Financing Phys. Space
Challenges = + + ON PREM Power OS Install Procurement Network OS Patching Vendor Mgmt Cooling App Install Capacity Plan. Phys. Security App Updates Financing Phys. Space
Challenges = + + ON PREM Power OS Install Procurement Network OS Patching Vendor Mgmt Cooling App Install Capacity Plan. Phys. Security App Updates Financing Phys. Space Hours Days or Weeks Months
Challenges = + + COLO Power OS Install Procurement Network OS Patching Vendor Mgmt Cooling App Install Capacity Plan. Phys. Security App Updates Financing Phys. Space Hours Days or Weeks Months
Challenges = + + ROOT SERVER OS Install Procurement OS Patching Vendor Mgmt App Install Capacity Plan. App Updates Financing Hours Days or Weeks
Let’s talk about software OS Install OS Patching App Install App Updates
POLL: which level of automation are you at? Build Unit Tests Continuous Integration Acceptance Tests Continuous Deployment (Code) Continuous Deployment (Code + DB + Configuration) Infrastructure
Test Build
Test Build
• One immutable unit • Regenerated after every change • Promoted from Environment to Environment Classic Mis istake: Build per Environment
App App Server Language Libraries OS Kernel
App App Server Language Libraries OS Kernel
why aren’t we doing the same for the layers this is running on ???
App App Server Language Test Build Libraries OS Kernel
App App App Server Language Test Build Libraries OS Kernel
Any difference is a potential source of errors App App App App Server App Server App Server Language Language Language Libraries Libraries Libraries OS Kernel OS Kernel OS Kernel
Sysadmin Updates Updates Updates App App App App Server App Server App Server Language Language Language Libraries Libraries Libraries OS Kernel OS Kernel OS Kernel
If I had asked my customers what they wanted they would have said a faster horse. Henry Ford
Sysadmin Updates Updates Updates App App App App Server App Server App Server Language Language Language Libraries Libraries Libraries OS Kernel OS Kernel OS Kernel
Automated Sysadmin Updates Updates Updates App App App App Server App Server App Server Language Language Language Libraries Libraries Libraries OS Kernel OS Kernel OS Kernel
fast forward to 2016 …
Every day, AWS adds enough server capacity to power the whole $7B enterprise Amazon.com was in 2004. Weekends included.
Shift to a world of abundance (no more resource scarcity)
Control Plane Data Plane "RIAN archive 341194 Kursk Nuclear Power Plant" by RIA "Advanced Test Reactor" by Argonne National Laboratory - Novosti archive, image #341194 / Sergey Pyatakov / CC-BY-SA originally posted to Flickr as Advanced Test Reactor core, 3.0. Licensed under CC BY-SA 3.0 via Wikimedia Commons - Idaho National LaboratoryUploaded using F2ComButton. http://commons.wikimedia.org/wiki/File:RIAN_archive_341194_ Licensed under CC BY-SA 2.0 via Wikimedia Commons - Kursk_Nuclear_Power_Plant.jpg#mediaviewer/File:RIAN_archi http://commons.wikimedia.org/wiki/File:Advanced_Test_Reac ve_341194_Kursk_Nuclear_Power_Plant.jpg tor.jpg#mediaviewer/File:Advanced_Test_Reactor.jpg
Control Plane Data Plane
Automated Cost-driven Provisioning Architectures
it is time to rethink the faster horse
App App Server Language Test Build Libraries OS Kernel
App App Server Language Test Build Libraries OS Kernel Undifferentiated Heavy lifting
App App Server Language Test Build Libraries OS Kernel
App App Server Machine Machine Language Test Build Image Image Libraries OS Kernel
App App App App Server App Server App Server Machine Machine Machine Language Language Language Image Image Image Libraries Libraries Libraries OS Kernel OS Kernel OS Kernel
Updates Machine Machine Machine Image Image Image
but there is one big problem left …
Machine Network Cable Image
Machine Multiple Network Cable Image GB
Running servers in production should be like going backpacking. You take the bare minimum with you. Anything else is going to hurt. A Wise Man
what is really adding business value ???
Machine Network Cable Image
App Compatibility App Server Man Pages Package Mgr Language Machine Compilers Log Files Network Cable Editors Utilities Image SSH Users Shells Firewall Drivers Libraries Daemons OS Kernel
App App Server Language Bootable App Libraries OS Kernel
15 MB
Multiple 15 MB GB
Bootable Network Cable App
who is this for ???
App App Server Language Libraries OS Kernel 12-factor app
demo
What are the implications ???
Focus shift Instance Service Individual instances become disposable
Treat servers like cattle instead of pets
for servers is dead!
high uptime is a liability The longer an instance is up, the harder it becomes to recreate exactly (and it will fail eventually!)
How to solve service discovery ? ? Instance Elastic Load Instance Balancer Use a stable Instance entry point with an internal registry
What about security ? When was the last time your toaster got hacked?
What about security ? Complexity is the Enemy of Security
What about security ? • Smallest possible attack surface • Vastly reduced implications due to low Bootable uptime and transient nature of instances App • Very difficult to exploit other systems because essential tooling is missing
what about configuration ??? • Bake as much configuration as possible for all environments directly in the Bootable App • Use environment detection and auto-configuration
what about configuration ??? • Bake as much configuration as Key Value possible for all environments JDBC_URL jdbc :… directly in the Bootable App ENV prod • Use environment detection and auto-configuration • Pass remaining configuration Bootable App at startup and expose it as environment variables
what about the database ??? Instance • Keep all persistent state out of the instance, including the database • Use one of the many good hosted solutions available like Amazon RDS or Google Cloud SQL • Use a database migration tool to update the schema on application startup
what about the logs ??? ssh me@myserver1 LOG tail -f server.log file ssh me@myserver2 LOG tail -f server.log file ssh me@myserver3 LOG tail -f server.log file
LOG file LOG log server file where logs can be • aggregated • stored and backuped LOG • indexed file • searched
what about sessions ??? Instance Keep session in an encrypted and signed cookie • avoids session timeouts • avoids server clustering & session replication • avoids sticky sessions & server affinity
what about rolling out new versions ???
Availability Zone 1 App V1 Load Balancer App V1 Logs Availability Zone 2
Availability Zone 1 App V1 Load Balancer App V1 Logs Availability Zone 2
Availability Zone 1 App V1 App V2 Load Balancer App V1 Logs App V2 Availability Zone 2
Availability Zone 1 App V1 App V2 Load Balancer App V1 Logs App V2 Availability Zone 2
what about containers ??? (as in OS-level virtualization)
understanding modern CPUs Both Intel and AMD have hardware support for virtualization • isolation • performance penalty
on prem Image Image your OS+Container responsibility Hypervisor Runtime Hardware Hardware VM Container
cloud Image OS+Container Image Runtime Hypervisor Hypervisor Hardware Hardware VM Container
cloud your responsibility container container containers container container volumes images networking scheduling clo loud responsibility instance machine instance instance instances volumes images networking scheduling
1.5 months of t2.nano
Recommend
More recommend