Skip to content

Commit

Permalink
Merge pull request #175 from aliyun/master
Browse files Browse the repository at this point in the history
[NEW PROVIDER] Support to deploy bosh on Alibaba Cloud
  • Loading branch information
jfmyers9 authored Aug 26, 2019
2 parents 4ea0173 + 18899c3 commit 95fc1a8
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* [Create an environment](https://bosh.io/docs/init.html)
* [On Local machine (BOSH Lite)](https://bosh.io/docs/bosh-lite.html)
* [On Alibaba Cloud](https://bosh.io/docs/init-alicloud.html)
* [On AWS](https://bosh.io/docs/init-aws.html)
* [On Azure](https://bosh.io/docs/init-azure.html)
* [On OpenStack](https://bosh.io/docs/init-openstack.html)
Expand Down Expand Up @@ -29,8 +30,8 @@
## Ops files

- `bosh.yml`: Base manifest that is meant to be used with different CPI configurations
- `[aws|azure|docker|gcp|openstack|softlayer|vcloud|vsphere|virtualbox]/cpi.yml`: CPI configuration
- `[aws|azure|docker|gcp|openstack|softlayer|vcloud|vsphere|virtualbox]/cloud-config.yml`: Simple cloud configs
- `[alicloud|aws|azure|docker|gcp|openstack|softlayer|vcloud|vsphere|virtualbox]/cpi.yml`: CPI configuration
- `[alicloud|aws|azure|docker|gcp|openstack|softlayer|vcloud|vsphere|virtualbox]/cloud-config.yml`: Simple cloud configs
- `jumpbox-user.yml`: Adds user `jumpbox` for SSH-ing into the Director (see [Jumpbox User](docs/jumpbox-user.md))
- `uaa.yml`: Deploys UAA and enables UAA user management in the Director
- `credhub.yml`: Deploys CredHub and enables CredHub integration in the Director
Expand Down
50 changes: 50 additions & 0 deletions alicloud/cloud-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
azs:
- name: z1
cloud_properties:
availability_zone: ((zone))
- name: z2
cloud_properties:
availability_zone: ((zone))
- name: z3
cloud_properties:
availability_zone: ((zone))

vm_types:
- name: default
cloud_properties:
instance_type: ecs.sn1ne.large
ephemeral_disk: {size: 30_720}
- name: large
cloud_properties:
instance_type: ecs.sn1ne.xlarge
ephemeral_disk: {size: 51_200}


disk_types:
- name: default
disk_size: 20_480
- name: large
disk_size: 51_200

networks:
- name: default
type: manual
subnets:
- range: ((internal_cidr))
gateway: ((internal_gw))
azs: [z1, z2, z3]
dns: [8.8.8.8]
reserved: [((internal_gw))/30]
cloud_properties:
vswitch_id: ((vswitch_id))
security_group_ids:
- ((security_group_id))
- name: vip
type: vip

compilation:
workers: 5
reuse_compilation_vms: true
az: z1
vm_type: default
network: default
124 changes: 124 additions & 0 deletions alicloud/cpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
# CPI
- type: replace
path: /releases/-
value:
name: bosh-alicloud-cpi
version: 24.0.0
url: https://github.com/cloudfoundry-incubator/bosh-alicloud-cpi-release/releases/download/v24.0.0/bosh-alicloud-cpi-release-24.0.0.tgz
sha1: 9ea843cc34ccf61d0c6809c9f6cdfd7da29bc7f1

# light stemcell
- type: replace
path: /resource_pools/name=vms/stemcell?
value:
url: https://bosh-alicloud-light-stemcells-eu.oss-eu-central-1.aliyuncs.com/light-bosh-stemcell-456.1-alicloud-kvm-ubuntu-xenial-go_agent.tgz
sha1: 43c227164ec9f5016b434fa2008c1448d25d2f01

# Configure ECS sizes
- type: replace
path: /resource_pools/name=vms/cloud_properties?
value:
availability_zone: ((zone))
instance_type: "ecs.mn4.small"
instance_name: "bosh-director"
ephemeral_disk: {size: "51_200", category: "cloud_efficiency"}
system_disk: {size: "51_200", category: "cloud_efficiency"}
key_pair_name: ((key_pair_name))

- type: replace
path: /disk_pools/name=disks/cloud_properties?
value:
type: "cloud_efficiency"
instance_role: "director"

- type: replace
path: /networks/name=default/subnets/0/cloud_properties?
value:
vswitch_id: ((vswitch_id))
security_group_ids: [((security_group_id))]
internet_charge_type: "PayByTraffic"

# Enable registry job
- type: replace
path: /instance_groups/name=bosh/jobs/-
value:
name: registry
release: bosh

- type: replace
path: /instance_groups/name=bosh/properties/registry?
value:
address: ((internal_ip))
host: ((internal_ip))
db: # todo remove
host: 127.0.0.1
user: postgres
password: ((postgres_password))
database: bosh
adapter: postgres
http:
user: registry
password: ((registry_password))
port: 25777
username: registry
password: ((registry_password))
port: 25777

# Add CPI job
- type: replace
path: /instance_groups/name=bosh/jobs/-
value: &cpi_job
name: alicloud_cpi
release: bosh-alicloud-cpi

- type: replace
path: /instance_groups/name=bosh/properties/director/cpi_job?
value: alicloud_cpi

- type: replace
path: /cloud_provider/template?
value: *cpi_job

- type: replace
path: /instance_groups/name=bosh/properties/alicloud?
value: &alicloud
region: ((region))
availability_zone: ((zone))
access_key_id: ((access_key_id))
access_key_secret: ((access_key_secret))

- type: replace
path: /cloud_provider/properties/alicloud?
value: *alicloud

- type: replace
path: /cloud_provider/ssh_tunnel?
value:
host: ((internal_ip))
port: 22
user: vcap
private_key: ((private_key))

- type: replace
path: /variables/-
value:
name: registry_password
type: password

# Replace ntp to China timezone
- type: replace
path: /instance_groups/name=bosh/properties/ntp?
value: &ntp
- server 0.cn.pool.ntp.org
- server 1.cn.pool.ntp.org
- server 2.cn.pool.ntp.org
- server 3.cn.pool.ntp.org

- type: replace
path: /cloud_provider/properties/ntp?
value: &ntp
- server 0.cn.pool.ntp.org
- server 1.cn.pool.ntp.org
- server 2.cn.pool.ntp.org
- server 3.cn.pool.ntp.org
20 changes: 20 additions & 0 deletions alicloud/oss-blobstore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---

# Using Alibaba Cloud OSS Service as Bosh blobstore

# Note: If you want to apply the current oss bucket for other blobstores,
# you can specify 'bucket_name' to oss bucket and its one directory, like "((bucket_name))/bosh-blobs", and then the directory "bosh-blobs" will store all of bosh blobs.
#
# 'host' is oss bucket endpoint, and its format is 'oss-<regionId>.aliyuncs.com', like oss-cn-hangzhou.aliyuncs.com.

- type: remove
path: /instance_groups/name=bosh/jobs/name=blobstore

- type: replace
path: /instance_groups/name=bosh/properties/blobstore?
value:
provider: s3
bucket_name: ((oss-bucket-name))
host: ((oss-host))
access_key_id: ((oss-access-key-id))
secret_access_key: ((oss-access-key-secret))
6 changes: 6 additions & 0 deletions alicloud/releases-in-china.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

# CPI
- type: replace
path: /releases/name=bosh-alicloud-cpi/url?
value: https://bosh.oss-cn-hangzhou.aliyuncs.com/bosh-alicloud-cpi-release-24.0.0.tgz

0 comments on commit 95fc1a8

Please sign in to comment.