how to deploy docker containers inside ikoula’s cloud with ... · how to deploy docker containers...

22
How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN

Upload: others

Post on 24-Sep-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

How to deploy docker containers insideikoula’s cloud with Ansible

AUTHOR : NICOLAS TRAUWAEN

Page 2: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Who is ikoula ?

Creation:1998

8000OSinproduction

Employees:47

5000physicalservers

2datacentersownedinFrance&presenton3continents

Page 3: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Some history

Page 4: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Ikoula’s cloudpowered by cloudstack

Page 5: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

6 datacenters, 3 continents

EuropeFR- ReimsFR- Laon

DE- FrancfortNL- Amsterdam

UnitedStatesUS- Floride

AsiaSG- Singapour

Page 6: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Ikoula’s cloud

SSD hard drives

Flexibility & Elasticity

API Web UI

CloudPublic / Private / Hybrid

Multi-zones

Page 7: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Ikoula’s cloud

WEB DEVOPS BIG DATA BDD CACHE SEARCH

Deploy your apps

Work with any technologies

Page 8: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Cloudstack APi

Infrastrucutre deployment Application deployment

Control your dataScale on your needs

Page 9: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

AnsibleSimple IT automation

Page 10: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

localhost

[ikcloud]

#ceevm[01:02]

ceevm01 ansible_host=178.170.68.70

ceevm02 ansible_host=178.170.68.69

[ikcloud:vars]

cs_template=Debian 8 - Minimal - 64bits

cs_offering=t1.pico

cs_zone=EU-FR-IKDC1-Z3-BASIC

cs_securitygroups=default

Ansible inventory

Describeyour

infrastructure

Page 11: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Ansible cloudstack module

§ Require Exoscale python cs library

§ Available as Ansible extra modules

§ Your credentials into cloudstack.ini file

[cloudstack]endpoint = https://cloudstack.ikoula.com/client/apikey =secret =

Page 12: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Ansible playbooks

Page 13: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

DockerBuild, ship, run

Page 14: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

---- name: mariadb containerdocker:name: mariadbimage: mariadb:5state: startedvolumes:- /home/wp/db:/var/lib/mysql

env:MYSQL_ROOT_PASSWORD: djMucnRen5G5

Deploy containers inside your playbook

UsingAnsible’s

dockermodule

Page 15: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Deploy containers with docker-compose

---- name: copy compose filetemplate: src={{ item.src }} dest={{ item.dest }}with_items:- { src: 'wordpress.yml.j2', dest: '/root/wordpress.yml' }

- name: launch containerscommand: docker-compose -f {{ item }} upwith_items:- /root/wordpress.yml

Thesameway,you’lldofromyourconsole

Page 16: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Docker-compose

wordpress:image: wordpresslinks:- db:mysql

ports:- 80:80

db:image: mariadbenvironment:MYSQL_ROOT_PASSWORD: root

Page 17: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

RUN

# ansible-playbook wordpress.yml

PLAY ***************************************************************************

TASK [setup] *******************************************************************ok: [wp-vm1]

TASK [abaez.docker : Install docker and dependencies] **************************included: /etc/ansible/roles/abaez.docker/tasks/os_family/Debian.yml for wp-vm1

(…)

TASK [docker-wordpress : mariadb container] ************************************changed: [wp-vm1]

TASK [docker-wordpress : wordpress container] **********************************changed: [wp-vm1]

PLAY RECAP *********************************************************************wp-vm1 : ok=14 changed=10 unreachable=0 failed=0

Page 18: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

What next ?

Page 19: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

§ Dynamic inventory

a python script can give a dynamic inventory directly connected to the

cloudstack platform

§ Connect instances to your favorite docker cluster manager

§ Writing more playbooks

Improvements

Page 20: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

§ http://docs.ansible.com/ansible/index.html

§ https://docs.docker.com/engine/

§ https://github.com/trotro/ansible-scripts

§ https://github.com/ikoula

§ https://express.ikoula.com/en/public-cloud

§ https://www.ikoula-blog.com

§ https://en.ikoula.wiki/

Ressources

Page 21: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

Join us !

R & DReims (51), France

Developer, DevOps or Sys admin, creative & passionate by innovation, join our R&D!

SalesBoulogne-Billancourt (92), France

Motivated by advising & imagining solutions suited to our customer’s

needs? Join our sales & pre-sales teams

Technical SupportReims (51), France

You’re a sys admin & like to help, technical support is made for you!

Other skills?

Don’t find your way but still want to join us? Send your application!

[email protected]://www.ikoula.com/en/emploi

Page 22: How to deploy docker containers inside ikoula’s cloud with ... · How to deploy docker containers inside ikoula’s cloud with Ansible AUTHOR : NICOLAS TRAUWAEN. Who is ikoula ?

@ikoula ou @ikoula_EN

Ikoula Hosting Services

Ikoula

Ikoula

Gardez le contact !

AUTHOR : NICOLAS TRAUWAEN