$30 off During Our Annual Pro Sale. View Details »

Infrastructure as Code using Deployment Manager and Kubernetes

Infrastructure as Code using Deployment Manager and Kubernetes

How to do infrastructure as code using GCP Deployment Manager and automate the creation of Kubernetes + Kubernetes resources. Also, what "cloud-native configuration management" could be.

David Schweikert

May 22, 2018
Tweet

More Decks by David Schweikert

Other Decks in Technology

Transcript

  1. Infrastructure as Code using Deployment Manager
    and Kubernetes
    Cloud Native Computing Switzerland Meetup, 22 May 2018
    David Schweikert @dschweikert
    AdNovum Informatik AG

    View Slide

  2. David, can you please review our Kubernetes setup in GCP?

    View Slide

  3. Problem #1: GCP Infrastructure…

    View Slide

  4. README files
    - Click “Kubernetes Engine”
    - Click “Create new cluster”
    - Fill in:
    - Name: my-new-cluster
    - Description: …
    - …
    - Click ”Cloud SQL”
    - Click “Create Database instance”
    - … (many steps…)
    +

    View Slide

  5. Problem #2: Kubernetes Infrastructure…

    View Slide

  6. View Slide

  7. We need to fix this before going productive

    View Slide

  8. We need it to be:
    • Reproducible
    • Well documented
    • Well tested

    View Slide

  9. We need:
    Infrastructure as code!

    View Slide

  10. We need it fast

    View Slide

  11. Look, Google also provides an infra-as-code tool…

    View Slide

  12. It’s called:
    Deployment Manager

    View Slide

  13. Problem #1? Easy…

    View Slide

  14. View Slide

  15. View Slide

  16. Also…
    • It keeps state on what it created
    • Only does the needed changes
    • And knows when to delete things
    (like Terraform and Helm, for example… and unlike Ansible)
    !

    View Slide

  17. About Problem #2…

    View Slide

  18. View Slide

  19. Kubernetes resources are not supported

    View Slide

  20. View Slide

  21. The best feature of Deployment Manager:
    You can teach it how to manage other resource types that it doesn’t know
    about, even external resources!

    View Slide

  22. Requirement: RESTful API to configure resources
    collection/
    collection/object1
    collection/object2
    GET
    POST
    PUT
    DELETE

    View Slide

  23. Very good example: Kubernetes
    services/
    services/backend
    services/db
    GET
    POST
    PUT
    DELETE

    View Slide

  24. RESTful APIs for configuration management

    View Slide

  25. RESTful APIs as the sole abstraction, no need to hide it!

    View Slide

  26. View Slide

  27. Kubernetes custom resources are becoming more and more important…
    what then?

    View Slide

  28. I would call this “cloud-native configuration management”

    View Slide

  29. Problem #2 was also solved and we delivered in time

    View Slide

  30. The less good parts

    View Slide

  31. 1. Lock-in

    View Slide

  32. If lock-in is a problem, HashiCorp‘s Terraform is probably the better choice
    (but I wish it was more like Deployment Manager …)

    View Slide

  33. Also, if you do chose Terraform to create your GCP resources, you probably
    need something else for the Kubernetes resources (like Helm, Kapitan, …)
    Having a holistic solution would be definitely better though

    View Slide

  34. 2. Maturity

    View Slide

  35. § Using Deployment Manager to manage Kubernetes resource works…
    but it feels like nobody does this

    View Slide

  36. Credit: 20th Century Fox/The Martian

    View Slide

  37. § The best documentation often are the code examples

    View Slide

  38. § You can’t use it to set passwords yet
    (an important feature for that is still in the works)

    View Slide

  39. § Too dangerous for some resources (like external IPs)

    View Slide

  40. To summarize:
    I recommend it…
    • If you are totally committed to GCP
    • or, you just need something quick (but still reproducible)
    Really interesting to me…
    § A configuration management system that interacts with user-defined RESTful
    APIs to manage resources
    § Maybe it’s time for a new open-source “cloud-native configuration
    management” tool?

    View Slide

  41. Questions?
    (see also my blog article for all the details on managing Kubernetes resources
    with Deployment Manager: https://tinyurl.com/dm-kubernetes)

    View Slide