How to use TripleO tools for your own project
-
Upload
goneri-le-bouder -
Category
Engineering
-
view
179 -
download
0
description
Transcript of How to use TripleO tools for your own project
![Page 1: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/1.jpg)
how to use TripleO tools for your own
project
Gonéri Le BouderSoftware EngineerNovember 3, 2014
![Page 2: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/2.jpg)
Myself
● Work @ eNovance, Paris office● Long term Free Software contributor● OpenStack contributor since 2013● blablabla
![Page 3: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/3.jpg)
OpenStack and TripleO
![Page 4: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/4.jpg)
TripleO
OpenStack On OpenStack
Goal:
Deploy a fully functional OpenStack from a minimal OpenStack
![Page 5: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/5.jpg)
TripleO tool collection
TripleO uses or reuse various OpenStack tools:● Heat● Ironic and Nova Bare-metal● DiskImage Builder (aka DIB) and some
image elements● os-{apply,collect,refresh}-config● probably some more
![Page 6: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/6.jpg)
Heat
An API on rule them all
Describe an infrastructure and inject it in your OpenStack tenant (VM, disk, autoscaling, etc)
![Page 7: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/7.jpg)
DiskImage Builder
The gold image generator
A tool to generate image:● Very modular● Easy to extend using “elements”
![Page 8: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/8.jpg)
DiskImage Builder
An DIB element is a set of files:● Adjust the image content● Install packages in the image● Configuration file templates● Configuration scripts.
Element can depend on another element (e.g: fedora depends on yum)
![Page 9: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/9.jpg)
DiskImage Builder
● fedora: the root element● vm: will ensure we generate a VM image● myapplication: will install the application itself
and the configuration template
![Page 10: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/10.jpg)
os-{apply,collect,refresh}-config
Super light configuration management tool
1)Retrieve values from the meta servers
2)Pass them through configuration template
3)Apply the configuration
![Page 11: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/11.jpg)
os-{apply,collect,refresh}-config
Source: https://wiki.openstack.org/wiki/OsCollectConfig
![Page 12: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/12.jpg)
Configuration management:A New Paradigm
![Page 13: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/13.jpg)
common Paradigm
● Boot your machine with a very standard Operating System– Cloud image
– Distro installed with a Kickstart or a preseed
● Run a configuration management tools– pull packages and resources from the network
– apply configuration
– Keep the OS up to date
![Page 14: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/14.jpg)
Tripleo (and eDeploy) Paradigm
● Prepare some specialized images● Use them to boot the machines (VM or bare-
metal)● Apply the configuration, without external
network access
![Page 15: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/15.jpg)
The big changes
● The CM tool should not install package by itself● The CM tool should only adjust the
configuration
![Page 16: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/16.jpg)
Example
![Page 17: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/17.jpg)
example
Configuration of Wordpress and MariaDB on two dedicated nodeshttps://github.com/enovance/wordpress-the-tripleo-way
![Page 18: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/18.jpg)
the image
./elements/wordpress/install.d/10-wordpress#!/bin/bash
set -eux
set -o xtrace
set -o pipefail
install-packages wordpress
![Page 19: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/19.jpg)
the image
./elements/wordpress/os-apply-config/etc/wordpress/wp-config.php (fragment)<?php
define('DB_NAME', '{{wordpress.db_name}}');
define('DB_USER', '{{wordpress.db_user}}');
define('DB_PASSWORD', '{{wordpress.db_password}}');
define('DB_HOST', '{{wordpress.db_host}}');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
etc
![Page 20: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/20.jpg)
the image
./elements/wordpress/os-refresh-config/configure.d/20-httpd#!/bin/bash
set -eux
os-svc-enable -n httpd
if service httpd status; then
service httpd reload
else
service httpd restart
fi
![Page 21: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/21.jpg)
heat
Heat file (fragment) WordpressConfig:
type: OS::Heat::StructuredConfig
properties:
group: os-apply-config
config:
wordpress:
db_name: wordpress
db_password: {get_resource:Wordpress_db_password}
db_host: {get_attr: [Mariadb, first_address]}
Etc ...
![Page 22: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/22.jpg)
Benefits
![Page 23: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/23.jpg)
Pros
Way easier to redeploy the application● grab the images● call heat, it will
– Deploy the infrastructure
– Export the meta-data for os-collect-config
![Page 24: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/24.jpg)
Pros
Reduce the risk of failure● Images + the meta data from heat should be
enough to get the application running
![Page 25: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/25.jpg)
Pros
Super fast● Start the machines from the images● Pass the meta data through the templates● Write the configuration
![Page 26: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/26.jpg)
Pros
Consum less resources● I/O: no package installation● CPU: configuration only do the bare minimum
![Page 27: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/27.jpg)
Not the perfect solution
![Page 28: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/28.jpg)
The elements
● No repository with shared DIB “elements” yet● OpenStack Heat and os-*-config evolve quickly,
the use of an up to date OpenStack release is a must (for the moment)
![Page 29: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/29.jpg)
Data
You need a strategy for your data storage● TripleO use NFS here● eNovance eDeploy use another upgrade
mechanism
![Page 30: How to use TripleO tools for your own project](https://reader034.fdocuments.net/reader034/viewer/2022050817/5586fb29d8b42ac6278b46d4/html5/thumbnails/30.jpg)