Infrastructure as Code using Deployment Manager
and Kubernetes
Cloud Native Computing Switzerland Meetup, 22 May 2018
David Schweikert @dschweikert
AdNovum Informatik AG
Slide 2
Slide 2 text
David, can you please review our Kubernetes setup in GCP?
We need it to be:
• Reproducible
• Well documented
• Well tested
Slide 9
Slide 9 text
We need:
Infrastructure as code!
Slide 10
Slide 10 text
We need it fast
Slide 11
Slide 11 text
Look, Google also provides an infra-as-code tool…
Slide 12
Slide 12 text
It’s called:
Deployment Manager
Slide 13
Slide 13 text
Problem #1? Easy…
Slide 14
Slide 14 text
No content
Slide 15
Slide 15 text
No content
Slide 16
Slide 16 text
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)
!
Slide 17
Slide 17 text
About Problem #2…
Slide 18
Slide 18 text
No content
Slide 19
Slide 19 text
Kubernetes resources are not supported
Slide 20
Slide 20 text
No content
Slide 21
Slide 21 text
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!
Slide 22
Slide 22 text
Requirement: RESTful API to configure resources
collection/
collection/object1
collection/object2
GET
POST
PUT
DELETE
Slide 23
Slide 23 text
Very good example: Kubernetes
services/
services/backend
services/db
GET
POST
PUT
DELETE
Slide 24
Slide 24 text
RESTful APIs for configuration management
Slide 25
Slide 25 text
RESTful APIs as the sole abstraction, no need to hide it!
Slide 26
Slide 26 text
No content
Slide 27
Slide 27 text
Kubernetes custom resources are becoming more and more important…
what then?
Slide 28
Slide 28 text
I would call this “cloud-native configuration management”
Slide 29
Slide 29 text
Problem #2 was also solved and we delivered in time
Slide 30
Slide 30 text
The less good parts
Slide 31
Slide 31 text
1. Lock-in
Slide 32
Slide 32 text
If lock-in is a problem, HashiCorp‘s Terraform is probably the better choice
(but I wish it was more like Deployment Manager …)
Slide 33
Slide 33 text
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
Slide 34
Slide 34 text
2. Maturity
Slide 35
Slide 35 text
§ Using Deployment Manager to manage Kubernetes resource works…
but it feels like nobody does this
Slide 36
Slide 36 text
Credit: 20th Century Fox/The Martian
Slide 37
Slide 37 text
§ The best documentation often are the code examples
Slide 38
Slide 38 text
§ You can’t use it to set passwords yet
(an important feature for that is still in the works)
Slide 39
Slide 39 text
§ Too dangerous for some resources (like external IPs)
Slide 40
Slide 40 text
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?
Slide 41
Slide 41 text
Questions?
(see also my blog article for all the details on managing Kubernetes resources
with Deployment Manager: https://tinyurl.com/dm-kubernetes)