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.

4ca6230b05046f1a809835985b1f8bc2?s=128

Ignasi Barrera

May 13, 2016
Tweet

Transcript

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

    Ignasi Barrera Apache jclouds PMC ASF Member Senior Engineer Abiquo
  2. Agenda •  Overview •  Core concepts •  Example application • 

    Roadmap: what’s next? 12 May 2016 Rule the cloud with Apache jclouds 2
  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
  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
  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
  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
  7. Core concepts

  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
  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
  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
  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
  12. Portable abstractions API PROVIDER SERVICES MODEL Compute Blob Store Load

    Balancer 12 May 2016 Rule the cloud with Apache jclouds 12
  13. Example application

  14. Example application 12 May 2016 Rule the cloud with Apache

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

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

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

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

    jclouds 18 5.  Forward traffic
  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
  20. Source code

  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); !
  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);
  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);
  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();
  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();
  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();
  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();
  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);
  29. Live demo!! ! https://github.com/nacx/acna2016-demo

  30. Roadmap

  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
  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
  33. Thank you! https://jclouds.apache.org