Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Containerize!

351 views

Published on

On Docker, Kubernetes and stuff

Published in: Technology
  • Be the first to comment

Containerize!

  1. 1. Broughttoyou byHenrykKonsek Containerize! On Docker, Kubernetes and stuff
  2. 2. Henryk Konsek - engineer at Red Hat - open source junkie @hekonsek
  3. 3. ● Docker ● Kubernetes overview ● Kubernetes services ● OpenShift This talk @hekonsek
  4. 4. Docker @hekonsek
  5. 5. Server for running and managing Linux containers. What is... @hekonsek
  6. 6. Operating-system-level virtualization. What are Linux containers? @hekonsek
  7. 7. chroot on steroids + some kernel magic What are Linux containers? @hekonsek
  8. 8. ● slooooooow ● gigantic images ● aggressive resource allocation ● bad API Why not regular virtualization? @hekonsek
  9. 9. Container is the running image. Key concepts ● image (immutable, no state) ● container (mutable, has state) @hekonsek
  10. 10. Container is a running image. Key concepts @hekonsek
  11. 11. Archived file system + metadata. Docker image @hekonsek
  12. 12. Commands. Docker awesomeness #1 @hekonsek
  13. 13. Layers. Docker awesomeness #2 WAR Tomcat JRE Ubuntu base @hekonsek
  14. 14. Registries. Docker awesomeness #3 @hekonsek
  15. 15. Build once. Deploy everywhere! Docker awesomeness #4 @hekonsek
  16. 16. Immutable deployment. Use ENV variable to configure the container. Docker awesomeness #4 @hekonsek
  17. 17. “Recipes” for creating 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"]] @hekonsek
  18. 18. Create new image $ docker build -t com.me/app:1.0 . $ docker run -t com.me/app:1.0] @hekonsek
  19. 19. Let’s create a production-grade container! Demo! FROM ubuntu RUN apt-get update -qqy RUN apt-get install -qqy cowsay ENTRYPOINT ["/usr/games/cowsay"] CMD ["Hello Docker!"] @hekonsek
  20. 20. Docker Maven plugin How can I put a fresh jar into an image? @hekonsek
  21. 21. Provided by the database community/vendor. How can I get database image? docker run -d -p 27017:27017 --name mongo mongo ] @hekonsek
  22. 22. Kubernetes overview @hekonsek
  23. 23. A platform to scale Docker horizontally. Kubernetes by... @hekonsek
  24. 24. You can start many containers with your Docker server. Why scale Docker? @hekonsek
  25. 25. But at some point you have to add more physical machines. Why scale Docker? @hekonsek
  26. 26. TL;DR; YES! Is scaling Docker hard? @hekonsek
  27. 27. High availability - single Docker server is SPOF. Why scale Docker? @hekonsek
  28. 28. Helps you to keep your scaled Docker stuff together. Kubernetes @hekonsek
  29. 29. Install and admin it yourself. Or... Where can I find Kubernetes? @hekonsek
  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) @hekonsek
  31. 31. - REST API - etcd key/value store - controller manager server Kubernetes architecture - master node @hekonsek
  32. 32. - Docker server - kubelet - network proxy Kubernetes architecture - minion node @hekonsek
  33. 33. Groups of containers running at the same physical machine. Pod - unit of deployment @hekonsek
  34. 34. Kubernetes guarantees all or nothing deployment and execution of pods. Pod - atomic unit of deployment @hekonsek
  35. 35. All containers within the pod can access the same volumes. Pod nodes == shared disk @hekonsek
  36. 36. Pods uses direct connections for the intra-pod communication. Pod - internal communication @hekonsek
  37. 37. Pods use network proxy for the inter-pod communication. Pod - external communication @hekonsek
  38. 38. The network proxy @hekonsek
  39. 39. Guarantees N-instances of pods running at the same time. Replication controller @hekonsek
  40. 40. Starts missing instances of the pods. Replication controller @hekonsek
  41. 41. Performs health checks. Can kill and restart failing nodes. Replication controller @hekonsek
  42. 42. In the Kubernetes world, starting the server is not human responsibility anymore! How cool is that? Replication controller @hekonsek
  43. 43. Kubernetes services @hekonsek
  44. 44. The typical micoservices developer. Services @hekonsek
  45. 45. Eureka? Etcd? Consul? How to discover a service? @hekonsek
  46. 46. 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)); @hekonsek
  47. 47. OpenShift @hekonsek
  48. 48. Kubernetes + some cool things. OpenShift 3 @hekonsek
  49. 49. - Enterprise (private cloud) - On-Line (public cloud) - Origin (community project) OpenShift 3 types @hekonsek
  50. 50. You can install OS Origin on your local machine as a Docker container. OpenShift 3 @hekonsek
  51. 51. - access external services using single URL - HAproxy instance bound to the services - TLS/SSL termiantion rules OpenShift 3 - routing @hekonsek
  52. 52. Local (docker-based) cloud + Docker images + Kubernetes = smooth transition from dev to the production OpenShift 3 @hekonsek
  53. 53. OpenShift provides user groups based on the Kubernetes namespaces. Multi-tenancy @hekonsek
  54. 54. OpenShift comes with the CI server that can build and deploy the containers for you. Build & deploy pipeline @hekonsek
  55. 55. Off-the-shelf microservices. OpenShift marketplace @hekonsek
  56. 56. Thank you! Henryk Konsek @hekonsek hekonsek@gmail.com @hekonsek

×