O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Containerize! Between Docker and Jube.

1.553 visualizações

Publicada em

Containerize! Between Docker and Jube.

Publicada em: Tecnologia
  • Entre para ver os comentários

Containerize! Between Docker and Jube.

  1. 1. Broughttoyou byHenrykKonsek Containerize! Between Docker and Jube
  2. 2. @hekonsek
  3. 3. ● Docker ● Kubernetes ● OpenShift ● Fabric8 ● Jube This talk
  4. 4. Server for running and managing Linux containers. What is...
  5. 5. Operating-system-level virtualization. What are Linux containers?
  6. 6. chroot on steroids + some kernel magic What are Linux containers?
  7. 7. ● slooooooow ● gigantic images ● aggressive resource allocation ● bad API Why not regular virtualization?
  8. 8. Container is the running image. Key concepts ● image (immutable, no state) ● container (mutable, has state)
  9. 9. Container is the running image. Key concepts
  10. 10. Archived filesystem + metadata. Docker image
  11. 11. Commands. Docker awesomeness #1
  12. 12. Layers. Docker awesomeness #2 WAR Tomcat JRE Ubuntu base
  13. 13. Registries. Docker awesomeness #3
  14. 14. Build once. Deploy everywhere! Docker awesomeness #4
  15. 15. Immutable deployment. Use ENV variable to the container. Docker awesomeness #4
  16. 16. “Recipes” for the new images. Dockerfiles FROM ubuntu EXPOSE 8080 RUN apt-get install java RUN mkdir /jars ADD target/app.jar /jars/ CMD ["java", "-jar", "/jars/app.jar"]]
  17. 17. Create the new image $ docker build -t com.me/app:1.0 . $ docker run -t com.me/app:1.0]
  18. 18. Let’s create the production-grade container! Demo! FROM ubuntu RUN apt-get update -qqy RUN apt-get install -qqy cowsay ENTRYPOINT ["/usr/games/cowsay"] CMD ["Hello Docker!"]
  19. 19. Docker Maven plugin by Roland ‘Jolokia’ Huß How can I put a fresh jar into an image?
  20. 20. How can I put a fresh jar into an image? <image> <name>${project.artifactId}:${project.version}</name> <build> <from>hekonsek/fatjar:0.0.10-SNAPSHOT</from> <assemblyDescriptorRef>artifact</assemblyDescriptorRef> <exportDir>/jars</exportDir> </build> </image> mvn docker:buid docker:push
  21. 21. Provided by the database community/vendor. How can I get database image? docker run -d -p 27017:27017 --name mongo mongo ]
  22. 22. Yes. That’s all I can say ;) . Any Red Hat customers using Docker in production?
  23. 23. The platform to scale Docker horizontally. Kubernetes by...
  24. 24. You can start many containers with your server Docker. Why scale Docker?
  25. 25. But at some point you have to add more physical machines. Why scale Docker?
  26. 26. Now networking between these containers becomes a challenge :( Why scale Docker?
  27. 27. High availability - single Docker server is SPOF. Why scale Docker?
  28. 28. Helps you to keep your scaled Docker stuff together. Kubernetes
  29. 29. Install and admin it yourself. Or... Where can I find Kubernetes?
  30. 30. Where can I find Kubernetes? - Red Hat Atomic - Red Hat Linux 7.1 - CoreOS Linux - OpenShift 3 - GKE (Google Container Engine) - Microsoft Azure - All the major cloud providers (soon)
  31. 31. - REST API - etcd key/value store - controller manager server Kubernetes architecture - master node
  32. 32. - Docker server - kubelet - network proxy Kubernetes architecture - minion node
  33. 33. Groups of containers running at the same physical machine. Pod - unit of deployment
  34. 34. Kubernetes guarantees all or nothing deployment and execution of pods. Pod - atomic unit of deployment
  35. 35. All containers within the pod can access the same volumes. Pod nodes == shared disk
  36. 36. Pods uses direct connections for the intra-pod communication. Pod - internal communication
  37. 37. Pods use network proxy for the inter-pod communication. Pod - external communication
  38. 38. The network proxy
  39. 39. Guarantees N-instances of pods running at the same time. Replication controller
  40. 40. Starts missing instances of the pods. Replication controller
  41. 41. Performs health checks. Can kill and restart failing nodes. Replication controller
  42. 42. In the Kubernetes world, starting the server is not human responsibility anymore! How cool is that? Replication controller
  43. 43. The typical micoservices developer. Services
  44. 44. Can we do better than Eureka? How to discover the service?
  45. 45. Try to imagine something simpler. Services coordinates == environment variables String host = System.getenv("MONGO_SERVICE_DB_HOST"); String port = System.getenv("MONGO_SERVICE_DB_PORT"); Mongo mongo = new Mongo(host, Integer.parseInt(port));
  46. 46. Kubernetes + something extra. OpenShift 3 == Cool PaaS
  47. 47. - Enterprise (private cloud) - On-Line (public cloud) - Origin (community project) OpenShift 3 types
  48. 48. You can install OS Origin on your local machine as a Docker container. OpenShift 3
  49. 49. - access external services using single URL - HAproxy instance bound to the services - TLS/SSL scope rules OpenShift 3 - routing
  50. 50. Local (docker-based) cloud + Docker images + Kubernetes = smooth transition from dev to the production OpenShift 3
  51. 51. OpenShift provides user groups based on the Kubernetes namespaces. Multi-tenancy
  52. 52. OpenShift comes with the CI server that can build and deploy the containers for you. Build & deploy pipeline
  53. 53. Off-the-shelf microservices! OpenShift marketplace
  54. 54. Dev (and Ops) extras on the top of the Kubernetes. Fabric8
  55. 55. Base examples you can use as templates for docker containers. Value added by Fabric8 - quickstarts
  56. 56. Maven plugins making it easier to deploy Docker images into Kubernetes. Value added by Fabric8 - developer tooling
  57. 57. Value added by Fabric8 - centralized logging
  58. 58. - CDI extension for Kubernetes - Kubernetes API client for Java - Spring Boot Kubernetes integration - Kubernetes JUnit goodies Value added by Fabric8 - extra libraries
  59. 59. Value added by Fabric8 - fancy web UI
  60. 60. Pure-Java implementation of the Kubernetes API (no Docker here!) Jube
  61. 61. Why Jube? - your VPS doesn’t support Docker - your operating system doesn’t support Docker/Kubernetes - you’re not operational ready to go into the production with Docker
  62. 62. Jube architecture
  63. 63. Demo! CowSay and MongoDB in Kubernetes. How cool is that?

×