Kubernetes
for the Ansible users
Andrea Tosatto
@_hilbert_
OpenInfra Days
2019
Slide 2
Slide 2 text
Why this talk?!
Slide 3
Slide 3 text
$ whoami
Slide 4
Slide 4 text
Agenda
1. Kubernetes? Why? What?
2. Ansible for Kubernetes
o Implementing Kubernetes
o Migrating existing services to Kubernetes
o Managing the lifecycle of Kubernetes applications with Ansible
3. Questions
Slide 5
Slide 5 text
Kubernetes?
Why? What?
Slide 6
Slide 6 text
Why Kubernetes?
1. Decoupling between the work of Devs and Ops
Slide 7
Slide 7 text
Why Kubernetes?
1. Decoupling between the work of Devs and Ops
2. High level abstraction on the infrastructure
Slide 8
Slide 8 text
Why Kubernetes?
1. Decoupling between the work of Devs and Ops
2. High level abstraction on the infrastructure
3. Integrated state reconciliation mechanism
Slide 9
Slide 9 text
Why Kubernetes?
Slide 10
Slide 10 text
Ansible
for Kubernetes
Slide 11
Slide 11 text
Implementing Kubernetes
Container Engine […] Container Engine
Kubernetes
VM 01 VM 0M
[…] VM N1 VM NM
[…]
Host N
Host 1 [...]
Network
Storage
APP “A” APP “B” APP “C” APP “D” APP “B” APP “E”
Slide 12
Slide 12 text
Implementing Kubernetes
Container Engine […] Container Engine
APP “A” APP “B” APP “C” APP “D” APP “B” APP “E”
Kubernetes
VM 01 VM 0M
[…] VM N1 VM NM
[…]
Host N
Host 1 [...]
Network
Storage
Slide 13
Slide 13 text
Implementing Kubernetes
Container Engine […] Container Engine
APP “A” APP “B” APP “C” APP “D” APP “B” APP “E”
Kubernetes
VM 01 VM 0M
[…] VM N1 VM NM
[…]
Host N
Host 1 [...]
Network
Storage
Slide 14
Slide 14 text
APP “A”
VM 01
Host 1
Eureka! We finally have one
tool to manage the whole
infrastructure
Migrating Existing Services to Kubernetes
Slide 15
Slide 15 text
APP “A”
VM 01
Host 1
Eureka! We finally have one
tool to manage the whole
infrastructure
APP “A”
VM 01
Host 1
K8S
CONTAINERIZED
APP “A”
Migrating Existing Services to Kubernetes
Eureka! Let’s use
Kubespray!
Slide 16
Slide 16 text
APP “A”
VM 01
Host 1
Eureka! We finally have one
tool to manage the whole
infrastructure
APP “A”
VM 01
Host 1
K8S
CONTAINERIZED
APP “A”
VM 01
Host 1
K8S
CONTAINERIZED
APP “A”
Migrating Existing Services to Kubernetes
Eureka! Let’s use
Kubespray!
Eureka! Let’s use
Ansible’s k8s
modules!
Slide 17
Slide 17 text
APP “A”
VM 01
Host 1
Eureka! We finally have one
tool to manage the whole
infrastructure
APP “A”
VM 01
Host 1
K8S
CONTAINERIZED
APP “A”
VM 01
Host 1
K8S
CONTAINERIZED
APP “A”
VM 01
Host 1
K8S
CONTAINERIZED
APP “A”
Migrating Existing Services to Kubernetes
Eureka! Let’s use
Kubespray!
Eureka! Let’s use
Ansible’s k8s
modules!
Slide 18
Slide 18 text
Lifecycle management of K8s apps with Ansible
What about legacy
applications, stateful
service, database
migrations, ..?
Slide 19
Slide 19 text
Lifecycle management of K8s apps with Ansible
+
What about legacy
applications, stateful
service, database
migrations, ..?
Slide 20
Slide 20 text
Conclusions
Slide 21
Slide 21 text
Ansible will still play a key
role in the management
of servers and
infrastructure
Slide 22
Slide 22 text
You don’t have to use
Kubernetes…
Slide 23
Slide 23 text
But eventually you
might end up doing it!
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
Thanks!
Andrea Tosatto
@_hilbert_
OpenInfra Days
2019
Slide 26
Slide 26 text
References
• Kubespray: deploy a Production Ready Kubernetes Cluster with Ansible
https://github.com/kubernetes-sigs/kubespray
• Ansible Kubernetes Module
https://docs.ansible.com/ansible/latest/modules/kubernetes_module.html
• Ansible Operator
https://www.ansible.com/blog/ansible-operator