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

From source to Kubernetes in 30 minutes

From source to Kubernetes in 30 minutes

Bastian Hofmann

October 21, 2019
Tweet

More Decks by Bastian Hofmann

Other Decks in Programming

Transcript

  1. @BastianHofmann
    From source to Kubernetes
    In 30 Minutes
    Bastian Hofmann
    [email protected]

    View Slide

  2. CI/CD

    View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. Container orchestration platform

    View Slide

  7. Deploy, run and scale your services
    in isolated containers

    View Slide

  8. Your application is bundled in an
    image

    View Slide

  9. The image contains everything the
    application needs to run

    View Slide

  10. The image is started in an isolated
    container

    View Slide

  11. No vendor lock in

    View Slide

  12. Standardized APIs

    View Slide

  13. Your laptop

    View Slide

  14. Bare metal

    View Slide

  15. Cloud Providers

    View Slide

  16. And if you don't want to install and
    maintain Kubernetes yourself

    View Slide

  17. Managed Kubernetes

    View Slide

  18. View Slide

  19. So we have code, how do we get this
    into Kubernetes?

    View Slide

  20. Angular demo application

    View Slide

  21. Demo

    View Slide

  22. We have to

    View Slide

  23. Build a docker image

    View Slide

  24. Contains everything that the service
    needs to run

    View Slide

  25. Make the build as fast as possible

    View Slide

  26. Make the image as small as possible

    View Slide

  27. Demo

    View Slide

  28. Tell Kubernetes to

    View Slide

  29. Start containers

    View Slide

  30. In Kubernetes

    View Slide

  31. • A group of 1 or more
    containers
    • Same port space
    • Within a Pod:
    communication over
    localhost
    • Every container has their
    own filesystem
    • Every Pod has it's own IP
    • All Pods can talk with each
    other
    • IPs change all the time
    Pod

    View Slide

  32. Deployment

    View Slide

  33. LoadBalancer

    View Slide

  34. Everything in Kubernetes is a
    resource (document) defined in
    YAML

    View Slide

  35. Demo

    View Slide

  36. Also all those YAML files are not nice

    View Slide

  37. Helm

    View Slide

  38. Also we need

    View Slide

  39. DNS

    View Slide

  40. TLS

    View Slide

  41. Monitoring

    View Slide

  42. CI/CD pipeline

    View Slide

  43. Make use of Kubernetes "magic"

    View Slide

  44. Demo

    View Slide

  45. Magic recap

    View Slide

  46. LoadBalancers

    View Slide

  47. Automatically creates a highly
    available LoadBalancer with a
    public IP address

    View Slide

  48. Ingress controller

    View Slide

  49. The ingress controller (nginx) listens
    on routing rules in Ingress Resources
    and configures itself to route
    incoming traffic to the correct
    running and healthy pods

    View Slide

  50. cert-manager

    View Slide

  51. Cert-manager listens on Ingress
    Resources and if they need TLS,
    requests a certificate from
    LetsEncrypt

    View Slide

  52. external-dns

    View Slide

  53. External-DNS listens on Ingress
    Resources and creates DNS entries

    View Slide

  54. Sealed Secrets

    View Slide

  55. Secrets are stored encrypted in Git
    and decrypted inside of the cluster

    View Slide

  56. Prometheus

    View Slide

  57. Kubernetes and Node metrics are
    automatically included

    View Slide

  58. Kubernetes and Node alerts are
    automatically included

    View Slide

  59. Kubernetes and Node dashboards
    are automatically included

    View Slide

  60. Scraping targets can be
    automatically discovered

    View Slide

  61. Service Meshes

    View Slide

  62. View Slide

  63. Recommendation: Start playing
    around with Kubernetes

    View Slide

  64. Alternatives

    View Slide

  65. Flux

    View Slide

  66. View Slide

  67. Knative

    View Slide

  68. Kubernetes-based platform to
    deploy and manage modern
    serverless workloads

    View Slide

  69. Tekton CD

    View Slide

  70. CI that runs completely within
    Kubernetes with Kubernetes Custom
    Resources

    View Slide

  71. Resources

    View Slide

  72. https:/
    /gitlab.com/bashofmann/
    angular-test-app

    View Slide

  73. https:/
    /gitlab.com/bashofmann/
    angular-test-app-finished

    View Slide

  74. https:/
    /github.com/syseleven/
    golem-workshop

    View Slide

  75. [email protected]
    https:/
    /twitter.com/BastianHofmann
    http:/
    /speakerdeck.com/u/bastianhofmann

    View Slide