$30 off During Our Annual Pro Sale. View Details »

Serverless, not infrastructureless

Serverless, not infrastructureless

Talk from CloudCamp, about the reality of serverless, and some questions about the future of specialisation and systems administration.

Gareth Rushgrove

July 06, 2017
Tweet

More Decks by Gareth Rushgrove

Other Decks in Technology

Transcript

  1. (without introducing more risk)
    Serverless, not
    infrastructureless
    Puppet
    Gareth Rushgrove
    More than just functions, unfortunately

    View Slide

  2. (without introducing more risk)
    @garethr

    View Slide

  3. (without introducing more risk)
    Gareth Rushgrove

    View Slide

  4. (without introducing more risk)
    (as a service)
    Just add function

    View Slide

  5. Replacing cron jobs with Lambda
    Gareth Rushgrove

    View Slide

  6. (without introducing more risk)
    Gareth Rushgrove
    Clojure hello world
    (ns net.morethanseven.hello
    (:gen-class :implements
    [com.amazonaws.services.lambda.runtime.RequestStreamHandler])
    (:require [clojure.java.io :as io]
    [clojure.string :as str])
    (:import (com.amazonaws.services.lambda.runtime Context)))
    (defn -handleRequest
    [this input-stream output-stream context]
    (let [handle (io/writer output-stream)]
    (.write handle (str "hello" "world"))
    (.flush handle)))

    View Slide

  7. (without introducing more risk)
    Gareth Rushgrove
    Javascript hello world
    exports.myHandler = function(event, context, callback) {
    callback(null, "Hello World");
    }

    View Slide

  8. (without introducing more risk)
    Sorry, I couldn’t resist
    Not so faas(t)

    View Slide

  9. (without introducing more risk)
    Gareth Rushgrove
    Some required configuration…
    variable "aws_region" {
    description = "AWS Region Lambda function is deployed to"
    }
    variable "apex_environment" {
    description = "Apex configured environment. Auto provided by 'apex infra'"
    }
    variable "apex_function_role" {
    description = "Provisioned Lambda Role ARN via Apex. Auto provided by 'apex i
    }
    variable "apex_function_hub" {
    description = "Provisioned function 'hub' ARN information. Auto provided by '
    }
    variable "apex_function_hub_name" {
    description = "Provisioned function 'hub' name information. Auto provided by
    }

    View Slide

  10. (without introducing more risk)
    Gareth Rushgrove
    …some more required configuration
    resource "aws_cloudwatch_event_rule" "every_five_minutes" {
    name = "every-five-minutes"
    description = "Fires every five minutes"
    schedule_expression = "rate(5 minutes)"
    }
    resource "aws_cloudwatch_event_target" "check_hub_every_five_minutes" {
    rule = "${aws_cloudwatch_event_rule.every_five_minutes.name}"
    target_id = "${var.apex_function_hub_name}"
    arn = "${var.apex_function_hub}"
    }
    resource "aws_lambda_permission" "allow_cloudwatch_to_call_hub" {
    statement_id = "AllowExecutionFromCloudWatch"
    action = "lambda:InvokeFunction"
    function_name = "${var.apex_function_hub_name}"
    principal = "events.amazonaws.com"

    View Slide

  11. For the 3 line Javascript function we needed
    32 lines of configuration
    Gareth Rushgrove

    View Slide

  12. I had to care about CloudWatch event targets,
    event rules and Lambda permissions, all of
    which are platform specific
    Gareth Rushgrove

    View Slide

  13. A real world example from Serverless
    Gareth Rushgrove

    View Slide

  14. (without introducing more risk)
    Gareth Rushgrove
    and more different configuration
    "EbsBackupSnapper": {
    "Type": "AWS::Lambda::Function",
    "DependsOn": [
    "EbsBackupExecutionRole",
    "EbsBackupExecutionPolicy"
    ],
    "Properties": {
    "Code": {
    "S3Bucket": "demos.serverlesscode.com",
    "S3Key": "2015-11-ebs-snapshots/ebs-snapper.zip"
    },
    "Role": {
    "Fn::GetAtt": ["EbsBackupExecutionRole", "Arn"]
    },
    "Timeout": 60,
    "Handler": "lambda_function.lambda_handler",
    "Runtime": "python2.7",

    View Slide

  15. For the 33 line Python function we needed
    100 lines of configuration
    Gareth Rushgrove

    View Slide

  16. I had to care about IAM policies and roles,
    which again are platform specific
    Gareth Rushgrove

    View Slide

  17. (without introducing more risk)
    All the configuration
    Imagine

    View Slide

  18. Running the same function on
    multiple platforms?
    Gareth Rushgrove

    View Slide

  19. Multiple functions doing similar things?
    Gareth Rushgrove

    View Slide

  20. infrastructure
    /ˈɪnfrəstrʌktʃə/

    noun

    1. the installations that form the basis for any operation or system
    Gareth Rushgrove

    View Slide

  21. Removing servers doesn’t appear to have
    removed the need for infrastructure
    Gareth Rushgrove

    View Slide

  22. (without introducing more risk)
    If all you remember is
    Conclusions

    View Slide

  23. Will all serverless developers write the
    functions and associated configuration?
    Gareth Rushgrove

    View Slide

  24. (without introducing more risk)
    Gareth Rushgrove
    Do we need better abstractions?
    */5 * * * * node /home/garethr/hello.js

    View Slide

  25. Will we need people who specialise in the
    configuration of serverless systems?
    Gareth Rushgrove

    View Slide

  26. Maybe we’ll call those people
    Systems Administrators
    Gareth Rushgrove

    View Slide

  27. (without introducing more risk)
    Thanks for listening
    Find me later for questions

    View Slide