Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rule the cloud with Apache jclouds

Rule the cloud with Apache jclouds

Apache jclouds talk given in Vancouver, at ApacheCon NA 2016.

Apache jclouds is an open source multi-cloud toolkit for the Java platform that gives you the freedom to create applications that are portable across clouds while giving you full control to use cloud-specific features.

Ignasi Barrera

May 13, 2016
Tweet

More Decks by Ignasi Barrera

Other Decks in Technology

Transcript

  1. Rule the cloud with!
    Apache jclouds
    ACNA 2016 − Vancouver

    Ignasi Barrera
    Apache jclouds PMC
    ASF Member
    Senior Engineer
    Abiquo

    View Slide

  2. Agenda
    •  Overview
    •  Core concepts
    •  Example application
    •  Roadmap: what’s next?
    12 May 2016 Rule the cloud with Apache jclouds 2

    View Slide

  3. What is Apache jclouds?
    An open source multi-cloud toolkit for the
    Java platform
    12 May 2016 Rule the cloud with Apache jclouds 3

    View Slide

  4. Why does multi-cloud matter?
    •  High availability
    •  Privacy
    •  Cost
    •  Performance
    •  Support

    One size does not fit all
    Avoid lock-in
    12 May 2016 Rule the cloud with Apache jclouds 4

    View Slide

  5. What does it do?
    Helps existing tools connect to cloud services
    •  Consistent integration pattern
    •  Pluggable components
    •  Addresses service quirks in a clean way
    •  Runtime portability
    •  Error/retry handling
    •  Optimization: pagination, (re)auth, caching
    12 May 2016 Rule the cloud with Apache jclouds 5

    View Slide

  6. How to keep quality?
    Supporting many providers is hard:
    •  APIs / Services change
    •  Providers can become obsolete
    •  Contributions have to be maintained
    •  …
    Unit + Live tests
    12 May 2016 Rule the cloud with Apache jclouds 6

    View Slide

  7. Core concepts

    View Slide

  8. Locations
    12 May 2016 Rule the cloud with Apache jclouds 8
    Help normalize
    placement across
    resource types

    All top-level
    resources have a
    location
    US-CA
    DE-HE
    BR-SP
    CH-ZH JP-13

    View Slide

  9. APIs


    API
    Custom endpoint
    Credentials

    APIs are the Java
    translation of API
    docs
    Abiquo, EC2, Nova,
    CloudStack…
    12 May 2016 Rule the cloud with Apache jclouds 9

    View Slide

  10. Providers


    PROVIDER
    API
    LOCATION+DEFAULTS
    Configuration Providers represent
    concrete cloud services:
    API + location + defaults

    AWS, Azure, GCE,
    Rackspace…
    12 May 2016 Rule the cloud with Apache jclouds 10

    View Slide

  11. Pluggable strategies


    PROVIDER
    API
    LOCATION+DEFAULTS
    Configuration Pluggable
    strategies, error &
    retry policies,
    pagination, drivers
    12 May 2016 Rule the cloud with Apache jclouds 11

    View Slide

  12. Portable abstractions


    API
    PROVIDER
    SERVICES
    MODEL Compute
    Blob Store
    Load Balancer
    12 May 2016 Rule the cloud with Apache jclouds 12

    View Slide

  13. Example application

    View Slide

  14. Example application
    12 May 2016 Rule the cloud with Apache jclouds 14
    1.  Provision a
    load balancer

    View Slide

  15. Example application
    12 May 2016 Rule the cloud with Apache jclouds 15
    2.  Create servers
    in two clouds

    View Slide

  16. Example application
    12 May 2016 Rule the cloud with Apache jclouds 16
    3.  Register in the
    Chef Server

    View Slide

  17. Example application
    12 May 2016 Rule the cloud with Apache jclouds 17
    4.  Service
    discovery

    View Slide

  18. Example application
    12 May 2016 Rule the cloud with Apache jclouds 18
    5.  Forward traffic

    View Slide

  19. Example application
    12 May 2016 Rule the cloud with Apache jclouds 19
    •  Using the same code to:
    – Deploy all servers
    – Generate the bootstrap scripts
    – Manage the different clouds

    View Slide

  20. Source code

    View Slide

  21. Connection to the provider
    12 May 2016 Rule the cloud with Apache jclouds 21
    ComputeServiceContext ctx =
    ContextBuilder.newBuilder(”google-compute-engine”)
    .credentials(”account-email”, ”private-key”)
    .buildView(ComputeServiceContext.class);
    !

    View Slide

  22. Connection to the provider
    12 May 2016 Rule the cloud with Apache jclouds 22
    ComputeServiceContext ctx =
    ContextBuilder.newBuilder(”google-compute-engine”)
    .credentials(”account-email”, ”private-key”)
    .buildView(ComputeServiceContext.class);
    ChefApi chef =
    ContextBuilder.newBuilder(”chef”)
    .endpoint(“https://chef-server/api”)
    .credentials(”client-id”, ”private-key”)
    .buildApi(ChefApi.class);

    View Slide

  23. Connection to the provider
    12 May 2016 Rule the cloud with Apache jclouds 23
    ComputeServiceContext ctx =
    ContextBuilder.newBuilder(”google-compute-engine”)
    .credentials(”account-email”, ”private-key”)
    .buildView(ComputeServiceContext.class);
    ChefApi chef =
    ContextBuilder.newBuilder(”chef”)
    .endpoint(“https://chef-server/api”)
    .credentials(”client-id”, ”private-key”)
    .buildApi(ChefApi.class);
    ctx.unwrapApi(GoogleComputeEngineApi.class);

    View Slide

  24. Deployment template
    12 May 2016 Rule the cloud with Apache jclouds 24
    ComputeService compute = ctx.getComputeService();
    Template template = compute.templateBuilder()
    .smallest()
    .minRam(2048)
    .osFamily(OsFamily.DEBIAN)
    .os64Bit(true)
    .options(runScript(execute-chef)
    .inboundPorts(22, 80, 22002))
    .build();

    View Slide

  25. Image selection
    12 May 2016 Rule the cloud with Apache jclouds 25
    ComputeService compute = ctx.getComputeService();
    Template template = compute.templateBuilder()
    .smallest()
    .minRam(2048)
    .osFamily(OsFamily.DEBIAN)
    .os64Bit(true)
    .options(runScript(execute-chef)
    .inboundPorts(22, 80, 22002))
    .build();

    View Slide

  26. Deployment configuration
    12 May 2016 Rule the cloud with Apache jclouds 26
    ComputeService compute = ctx.getComputeService();
    Template template = compute.templateBuilder()
    .smallest()
    .minRam(2048)
    .osFamily(OsFamily.DEBIAN)
    .os64Bit(true)
    .options(runScript(execute-chef)
    .inboundPorts(22, 80, 22002))
    .build();

    View Slide

  27. Deployment template
    12 May 2016 Rule the cloud with Apache jclouds 27
    ComputeService compute = ctx.getComputeService();
    Template template = compute.templateBuilder()
    .smallest()
    .minRam(2048)
    .osFamily(OsFamily.DEBIAN)
    .os64Bit(true)
    .options(runScript(execute-chef)
    .inboundPorts(22, 80, 22002))
    .build();

    View Slide

  28. Deploy the nodes
    12 May 2016 Rule the cloud with Apache jclouds 28
    compute.createNodesInGroup(“lb”, 1, lb-template);
    compute.createNodesInGroup(“web”, 4, web-template);

    View Slide

  29. Live demo!!
    !
    https://github.com/nacx/acna2016-demo

    View Slide

  30. Roadmap

    View Slide

  31. Roadmap
    •  Promote Docker out of labs
    •  Complete the Azure ARM provider
    •  Finish the ProfitBricks REST provider
    •  Mentor GSoC 2016 project
    •  Release jclouds 2.0
    •  More docs!

    12 May 2016 Rule the cloud with Apache jclouds 31

    View Slide

  32. Get involved!
    •  Talk to us
    – Participate in our mailing lists
    – Join the #jclouds IRC channel at Freenode
    •  Contribute code
    – We use GitHub. Just raise a pull request!
    •  Contribute documentation
    – You don’t even need to checkout the code of
    the site. Our walk n’ doc allows you to edit
    every page on-the-fly!
    12 May 2016 Rule the cloud with Apache jclouds 32

    View Slide

  33. Thank you!
    https://jclouds.apache.org


    View Slide