Post on 31-Dec-2015
description
Bosh CPI Introduction
邢 舟 xingzhou@cn.ibm.comIBM Open Source and Open Standard
2014.10
Agenda Bosh
Bosh CPI
Bosh External CPI External CPI Interface Bosh Warden External
CPI Bosh Micro CLI
SoftLayer External CPI
Bosh简介( 1/3)
Bosh BOSH用于在各种云基础设施平台上部署分布式软件 A CloudFoundry tool, A release tool
Development
Product Bosh: Bosh-lite Micro-Bosh Full-Bosh Stemcells CF-Releases
Bosh简介 (2/3)
创建Release
上传 Release/Stemcell 构建/部署 Release
编译 Package/运行 Jobs
Bosh简介( 3/3)
Bosh Dev https://github.com/cloudfoundr
y/bosh
https://github.com/cloudfoundry/bosh-agent
Ruby & Shell & Golang Testings:
Unit Integration BAT CPI Tests
Director
CLI
CPI
Stemcell
Bosh CPI(1/5)
CPI == Cloud Provider Interface 一组 Bosh操作 IaaS 的 API vs Bosh Agent Bosh通过 CPI的帮助完成:
软件包编译 软件包部署
Bosh-Micro Deployment Manifest:
Bosh CPI(2/5)
Warden
Bosh CPI(3/5)
Bosh CPI Projects github.com/cloudfoundry/bosh/
bosh-cpi CPI Interfaces CPI factory
Built-in CPI and Internal CPI github.com/cloudfoundry/bosh/
bosh-xxx-cpi
Bosh CPI(4/5)
Bosh CPI ( 5/5)
Bosh Built-in CPI
仅少数官方支持 CPI
采用程序内直接调用方式
与 BOSH一起部署
1个 BOSH Director对应一个 CPI实例
Bosh External CPI
Bosh REST CPI
基于 JSON的标准接口
跨程序调用
使用独立的 CPI Release
1个 BOSH Director对应一个 CPI实例
基于 JSON格式和 REST风格的标准接口
跨服务器调用
使用独立的 CPI Release
1 个 BOSH Director对应多个CPI实例
Bosh External CPI(1/6)
Deployment Manifest Config <external_cpi><enabled> CPI program exec path
程序调用方式 Open3.capture3 stdin stdout stderr JSON Format
程序接口 标准化 CPI接口 标准化错误类型
Bosh External CPI(2/6)
Bosh External CPI(3/6)
JSON传入参数
{
'method' => <string>,
'arguments' => <array>,
'context' => {
'director_uuid' => <string>
}
}
JSON返回值{
'result' => <any>,
'error' => enum(nil, {
'type' => <string>,
'message' => <string>,
'ok_to_retry' => <bool>
}
),
'log' => <string>
}
Bosh External CPI(4/6)
错误类型: Bosh::Clouds::CpiError Bosh::Clouds::NotSupported Bosh::Clouds::NotImplemented Bosh::Clouds::CloudError Bosh::Clouds::VMNotFound Bosh::Clouds::NoDiskSpace Bosh::Clouds::DiskNotAttached Bosh::Clouds::DiskNotFound Bosh::Clouds::VMCreationFailed
Bosh External CPI(5/6)
Bosh Warden CPI: External CPI样例 Golang https://github.com/cppf
orlife/bosh-warden-cpi
Bosh External CPI(6/6)
Bosh-Micro-CLI 完全支持 External CPI接口的 Bosh CLI Golang 目前正在积极开发中
Deployment Deploy
Step1: Compile CPI Release Step2: Deploy CPI Step3: Deploy micro bosh based on the CPI
https://github.com/cloudfoundry/bosh-micro-cli
SoftLayer CPI
Bosh SoftLayer CPI工作 : Ruby CPI Golang CPI
完全支持 External CPI 目前在开发项目:
Bosh-SoftLayer-CPI SoftLayer-Go
References
Bosh文档 http://docs.cloudfoundry.org/bosh/
Bosh Repo https://github.com/cloudfoundry/bosh
Bosh Micro CLI https://github.com/cloudfoundry/bosh-micro-cli
Bosh Warden External CPI https://github.com/cppforlife/bosh-warden-cpi
谢 谢xingzhou@cn.ibm.com