BOSH를 알아보면.. 그 종류? 구성 방법에 대한 이야기가 많습니다.

크게 2가지 bosh에 대한 내용이 주를 이루는데요.. 먼저 bosh-lite와 micro-bosh

 

1) bosh-lite

bosh lightweight 버전으로 IaaS VM 환경없이 로컬의 vagrant 환경에서 system deploy 할 수 있다 Warden Cloud Provider Interface (CPI) 사용하며 Container 방식으로 Cloud Foundry Component를 VM 내부에 배포하게 됩니다.

개발 용도의 버전이죠...

 

2) micro-bosh

single vm으로 구성된 bosh Cloud Foundy deploy하거나 IaaS상에 소프트웨어를 deploy 있습니다.

주로 micro-bosh를 통해 CloudFoundry를 배포하죠..


bosh-lite를 통해 CF 배포에 대해 다루도록 하겠습니다.


환경 : Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-90-generic x86_64)

 

1. Install Git

$ apt-get install git

 

2. Install VirtualBox

$ echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" >> /etc/apt/sources.list

or create a new .list file as described in this thread.

$ wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

$ sudo apt-get update

$ sudo apt-get install virtualbox-4.3

$ sudo apt-get install dkms

$ VBoxManage --version

4.3.10_Ubuntur93012

 

3. Install Vagrant (the known version to work with bosh-lite is 1.6.3 - link)

$ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.deb

$ sudo dpkg -i vagrant_1.6.3_x86_64.deb

$ vagrant --version

Vagrant 1.6.3

 

4. Check if vagrant is correctly working with the installed virtual box(테스트 이므로 UP 후 삭제)

$ vagrant init hashicorp/precise32

$ vagrant up

 

5. Install Ruby(using RVM) + RubyGems + Bundler(ruby 업데이트 및 버전관리를 위한 rvm 설치)

5.1. Install rvm

$ curl -sSL https://rvm.io/mpapis.asc | gpg --import -

$ curl -sSL https://get.rvm.io | bash -s stable

$ source /etc/profile.d/rvm.sh

$ rvm --version

5.2. Install latest ruby version

$ rvm install 1.9.3-p551

$ rvm use ruby --default 2.1.7

$ ruby -v

ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

 

 

6. Install Bosh CLI (check the prerequisites for the target OS here) : bosh_cli 설치

- Note that Bosh CLI is not suppored on windows - github issue

$ sudo apt-get install build-essential libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev

$ gem install bosh_cli

 

 

7. Install Bosh-Lite

$ git clone https://github.com/cloudfoundry/bosh-lite

$ cd bosh-lite

$ vagrant up --provider=virtualbox

 

8. bosh target 192.168.50.4 lite

Target set to `Bosh Lite Director'

Your username: admin

Enter password: admin

Logged in as `admin'

 

9. Setup a route between the laptop and the VMs running inside Bosh Lite

$ cd bosh-lite

$ ./bin/add-route(10.254.0.0/16 수정)

 

10. upload stemcell

Stemcell 이미지 다운로드

bosh upload stemcell bosh-stemcell-2776-warden-boshlite-centos-go_agent.tgz

 

Getting the template (“stemcell”) we use to deploy Cloud Foundry

# wget http://bosh-jenkins-gems-warden.s3.amazonaws.com/stemcells/latest-bosh-stemcell-warden.tgz

Uploading the stemcell to BOSH

# bosh upload stemcell latest-bosh-stemcell-warden.tgz

# bosh stemcells

 

 

11. OK, ready to install Cloud Foundry:

# git clone https://github.com/cloudfoundry/cf-release.git

 

Go into the cf-release directory and  update the cf-release using ./update command

12. Use the update helper script to update the cf-release submodules

# cd cf-release

# ./update

 

13 spiff 설치(gvm 을 이용한 go 언어 설치 후 spiff 설치하거나, 방법은 여러가지임)

# git spiff : https://github.com/cloudfoundry-incubator/spiff #installation

# cp spiff /usr/bin/

 

Spiff : To create a valid deployment file for the full deployment of CloudFoundry it is necessary to use Spiff. Spiff is a “A declarative YAML templating system tuned for BOSH deployment manifests.”

spiff is a command line tool and declarative YAML templating system, specially designed for generating BOSH deployment manifests.

14. create deployment manifest stub

 

# bosh status --uuid : bosh target uuid 확인

# vi cf-stub.yml

---

director_uuid: DIRECTOR-UUID

generate_deployment_manifest INFRASTRUCTURE MANIFEST-STUB > cf-deployment.yml

# ./generate_deployment_manifest warden cf-stub.yml > cf-deployment.yml

cf-deployment.yml 생성

 

generate_deployment_manifest : script template directory yml 파일 spiff

 

# bosh target : bosh target 서버 재확인

 

Use bosh deployment MANIFEST-NAME to set your deployment to the generated manifest. Replace MANIFEST-NAME with the name of your deployment manifest

# bosh deployment cf-deployment.yml

 

Run bosh create release to create a Cloud Foundry release. This command prompts you for a development release name.

# bosh create release

 

Run bosh create release to create a Cloud Foundry release.

# bosh upload release

 

uploaded Cloud Foundry release.

# bosh deploy

 

 

Deploy 완료 이후 테스트

# If not using AWS, but behind a proxy, make sure to run 'export no_proxy=192.168.50.4,xip.io'

$ cf api --skip-ssl-validation https://api.10.244.0.34.xip.io

$ cf auth admin admin

$ cf create-org test-org

$ cf target -o test-org

$ cf create-space test-space

$ cf target -s test-space

 

Go language 설치

# bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)

# gvm version

# gvm listall

# gvm install go1.4

'CloudFoundry' 카테고리의 다른 글

[bosh] job lifecycle  (0) 2016.06.02
[bosh] release, job  (0) 2016.06.02
[CloudFoundry] cf push process(application 배포)  (0) 2016.04.20
CloudFoundry user-provide-service setting  (0) 2016.04.20
CPI(Cloud Provider Interface) / bosh  (0) 2016.04.08
Posted by 뭉탁거림
,