Skip to content
BOSH release for the BOSH Alibaba Cloud CPI.
Go Shell HCL HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ci
config Update go version to 1.11.5 Mar 13, 2019
docs New instance field region to support crossing region deployment Jul 29, 2018
jobs/alicloud_cpi Support self-define service endpoint and upgrade sdk alibaba-cloud-sd… Dec 24, 2018
packages Fix CI failed bug and improve the pipeline Jul 24, 2019
releases/bosh-alicloud-cpi
src deprecate self-defined wraperror and use bosherr's instead Oct 7, 2019
test_input
.envrc bosh-release version 3 Sep 25, 2017
.gitignore change to official master and final release version Jul 25, 2019
CHANGELOG.md Bump Alibaba Cloud cpi/29.0.0 Oct 8, 2019
LICENSE Merge branch 'ginkgo' of github.com:alibaba/bosh_alicloud_cpi into gi… Oct 17, 2017
Makefile Change go sdk to alibaba cloud official go sdk May 10, 2018
NOTICE
README.md
setup-ginkgo Use `dep` for dependencies and update `bosh-utils` Apr 30, 2018

README.md

BOSH Alibaba Cloud CPI

This is a BOSH release for the BOSH Alibaba Cloud CPI.

Cloud Foundry Install Guide

How to make release

$ git clone https://github.com/aliyun/bosh-alicloud-cpi-release.git
$ cd bosh-alicloud-cpi-release
$ mkdir blobs
$ bosh add-blob ~/Downloads/go1.8.1.linux-amd64.tar.gz go1.8.1.linux-amd64.tar.gz
$ source .envrc
$ make
$ bosh create-release --force --tarball=../bosh-alicloud-cpi.tgz

Latest Version (v18)

At present, alibaba cloud the lastet cpi release is stored in the OSS. You can reference this release in your deployment manifest from the releases section:

- name: bosh-alicloud-cpi
  version: 18
  url: http://bosh-((region)).oss-((region)).aliyuncs.com/bosh-alicloud-cpi-release-r18.tgz
  sha1: 2e36b60f99e51fe2dd4e7ea021bf3ecce883487c

Or upload it to your director with the upload-release command:

bosh upload-release --sha1 2e36b60f99e51fe2dd4e7ea021bf3ecce883487c \
  http://bosh-((region)).oss-((region)).aliyuncs.com/bosh-alicloud-cpi-release-r18.tgz

-> Note: If region is in China mainland, its download url is unified as: http://bosh.oss-cn-hangzhou.aliyuncs.com/bosh-alicloud-cpi-release-r18.tgz.

Usage

Prepare your Alibaba Cloud environment

  • Create a vpc with switch and get vswtich_id
  • Create security group get security_group_id
  • Create user access key, get access_key_id/access_key_secret
  • Create a key pair, get key_pair_name and download it private key, like bosh.pem
  • Create a jumpbox vm

Install bosh in Alibaba Cloud

$ git clone https://github.com/aliyun/bosh-deployment.git
$ cd bosh-deployment

use this command, modify the parameters

  • vswitch_id
  • security_group_id
  • access_key_id
  • access_key_secret
  • region
  • zone
  • key_pair_name
  • private_key
bosh create-env bosh-deployment/bosh.yml --state=state.json \
 --vars-store=creds.yml \
 -o bosh-deployment/alicloud/cpi.yml \
 -v director_name=my-bosh \
 -v internal_cidr=192.168.0.0/24 \
 -v internal_gw=192.168.0.1 \
 -v internal_ip=192.168.0.2 \
 -v vswitch_id=... \
 -v security_group_id=... \
 -v access_key_id=... \
 -v access_key_secret=... \
 -v region=cn-beijing \
 -v zone=cn-beijing-a \
 -v key_pair_name=... \
 -v private_key=bosh.pem

Install with jumpbox-user

$ bosh create-env bosh-deployment/bosh.yml \
 --state=state.json \
 --vars-store=creds.yml \
 -o bosh-deployment/alicloud/cpi.yml \
 -o bosh-deployment/jumpbox-user.yml \
 -v director_name=my-bosh \
 -v internal_cidr=192.168.0.0/24 \
 -v internal_gw=192.168.0.1 \
 -v internal_ip=192.168.0.7 \
 -v vswitch_id=... \
 -v security_group_id=... \
 -v access_key_id=... \
 -v access_key_secret=... \
 -v region=cn-beijing \
 -v zone=cn-beijing-e
 -v key_pair_name=... \
 -v private_key=bosh.pem
$ bosh int creds.yml --path /jumpbox_ssh/private_key > jumpbox.key
$ chmod 600 jumpbox.key
$ ssh jumpbox@<external-or-internal-ip> -i jumpbox.key

Install with external-ip

  • Create a Elastic IP in Alibaba Cloud Console, get an external_ip
bosh create-env bosh-deployment/bosh.yml \
 --state=state.json \
 --vars-store=creds.yml \
 -o bosh-deployment/alicloud/cpi.yml \
 -o bosh-deployment/external-ip-not-recommended.yml \
 -o bosh-deployment/jumpbox-user.yml \
 -o bosh-deployment/misc/powerdns.yml \
 -v director_name=my-bosh  \
 -v internal_cidr=192.168.0.0/24 \
 -v internal_gw=192.168.0.1 \
 -v internal_ip=192.168.0.7 \
 -v vswitch_id=... \
 -v security_group_id=... \
 -v access_key_id=... \
 -v access_key_secret=... \
 -v region=cn-beijing \
 -v zone=cn-beijing-e \
 -v key_pair_name=... \
 -v private_key=bosh.pem \
 -v external_ip=... \
 -v dns_recursor_ip=8.8.8.8

Run Unit Test

Run following commands

$ source .envrc
$ make testdeps
$ ginkgo -r -skipPackage integration src/bosh-alicloud-cpi

Run Integration Test

Prepare your Alibaba Cloud environment, and export follow variables

  • Create a SLB (Load balance) get slb_id
export CPI_REGION=cn-beijing
export CPI_ZONE=cn-beijing-e
export CPI_ACCESS_KEY_ID=...
export CPI_ACCESS_KEY_SECRET=...
export CPI_SECURITY_GROUP_ID=...
export CPI_VSWITCH_ID=...
export CPI_STEMCELL_ID=...
export CPI_INTERNAL_CIDR=192.168.0.0/24/
export CPI_INTERNAL_NETMASK=255.255.255.0
export CPI_INTERNAL_IP=192.168.0.2
export CPI_INTERNAL_GW=192.168.0.1
export CPI_EXTERNAL_IP=47.47.47.47
export CPI_SLB_ID=...

Go to source code path, run follow commands

$ make testdeps
$ ginkgo -r src/bosh-alicloud-cpi/integration
You can’t perform that action at this time.