Deploying Multi-Container Applications with Ansible Broker
11.7.2017
Eric Dubé, Senior Principal Product Manager, Red Hat Todd Sanders, Director Software Engineering, Red Hat
Deploying Multi-Container Applications with Ansible Broker Eric - - PowerPoint PPT Presentation
11.7.2017 Deploying Multi-Container Applications with Ansible Broker Eric Dub, Senior Principal Product Manager, Red Hat Todd Sanders, Director Software Engineering, Red Hat Agenda Service Catalog and Brokers Live Demonstration Open
11.7.2017
Eric Dubé, Senior Principal Product Manager, Red Hat Todd Sanders, Director Software Engineering, Red Hat
Open Service Broker API and High-level Architecture
Ansible Playbook Bundle (APB) Definition
Roadmap Review
Walkthrough of Provision/Bind of selected services
Additional information to get you started
What can we answer for you?
2
3
SERVICE CONSUMER SERVICE PROVIDER
☑ Open ticket ☑ Wait for allocation ☑ Receive credentials ☑ Add to app ☑ Deploy app
Manual, Time-consuming, Error-prone, and Inconsistent
4
SERVICE CONSUMER SERVICE PROVIDER SERVICE CATALOG SERVICE BROKER Brokers inform Service Catalog of the Service Classes it can provision Service Consumer only interacts with Service Catalog, the details of the Brokers are largely hidden Creates a process that is automated, standardized, and most importantly consistent
5
CONSUMER: user of service deployed by the catalog/broker SERVICE: an offering that can be used by an app e.g. database PLAN: a specific flavor of a service e.g. Gold Tier SERVICE INSTANCE: an instance of the offering PROVISION: creating a service instance BIND: associate a service instance and its credentials to an app
SERVICE CONSUMER SERVICE PROVIDER SERVICE CATALOG SERVICE BROKER
6
Where Services Are Published
consumers
process ○ Task focused ○ Key call outs ○ Unified search ○ Guided workflow
from a central interface
to all services
7
Expose and Provision Services
8
SERVICE CATALOG
Ansible Broker OpenShift Template Broker AWS Service Broker Other Service Brokers
ANSIBLE OPENSHIFT AMAZON WEB SERVICES
OTHER COMPATIBLE SERVICES
Ansible Playbook Bundles OpenShift Templates Public Cloud Services Other Services
SERVICE BROKERS
B E T A
Defines an HTTP interface between the services marketplace of a platform and service brokers
9
Background
service providers
client
Methods
marketplace, and acting on requests from the marketplace for:
What are we trying to accomplish?
10
Project Inspiration
○ Both application definition and container image can be hosted in the same location
Project Goals
and combination of applications ○
Must work with both new and pre-existing, canned application container images
for provisioning applications on Kubernetes
Orchestrating Containerized Services
Ansible Broker Ansible Playbook Bundle
(meta-container)
○ Named playbooks [provision.yaml, bind.yaml, …] to perform Open Service Broker actions ○ Metadata containing a list of required /
○ Embedded Ansible runtime
○ Traditional S2I deployments ○ Provisioning of pre-existing images ○ Orchestration of external services ○ Deploying multi-service solutions
11
High Level Architecture
Provisioned Service
Ansible Playbook Bundle
Service Consumer
Ansible Broker
Container Image Registry
Service Broker Service Broker
Other Service Brokers Ansible Playbook Bundle
Service Catalog APB services:
Supports provisioning and binding of both on and off-platform (public cloud) services!
12
Definition Architecture
Description:
○ Named “action” playbooks & deployment role ○ Metadata:
■ required/optional parameters ■ service plans ■ Image dependencies (provision vs bind) ■ specification version
○ Ansible runtime environment
application images
to APB creation
Ansible Runtime Directory of files
Ansible Playbook Bundle (APB) Definition
provision.yaml deprovision.yaml bind.yaml unbind.yaml update.yaml
Deployment Role provision.yaml = Install deprovision.yaml = Uninstall bind.yaml = Grant unbind.yaml = Revoke update.yaml = Upgrade test.yaml = Test abp.yaml = Metadata Minimal Linux Image
apb.yaml test.yaml
13
Why is it better than other provisioning technologies?
○ Not limited to deploying just local services like most provisioning technologies ○ Provision and manage remote services and even those hosted in public clouds
registry as application
○ Ensure all dependent services are fully operational before starting your application
■ Example: Check that a database has fully initialized and ready to accept connections prior to provisioning your application
Anything you can do with Ansible, you can do in an APB!
14
15
Why use Ansible Broker?
○ Able to solve many of the problems plaguing existing solutions today: ■ Dependent service startup synchronization ■ Robust service control using conditional logic ■ Ability to provision and manage services both locally and remote
○ Once playbooks have been created for deploying OpenStack services these can easily be turned into APBs for provisioning with Ansible Broker
○ End goal is to support the deployment of an entire OpenStack environment using APB’s (with all deployed services managed by Kubernetes)
16
OpenShift Origin and Kubernetes
○ ‘CatASB’ project enables anyone to easily stand-up an Origin environment with both Kubernetes Service Catalog and Broker enabled at startup
○ Extends broker technology to be used outside of typical PaaS environments
■ Leverage technology to also deploy infrastructure environments
○ Not only in the community but also with commercial ISVs ○ Ever growing list of examples and documentation enables developers to quickly create new APB’s ○ In the process of building community presence / website to streamline navigation of content
17
OpenShift Origin 3.6.0
via standard operations
standard API
instance
about this new technology
OpenShift Origin 3.7.0
APB creation
What’s new for Service Catalog and Ansible Broker
18
(allows changes to parameters and service plans)
during provision operation
What’s Planned?
19
20
21
Walkthrough
Steps: Initial Provisioning + Binding
1. Create new Project 2. Provision Backend of Web Application (PostgreSQL + Python API + Data Seeding) - DogAPI 3. Provision Frontend of Web Application (Django) - Random Image Viewer 4. Bind Frontend to Backend
Steps: External Saas Provider
1. Provision External SaaS API - CatAPI 2. Bind Frontend of Web Application to External SaaS API
Steps: Update Service Instance
1. Update Web Application - Album Title Parameter
Origin/Kubernetes Cluster
22
PODs
Dog API
Random Image Viewer (Django)
PostgreSQL
Internal Backend
Random Image Viewer APB Dog API APB
Origin/Kubernetes Cluster
23
Dog API
Random Image Viewer (Django)
PostgreSQL
External SaaS Backend
Random Image Viewer APB Dog API APB
External Cloud Service
Cat API PostgreSQL Cat API APB New Binding
24
Building an APB ecosystem
25
can be contributed ○
Hosted within a single Github organization: ‘ansibleplaybookbundle’
○
Individual APBs reside in their own repos
publicly accessible container registry Continually growing portfolio of applications:
Hastebin, Etherpad, MariaDB, MySQL, AWS RDS MySQL, Rocket.Chat, Nginx, ManageIQ, …
https://github.com/ansibleplaybookbundle
26
Simple mechanism for quickly spinning up an environment to try out Ansible Broker:
○
Only takes ~5 minutes to install
○
Location: https://github.com/fusor/catasb/tree/master/local/linux#testing-downstream-images
Note: There are some environment differences with how Ansible Broker is installed via ‘catasb’ that is not an exact match to a downstream environment deployed with ‘atomic-openshift-installer’ How do I install it?
27
Project Information
edube@redhat.com
tsanders@redhat.com
jmatthews@redhat.com
29
30
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
31
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog DogAPI APB
ansible-playbook provision.yaml $vars
32
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
PostgreSQL
DogAPI APB
ansible-playbook provision.yaml $vars
API
33
Ansible Broker
Container Registry Service Consumer Service Catalog
PostgreSQL API
DogAPI APB RandomViewer APB
34
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
PostgreSQL
RandomViewer APB
API
ansible-playbook provision.yaml $vars
35
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
PostgreSQL
RandomViewer APB
API
ansible-playbook provision.yaml $vars
Random Viewer
36
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
PostgreSQL API Random Viewer
37
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
PostgreSQL API Random Viewer
DogAPI APB
ansible-playbook bind.yaml $vars
Binding
38
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
PostgreSQL API Random Viewer Binding Secret
39
Ansible Broker
Container Registry
DogAPI APB RandomViewer APB
Service Consumer Service Catalog
PostgreSQL API Random Viewer Binding Secret
40
Ansible Broker
Service Catalog
Random Viewer Credentials
DogAPI APB
Service Catalog makes a Secret available for Pod APB returns credentials of service to broker
Service Consumer
PostgreSQL API