install concourse ci with bosh

72
Install Concourse CI with BOSH Toshiaki Maki (@making) Sr. Solutions Architect @Pivotal 20160519 Concourse CI Tokyo Meetup

Upload: toshiaki-maki

Post on 16-Apr-2017

618 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Install Concourse CI with BOSH

InstallConcourse  CIwith  BOSH

Toshiaki  Maki  (@making)Sr.  Solutions  Architect  @Pivotal2016-‐‑‒05-‐‑‒19Concourse  CI  Tokyo  Meetup

Page 2: Install Concourse CI with BOSH

Who  am  I  ?•Toshiaki  Maki  (@making)•https://blog.ik.am•Sr.  Solutions  Architect•Spring  Framework  enthusiast

SpringFramework徹底⼊入⾨門(Coming  Soon?)

PerfectJava  EE(Coming  Soon?)

Page 3: Install Concourse CI with BOSH
Page 4: Install Concourse CI with BOSH

How  to  Install

•Vagrant  Image•Executable  Binaries•BOSH  Release

https://concourse.ci/installing.html

Easy

Hard Production  Ready

Local  Dev

Page 5: Install Concourse CI with BOSH

Vagrant

$  vagrant  init concourse/lite$  vagrant  up

Page 6: Install Concourse CI with BOSH

Vagrant

Page 7: Install Concourse CI with BOSH

BOSH•Powerful  Provisioning  Tool  to  deploy  distributed  system•Monitor  /  Health  Check• Rolling  Updates•Networking• Storage  Management• VM  Provisioning• IaaS Agnostic• ...

Page 8: Install Concourse CI with BOSH

Do  we  really  need  BOSH?"If  you're  not  yet  familiar  with  BOSH,  learning  it  will  be  a  bit  of  an  investment,  but  itshould  pay  off  in  spades"

http://concourse.ci/clusters-‐‑‒with-‐‑‒bosh.html

Page 9: Install Concourse CI with BOSH

BOSH  components

https://bosh.io/docs/bosh-‐‑‒components.html

Page 10: Install Concourse CI with BOSH

How  to  install  with  BOSH1. Set  up  IaaS2. Install  BOSH  Director  using  bosh-‐‑‒init3. Upload  Stemcell4. Upload  Releases5. Create  manifest  file6. Deploy  the  system  using  manifest  file

Page 11: Install Concourse CI with BOSH

•Deploy  Concourse  to  AWS•Deploy  Concourse  to  Azure

Page 12: Install Concourse CI with BOSH

Manifest  samples

https://github.com/making/concouse-‐‑‒ci-‐‑‒manifest-‐‑‒samples

Page 13: Install Concourse CI with BOSH

Deploy  Concourse  to  AWS

Page 14: Install Concourse CI with BOSH

Prepare  VPC

Page 15: Install Concourse CI with BOSH
Page 16: Install Concourse CI with BOSH
Page 17: Install Concourse CI with BOSH
Page 18: Install Concourse CI with BOSH

VPC  (10.0.0.0/16)public(10.0.0.0/24) private(10.0.1.0/24)NATEIP

Page 19: Install Concourse CI with BOSH

Install  BOSH  Director

Page 20: Install Concourse CI with BOSH

Create  Keypair

Page 21: Install Concourse CI with BOSH

Security  Group

Page 22: Install Concourse CI with BOSH

Manifest  for  bosh-‐‑‒init• https://bosh.io/docs/init-‐‑‒aws.html#create-‐‑‒manifest

Copy  &  Pasteto  bosh.yml

Page 23: Install Concourse CI with BOSH

Replace  placeholdersName ValueELASTIC-‐‑‒IP <Your  New  EIP  for  Director> there are  3  places  to  

replaceSUBNET-‐‑‒ID subnet-‐‑‒xxxxxxxx public subnetAVAILABILITY-‐‑‒ZONE ap-‐‑‒northeast-‐‑‒1aACCESS-‐‑‒KEY-‐‑‒ID xxxxxxxxSECRET-‐‑‒ACCESS-‐‑‒KEY xxxxxxxxREGION ap-‐‑‒northeast-‐‑‒1

Page 24: Install Concourse CI with BOSH

DeployDownload  from  https://bosh.io/docs/install-‐‑‒bosh-‐‑‒init.html

$ bosh-init deploy bosh.yml

Page 25: Install Concourse CI with BOSH

After  20min

Page 26: Install Concourse CI with BOSH

VPC  (10.0.0.0/16)public(10.0.0.0/24) private(10.0.1.0/24)NATBOSHDirector

EIP

EIP

Page 27: Install Concourse CI with BOSH

$ sudo gem install bosh_cli --no-ri --no-rdoc

Page 28: Install Concourse CI with BOSH

$ bosh target 52.196.159.101Target set to `my-bosh'Your username: adminEnter password: Logged in as `admin'

Page 29: Install Concourse CI with BOSH

IaaS Specific  Configuration

az: ...vm_types: ...disk_types: ...networks: ...compilation: ...

aws.yml

Page 30: Install Concourse CI with BOSH

IaaS Specific  Configuration

azs:- name: z1 cloud_properties:

{availability_zone: ap-northeast-1a}

aws.yml

Page 31: Install Concourse CI with BOSH

IaaS Specific  Configurationvm_types:- name: web

cloud_properties: instance_type: t2.micro ephemeral_disk: {size: 3000, type: gp2}security_groups: [web, bosh]

- name: databasecloud_properties: ...

aws.yml

Page 32: Install Concourse CI with BOSH

IaaS Specific  Configuration

disk_type:- name: database

disk_size: 50_000 cloud_properties: {type: gp2}

aws.yml

Page 33: Install Concourse CI with BOSH

Set  Iaas Config

$ bosh update cloud-config aws.ymlActing as user 'admin' on 'my-bosh'Successfully updated cloud config

Page 34: Install Concourse CI with BOSH
Page 35: Install Concourse CI with BOSH

Upload  Stemcell

$ bosh upload stemcellhttps://bosh.io/d/stemcells/bosh-aws-xen-hvm-ubuntu-trusty-go_agent?v=3232.3

Page 36: Install Concourse CI with BOSH

Upload  Releases  (garden,  concourse)

$ bosh upload release https://bosh.io/d/github.com/cloudfoundry-incubator/garden-linux-release?v=0.337.0$ bosh upload release https://bosh.io/d/github.com/concourse/concourse?v=1.2.0

Page 37: Install Concourse CI with BOSH

name: concoursedirector_uuid: ...releases: ...stemcells: ...instance_groups: ...update: ...

Create  manifest  for  Concourseconcourse.yml

Page 38: Install Concourse CI with BOSH

Create  manifest  for  Concourseinstance_groups: ...- name: web

...- name: db

...- name: worker

...

concourse.yml

Page 39: Install Concourse CI with BOSH

Deploy  Concourse  CI

$ bosh deployment concourse.yml$ bosh -n deploy

Page 40: Install Concourse CI with BOSH
Page 41: Install Concourse CI with BOSH

VPC  (10.0.0.0/16)public(10.0.0.0/24) private(10.0.1.0/24)NATBOSHDirector

EIP

EIP

WebEIP Worker

DB

Page 42: Install Concourse CI with BOSH
Page 43: Install Concourse CI with BOSH

Scale  out

- name: workerinstances: 3vm_type: worker

concourse.yml

$ bosh -n deploy

Page 44: Install Concourse CI with BOSH
Page 45: Install Concourse CI with BOSH

VPC  (10.0.0.0/16)public(10.0.0.0/24) private(10.0.1.0/24)NATBOSHDirector

EIP

EIP

WebEIP

WorkerWorkerWorker

DB

Page 46: Install Concourse CI with BOSH

Health  Check

Page 47: Install Concourse CI with BOSH

Health  Check

Page 48: Install Concourse CI with BOSH

Version  up

$ bosh upload release https://bosh.io/d/github.com/concourse/concourse?v=1.3.0$ bosh deploy

Page 49: Install Concourse CI with BOSH

Deploy  Concourse  to  Azure

Page 50: Install Concourse CI with BOSH

Use  templatehttps://azure.microsoft.com/en-‐‑‒us/documentation/templates/bosh-‐‑‒setup/

Page 51: Install Concourse CI with BOSH
Page 52: Install Concourse CI with BOSH
Page 53: Install Concourse CI with BOSH

After  1  hour  ...

Page 54: Install Concourse CI with BOSH

Already  prepared👍

Page 55: Install Concourse CI with BOSH
Page 56: Install Concourse CI with BOSH
Page 57: Install Concourse CI with BOSH
Page 58: Install Concourse CI with BOSH

$ ssh [email protected]

bosh@bosh:~$ bosh targetCurrent target is https://10.0.0.4:25555 (bosh)

Page 59: Install Concourse CI with BOSH

IaaS Specific  Configuration

az: ...vm_types: ...disk_types: ...networks: ...compilation: ...

azure.yml

Page 60: Install Concourse CI with BOSH

IaaS Specific  Configurationvm_types:- name: web

cloud_properties: instance_type: Standard_D1

- name: databasecloud_properties: ...

azure.yml

Page 61: Install Concourse CI with BOSH

Set  Iaas Config

bosh@bosh:~$ bosh update cloud-config azure.ymlActing as user 'admin' on 'bosh'Successfully updated cloud config

Page 62: Install Concourse CI with BOSH
Page 63: Install Concourse CI with BOSH

Upload  Stemcell

$ bosh upload stemcellhttps://bosh.io/d/stemcells/bosh-azure-hyperv-ubuntu-trusty-go_agent?v=3232.4

Page 64: Install Concourse CI with BOSH

Upload  Releases  (garden,  concourse)

$ bosh upload release https://bosh.io/d/github.com/cloudfoundry-incubator/garden-linux-release?v=0.337.0$ bosh upload release https://bosh.io/d/github.com/concourse/concourse?v=1.2.0

Page 65: Install Concourse CI with BOSH

Deploy  Concourse  CI

$ bosh deployment concourse.yml$ bosh -n deploy

Manifest  file  is  as  same  as  AWS's  

Page 66: Install Concourse CI with BOSH
Page 67: Install Concourse CI with BOSH
Page 68: Install Concourse CI with BOSH
Page 69: Install Concourse CI with BOSH
Page 70: Install Concourse CI with BOSH

AWS AzureIaaS Setup Create

VPC, NAT,  Keypair,  SG,  EIPUse  "BOSH  Setup"  Template(other  than  SG)Director • Create  Manifestfile (bosh.yml)

• bosh-‐‑‒initCloud Config • Create  IaaS config (aws.yml)

• bosh  update  cloud-‐‑‒cofig• Create  IaaS config(azure.yml)

• bosh  update  cloud-‐‑‒cofigManifest  for  Concourse

Create manifest  file  (IaaS Independent)

Stemcell Upload  for  AWS  Xen Upload for  Azure  Hyper-‐‑‒VRelease Upload

• garden-‐‑‒linux• concourse

Deploy bosh  deploy

Page 71: Install Concourse CI with BOSH

Installation  Article  (Japanese)

• AWS https://blog.ik.am/entries/383• Azure  https://blog.ik.am/entries/384

Page 72: Install Concourse CI with BOSH

Cloud  Foundry  Tokyo  Meetup #2http://www.meetup.com/ja-‐‑‒JP/Cloud-‐‑‒Foundry-‐‑‒Tokyo-‐‑‒Meetup/events/230285366/

Gwenn(@The_̲Shinji62)will  talk  about  BOSH  2.0