28

Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof
Page 2: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Rome, 2019-10-03

Kubernetes for the Ansible UsersAndrea Tosatto

Page 3: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Why this talk?!

Page 4: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

$ whoami

Page 5: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Agenda

1. Kubernetes? Why? What?2. Ansible for Kubernetes

o Implementing Kuberneteso Migrating existing services to Kuberneteso Managing the lifecycle of Kubernetes applications with Ansible

3. Questions

Page 6: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Kubernetes? Why? What?

Page 7: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Why Kubernetes?

1. Decoupling between the work of Devs and Ops

Page 8: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Why Kubernetes?

1. Decoupling between the work of Devs and Ops

2. High level abstraction on the infrastructure

Page 9: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Why Kubernetes?

1. Decoupling between the work of Devs and Ops

2. High level abstraction on the infrastructure

3. Integrated state reconciliation mechanism

Page 10: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Why Kubernetes?

Page 11: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Ansiblefor Kubernetes

Page 12: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Implementing Kubernetes

Container Engine […] Container Engine

Kubernetes

VM 01 VM 0M[…] VM N1 VM NM[…]

Host NHost 1 [...]

Network

Storage

APP “A” APP “B” APP “C” APP “D” APP “B” APP “E”

Page 13: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

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 NHost 1 [...]

Network

Storage

Page 14: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

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 NHost 1 [...]

Network

Storage

Page 15: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

APP “A”

VM 01

Host 1

Eureka! We finally have onetool to manage the whole

infrastructure

Migrating Existing Services to Kubernetes

Page 16: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

APP “A”

VM 01

Host 1

Eureka! We finally have onetool to manage the whole

infrastructure

APP “A”

VM 01

Host 1

K8SCONTAINERIZED

APP “A”

Migrating Existing Services to Kubernetes

Eureka! Let’s use Kubespray!

Page 17: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

APP “A”

VM 01

Host 1

Eureka! We finally have onetool to manage the whole

infrastructure

APP “A”

VM 01

Host 1

K8SCONTAINERIZED

APP “A”

VM 01

Host 1

K8SCONTAINERIZED

APP “A”

Migrating Existing Services to Kubernetes

Eureka! Let’s use Kubespray!

Eureka! Let’s use Ansible’s k8s

modules!

Page 18: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

APP “A”

VM 01

Host 1

Eureka! We finally have onetool to manage the whole

infrastructure

APP “A”

VM 01

Host 1

K8SCONTAINERIZED

APP “A”

VM 01

Host 1

K8SCONTAINERIZED

APP “A”

VM 01

Host 1

K8SCONTAINERIZED

APP “A”

Migrating Existing Services to Kubernetes

Eureka! Let’s use Kubespray!

Eureka! Let’s use Ansible’s k8s

modules!

Page 19: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Lifecycle management of K8s apps with Ansible

What about legacyapplications, stateful

service, database migrations, ..?

Page 20: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Lifecycle management of K8s apps with Ansible

+

What about legacyapplications, stateful

service, database migrations, ..?

Page 21: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Conclusions

Page 22: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Ansible will still play a key role in the management

of servers and infrastructure

Page 23: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

You don’t have to use Kubernetes…

Page 24: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

But eventually you might end up doing it!

Page 25: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof
Page 26: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

Thanks!

Andrea Tosatto@_hilbert_

OpenInfra Days2019

Page 27: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

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

Page 28: Kubernetes for the Ansible users - OpenInfraDays 2019 · Why? What? 2. Ansiblefor Kubernetes oImplementingKubernetes oMigratingexistingservicesto Kubernetes oManagingthe lifecycleof

[email protected]

800.585.383 fisso

+39 02.87200983 mobile e internazionale

irideos.it