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
  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. 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
  8. 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
  9. 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
  10. Pluggable strategies PROVIDER API LOCATION+DEFAULTS Configuration Pluggable strategies, error &

    retry policies, pagination, drivers 12 May 2016 Rule the cloud with Apache jclouds 11
  11. Portable abstractions API PROVIDER SERVICES MODEL Compute Blob Store Load

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

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

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

    jclouds 16 3.  Register in the Chef Server
  15. 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
  16. 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); !
  17. 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);
  18. 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);
  19. 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();
  20. 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();
  21. 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();
  22. 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();
  23. 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);
  24. 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
  25. 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