Why This Talk?
> Numerous technologies
> Deployment: pretty old problem
> High productivity gains possible
> Microservices: A lot more to deploy
Slide 6
Slide 6 text
Why This Talk?
> Easier deployment = easier to change software
> Goal of software architecture
> Dev moving towards DevOps
> Infrastructure as Code
> i.e. deployment becomes part of software
architecture
Package Manager
> Simple format
> Easy to distribute to many servers
> Packages software
> Defines dependencies
> Can also run scripts
> Can also include configurations
Package Manager:
Challenges
> Usually depend on OS and Linux distro
> deb for Debian, msi for Windows etc.
> What if the installation aborts?
> What if the system is inconsistent?
> Dependencies might cause problems
Slide 12
Slide 12 text
Package Manager:
Challenges
> No ideal tool for configuration
> Manual changes might be needed
> Systems might become inconsistent
> What about wiring the hosts together?
Slide 13
Slide 13 text
Package Managers
are widely used
Slide 14
Slide 14 text
Package Managers
are widely used
…and only a part of
the full solution
Slide 15
Slide 15 text
Nix
> Runs on Linux and Mac OS X
> Declarative approach: Define desired state
> Atomic upgrades and rollbacks
> Rollbacks enable experiments
> Fixes some issues
Slide 16
Slide 16 text
Ubuntu Snappy / Flatpak
> Package application with all libraries
> …instead of defining dependencies
> Applications are portable across distros
> Enables rollbacks…
> ...independent updates of distro and app
Slide 17
Slide 17 text
Ubuntu Snappy / Flatpak
> Packaging is all about dependencies
> Basically no packages and dependencies
any more
> Self-contained like Docker images
Slide 18
Slide 18 text
What we still need…
Slide 19
Slide 19 text
> Configuration
> Updates? Rollbacks?
> Make sure installation was successful
Slide 20
Slide 20 text
Configuration
> Templates
> Configuration database catalogs servers
> E.g. add web servers to load balancer
Slide 21
Slide 21 text
> Configuration
> Updates? Rollbacks?
> Make sure installation was successful
Slide 22
Slide 22 text
Idempotency
> Idea: Start installation as often as you like
> …result is the same
> First run on fresh system: install everything
> Run directly afterwards: Do nothing
Slide 23
Slide 23 text
Idempotency
> Configuration describes desired state
> Updates become trivial
Slide 24
Slide 24 text
Idempotency
> Not: Install this package!
> But: This package should be installed
> Package already Installed do nothing
> Package not installed install
> Not: Create this file!
> But: File should look like this.
Slide 25
Slide 25 text
> Configuration
> Updates? Rollbacks?
> Make sure installation was successful
Slide 26
Slide 26 text
Chef
> Idempotent
> Templates for configuration
> Centralized server to store information
Idempotency: Challenges
> Configuration complex
> No simple script
> …but description of desired state
Slide 30
Slide 30 text
Idempotency: Challenges
> Not described? Won’t be “repaired”
> Servers are updated stepwise
> …not from scratch
> Not every starting point might work
> Really reproducible?
Slide 31
Slide 31 text
Why Updates??
Slide 32
Slide 32 text
Checkout
V1
Checkout
V2
Slide 33
Slide 33 text
Checkout
V1
Load Balancer
Database
Checkout
V2
Slide 34
Slide 34 text
Pet
or Cattle?
Update
Replace
Slide 35
Slide 35 text
No more updates!
Slide 36
Slide 36 text
Immutable Server
> Never change a server
> Never update a server
> Always install from scratch
> Fully and reliably reproducible
> Very simple concept
> i.e. no sophisticated tools
Slide 37
Slide 37 text
Immutable Server
seem like a lot of
overhead – how could
they work?
Slide 38
Slide 38 text
Application Deployment
> Install operating system
> Install Tomcat
> Change configuration files
> Add application
Volatile
Stable
Easy to write a script
Slide 39
Slide 39 text
Docker =
Simple Deployment
> Dockerfile
> Just a shell script
> Installation from scratch
> Behind the scenes: Optimization
> Every Dockerfile line = filesystem snapshot
> Reuse snapshots for all other Dockerfiles
Slide 40
Slide 40 text
Docker Filesystem
> Each installation steps
creates a file system
snapshot
> Read go through all
layers in order
Ubuntu
Tomcat
Configuration
Application
read
Docker Filesystem
> Application changes
> Just last layer recreated
> …which is needed anyway
Ubuntu
Tomcat
Configuration
Application
Application V2
Slide 43
Slide 43 text
You could use
Chef + Docker
Slide 44
Slide 44 text
You could use
Chef + Docker
…but why?
Slide 45
Slide 45 text
Chef... might be
useful to deploy
Docker hosts.
Slide 46
Slide 46 text
You think you are
creating a server from
scratch…
Slide 47
Slide 47 text
You think you are
creating a server from
scratch…
...but everything is
cached
Slide 48
Slide 48 text
Why care about
servers?
Slide 49
Slide 49 text
Why Care About Server?
> Applications are what provides value
> Standardize environment
> …and deploy application on the
environment
Slide 50
Slide 50 text
Issues With PaaS
> Standardized infrastructure
> Not flexible
> Hard to migrate existing applications
> Installing PaaS on premise hard
> Enterprise=On-Premise
> Huge success for apps in the Public Cloud
Docker Compose
> Coordinate many containers
> Define containers…
> ...and networking
> Might use Docker Swarm for cluster
> Limited to Docker, though
Slide 57
Slide 57 text
Kubernetes
> Pods: Wired Docker containers
> Service discovery
> Configuration
> Load balancing
> Limited to Docker
Slide 58
Slide 58 text
Conclusion
Slide 59
Slide 59 text
Package Managers
Well established
Can deploy large server farms
Updates?
Configuration?
New approaches are self-contained and
enable rollbacks
Slide 60
Slide 60 text
Idempotent Tools
Updates
Configuration / templates
Book keeping of servers
Truly reproducible?
Complex?
Updates = pets = anti-pattern
Slide 61
Slide 61 text
Docker
Enable immutable server
Simple scripts
Tools for coordination
New infrastructure (e.g. Kubernetes)
Updates = pets = anti-pattern
Slide 62
Slide 62 text
Orchestration
> Needed to create the rest of the
environment
> Terraform
> …or a Docker tool
Slide 63
Slide 63 text
EMail [email protected] to get:
Slides
+ Microservices Primer
+ Sample Microservices Book
+ Sample of Continuous Delivery Book
Powered by Amazon Lambda & Microservices