Puppenspielertricks für die Cloud

VogelIT Cloud Computing, München

Felix Frank, Systems Architect
The unbelievable Machine Company GmbH

Felix Frank

  • Computermensch
  • Radfahrer
  • trockener Open-Source Entwickler
  • @felis_rex

The unbelievable Machine Company

Unendliche Buzzwords

...und "Cloud" ist eines der häufigsten

...und aus gegebenem Anlass

Essenz: software-definierte Infrastruktur

https://commons.wikimedia.org/wiki/File:Person_icon.png

http://commons.wikimedia.org/wiki/User:Heb

https://commons.wikimedia.org/wiki/File:Generic_Server_Icon.svg

Perfektes Pendant zu

Infrastructure as Code

Warum?

Beispielsituation

commit f38828d4047ba803fd4d0ef906f109cfb57e9bb6
Author: Felix Frank 
Date:   Mon Sep 18 02:48:58 2017 +0200

    move product title index to redis

Tests laufen durch

  • Unit Tests
  • Integrationstests
  • Acceptance Tests

Produktion
bricht katastrophal

...Deployment erforderte Firewall Anpassung

Wie hilft die Cloud?

  1. kurzer Technologie-Exkurs
  2. Praxisbeispiel
  3. Business Value

Infrastructure
as Code

Config Management
auf einen Blick


class apache {
  package { "apache2":
    ensure => installed,
  }
  ->
  file { "/etc/apache2/apache2.conf":
    content => epp("apache/apache2.conf.epp"),
  }
}


ec2_instance { 'lk10px33':
  ensure            => running,
  region            => 'us-east-1',
  availability_zone => 'us-east-1a',
  image_id          => 'ami-b23f9a',
  instance_type     => 't2.micro',
  ...


---
- name: Deploy Webservers
  hosts: was
  roles:
    - common
    - tomcat
    - nginx

- name: Deploy Loadbalancers
  hosts: loadbalancer
  roles:
    - common
    - haproxy
    - keepalived


resource "aws_instance" "app" {
  count = 5
  ami           = "ami-408c7f28"
  instance_type = "t1.micro"
}

https://www.terraform.io/


provider "aws" {
  access_key = "AWS ACCESS KEY"
  secret_key = "AWS SECRET KEY"
  region     = "AWS REGION"
}
module "consul" {
  source = "github.com/hashicorp/consul/terraform/aws"

  key_name = "AWS SSH KEY NAME"
  key_path = "PATH TO ABOVE PRIVATE KEY"
  region   = "us-east-1"
  servers  = "3"
}

https://www.terraform.io/intro/getting-started/modules.html

Welches Tool ist für mich?

Im wahren Leben

E-Commerce Anwendung

Hosted in Openstack

Git Monolith

+
|- client code
 \- (lots of Java...)
|
|- server code
 \- (more Java...)
|
|- deployment
 \- ansible
  |- playbooks
  |- roles
  \- environment
   |- production
   |- pre-live
   |- testing

  - type: was
    description: webappservers
    clouds:
      site1:
        azs: [ AZ1, AZ3 ]
      site2:
        azs: [ AZ1, AZ3 ]
    flavor: "MM-2-15-V1"
    size: 20

  - type: db
    description: dbservers
    clouds:
      site1:
        azs: [ AZ1, AZ2 ]
      site2:
        azs: [ AZ2, AZ3 ]
      site3:
        azs: [ AZ1 ]
    flavor: "MS-4-4-V1"
    size: 20

Ansible Deployment

Sauberes Deployment in der Cloud

Frische Web-App-Server

Deployments ohne Downtime

Grün-Blau Deployment
in der Cloud

Grün-Blau Deployment

Bessere Test Coverage dank Cloud

Infrastruktur CI

Zusammengefasst

Infrastructure as Code
als wichtiger
Automation Eckpfeiler

CI Zyklus
umfasst Konfiguration
und Redeployments

Cloud erlaubt umfassende
Infrastructure as Code
Implementierung

Vielen Dank

Ein Wort zu DevOps

  • Culture
  • Learning
  • Automation
  • Measure
  • Sharing