Deploying Multi-Container Applications with Ansible Broker
Total Page:16
File Type:pdf, Size:1020Kb
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 Service Broker API and High-level Architecture Walkthrough of Provision/Bind of selected services Ansible Broker More Information Ansible Playbook Bundle (APB) Definition Additional information to get you started What’s New and Future Plans Questions Roadmap Review What can we answer for you? 2 Service Catalog & Ansible Broker 3 Why Service Brokers? ☑ Open ticket ☑ Wait for allocation ☑ Receive credentials ☑ Add to app ☑ Deploy app SERVICE SERVICE CONSUMER PROVIDER Manual, Time-consuming, Error-prone, and Inconsistent 4 What is a Service Broker? SERVICE SERVICE SERVICE SERVICE CONSUMER CATALOG BROKER PROVIDER 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 Service Broker Concepts 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 SERVICE SERVICE SERVICE SERVICE CONSUMER CATALOG BROKER PROVIDER PROVISION: creating a service instance BIND: associate a service instance and its credentials to an app 6 Service Catalog Where Services Are Published ● Better experience for service consumers ● Streamlines “getting started” process ○ Task focused ○ Key call outs ○ Unified search ○ Guided workflow ● Provision and manage services from a central interface ● Search option ensures quick access to all services 7 Service Brokers Expose and Provision Services OpenShift OPENSHIFT OpenShift Template Templates Broker ANSIBLE Ansible Ansible Playbook Broker Bundles BETA AWS AMAZON WEB SERVICES Public Service Cloud Broker Services Other OTHER COMPATIBLE SERVICES Other Service Services Brokers SERVICE CATALOG SERVICE BROKERS 8 Open Service Broker API Defines an HTTP interface between the services marketplace of a platform and service brokers Background • Working group formed in September 2016; successor to Cloud Foundry Service Broker API • Multi-vendor project to standardize how services are consumed on cloud native platforms across service providers • Service Broker is the component that implements the API, for which a platform's marketplace is a client Methods • Service brokers are responsible for advertising catalog of service offerings and service plans to the marketplace, and acting on requests from the marketplace for: • Catalog - Return service offerings • Provision - Create service • Deprovision - Delete service • Bind - Obtain credentials/coordinates for service • Unbind - Revoke credentials for service • Update - Change service instance parameters or service plan 9 Ansible Broker - Inspiration and Goals What are we trying to accomplish? Project Inspiration ● Solution for defining and delivering “simple” to “complex” multi-container applications ● Easy orchestration of services using a simple, lightweight application definition ● Leverage a container image as transport mechanism for delivering application ○ Both application definition and container image can be hosted in the same location Project Goals ● Ensure technology is simple yet extensible enough to support deploying any application type and combination of applications ○ Must work with both new and pre-existing, canned application container images ● Build extensive application ecosystem deployable through the Kubernetes Service Catalog ● Grow interest, participation, and adoption in the community as one of the prevailing methods for provisioning applications on Kubernetes 10 Ansible Broker Orchestrating Containerized Services ● Define, extend, and deliver “simple” to “complex” multi-container services ● Standardized approach for using Ansible to manage and provision applications ● Leverage existing investment in Ansible roles/playbooks Ansible Broker Ansible Playbook Bundle ● Implementation of Open Service Broker API ● Lightweight application definition ● Exposes services to Service Catalog (meta-container) ● Provisions services using Ansible ● Simple directory employing: ● Use cases: ○ Named playbooks [provision.yaml, bind.yaml, …] to perform Open Service Broker actions ○ Traditional S2I deployments ○ Metadata containing a list of required / ○ Provisioning of pre-existing images optional parameters during deployment ○ Orchestration of external services ○ Embedded Ansible runtime ○ Deploying multi-service solutions 11 Ansible Broker High Level Architecture Service Catalog APB services: Supports provisioning Container Image and binding of both on Registry • MediaWiki and off-platform • PostgreSQL (public cloud) Ansible • MariaDB services! Service Playbook Bundle • MySQL, etc. Consumer Ansible Ansible Broker Provisioned • catalog Playbook Bundle Service • provision • deprovision • bind Service Broker • unbind Service Broker • update Other Service Brokers 12 Ansible Playbook Bundle (APB) Definition Architecture Ansible Playbook Bundle (APB) Description: Definition ● Short-lived, lightweight container image consisting of a simple directory structure with: Minimal Directory of files ○ Named “action” playbooks & deployment role Linux Image provision.yaml ○ Metadata: deprovision.yaml ■ required/optional parameters Ansible bind.yaml ■ service plans Deployment Runtime unbind.yaml ■ Image dependencies (provision vs bind) Role update.yaml ■ specification version ○ Ansible runtime environment test.yaml apb.yaml ● Designed to orchestrate pre-existing containerized application images ● Developer tooling provides simple, guided approach provision.yaml = Install deprovision.yaml = Uninstall to APB creation bind.yaml = Grant ● unbind.yaml = Revoke Easily modified or extended update.yaml = Upgrade test.yaml = Test abp.yaml = Metadata 13 Ansible Broker Advantages Why is it better than other provisioning technologies? ● Capable of orchestrating both on- and off-platform services ○ Not limited to deploying just local services like most provisioning technologies ○ Provision and manage remote services and even those hosted in public clouds ● Highly customizable binding operations between services ● APB packaging makes it easy to distribute since definition can be hosted in same registry as application ● Application provisioning can be tied to the successful startup of dependent services ○ 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 ● Support for complex conditional logic enabling better control of deployed services Anything you can do with Ansible, you can do in an APB! 14 OpenStack Integration Why use Ansible Broker? ● Better control and greater flexibility when deploying services than with other orchestration technologies ○ 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 ● Engaged with upstream to build OpenStack PoC orchestrated by Ansible ○ Once playbooks have been created for deploying OpenStack services these can easily be turned into APBs for provisioning with Ansible Broker ● Looking for broader community collaboration to help with the development of OpenStack Service APB’s ○ End goal is to support the deployment of an entire OpenStack environment using APB’s (with all deployed services managed by Kubernetes) 15 Roadmap Review 16 Development Plan & Application Ecosystem OpenShift Origin and Kubernetes ● Primary development is currently being done within OpenShift Origin community ○ ‘CatASB’ project enables anyone to easily stand-up an Origin environment with both Kubernetes Service Catalog and Broker enabled at startup ● Support for pure Kubernetes environments nearly completed ○ Extends broker technology to be used outside of typical PaaS environments ■ Leverage technology to also deploy infrastructure environments ● Looking to grow adoption and build-out application ecosystem ○ 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 ReleaseWhat’s new for Service Plans Catalog and Ansible Broker OpenShift Origin 3.6.0 OpenShift Origin 3.7.0 • New Web UI with Kubernetes Service Catalog • Service Broker and Service Catalog hardening • Allows a service consumer to select and manage services • Supports use with ‘production’ workloads via standard operations • Secure connectivity between Service Catalog and Broker • Service Catalog interacts with Brokers through a • Support for multiple service plans standard API • Example: Bronze, Silver, and Gold plans • Open Service Broker API • New APB services • Support for multiple Brokers within Service Catalog instance • Popular services (such as databases) • Includes Template and Ansible Brokers • Commercial third-party ISV applications • Several APB services examples available • Multiple concurrent source adapters • Targeted at deploying example applications to learn • Broker instance can connect to multiple image registries