IK.AM

@making's tech note


Cloud Foundry(v226)にDiegoをデプロイメモ

🗃 {Dev/PaaS/CloudFoundry}
🏷 Cloud Foundry 🏷 BOSH 🏷 BOSH-Lite 🏷 Diego 
🗓 Updated at 2016-09-14T03:44:45Z  🗓 Created at 2016-01-07T16:01:11Z   🌎 English Page

!!注意!!

この記事は古いです。こちらを参照してください。

前回、bosh-liteでデプロイしたCloud Foundryに次世代アーキテクチャであるDiegoをインストールする。

まずはdiego-releaseをclone。 checkoutするバージョンはインストールしたCloud Foundryバージョンに合わせて、リリースページにオススメが記載されている。

$ cd ~/workspace
$ git clone https://github.com/cloudfoundry-incubator/diego-release
$ cd diego-release/
$ git checkout v0.1442.0

bosh create releaseの代わりに、cf-releaseのリリースページのバージョンに合わせて、diego-release、garden-linux、etcd-releaseの作成済みbosh releaseをbosh.ioからアップロードする。

$ bosh upload release https://bosh.io/d/github.com/cloudfoundry-incubator/diego-release?v=0.1442.0
$ bosh upload release https://bosh.io/d/github.com/cloudfoundry-incubator/garden-linux-release?v=0.328.0
$ bosh upload release https://bosh.io/d/github.com/cloudfoundry-incubator/etcd-release?v=18

ログはこちら

bosh-lite向けマニフェストファイルを生成、

$ ./scripts/generate-bosh-lite-manifests 
~/workspace/diego-release ~/workspace/diego-release
~/workspace/diego-release
CF Release Manifest at /Users/maki/workspace/cf-release/bosh-lite/deployments/cf.yml
Diego Release Manifest at /Users/maki/workspace/diego-release/bosh-lite/deployments/diego.yml

そして、デプロイ。

$ bosh deployment bosh-lite/deployments/diego.yml 
Deployment set to `/Users/maki/workspace/diego-release/bosh-lite/deployments/diego.yml'
$ bosh -n deploy

ログはこちら

bosh releasesbosh deploymentsbosh vmsの結果が次のようになっていればdiegoのデプロイに成功しているはず。

$ bosh releases
Acting as user 'admin' on 'Bosh Lite Director'

+--------------+-----------+-------------+
| Name         | Versions  | Commit Hash |
+--------------+-----------+-------------+
| cf           | 226*      | 5ac6aacd+   |
| diego        | 0.1442.0* | cc74696c    |
| etcd         | 18*       | 52f3a004+   |
| garden-linux | 0.328.0*  | ce51a708    |
+--------------+-----------+-------------+
(*) Currently deployed
(+) Uncommitted changes

Releases total: 4
$ bosh deployments
Acting as user 'admin' on 'Bosh Lite Director'

+-----------------+----------------------+--------------------------------------------------+--------------+
| Name            | Release(s)           | Stemcell(s)                                      | Cloud Config |
+-----------------+----------------------+--------------------------------------------------+--------------+
| cf-warden       | cf/226               | bosh-warden-boshlite-ubuntu-trusty-go_agent/3147 | none         |
+-----------------+----------------------+--------------------------------------------------+--------------+
| cf-warden-diego | cf/226               | bosh-warden-boshlite-ubuntu-trusty-go_agent/3147 | none         |
|                 | diego/0.1442.0       |                                                  |              |
|                 | etcd/18              |                                                  |              |
|                 | garden-linux/0.328.0 |                                                  |              |
+-----------------+----------------------+--------------------------------------------------+--------------+

Deployments total: 2
$ bosh vms
Acting as user 'admin' on 'Bosh Lite Director'
Deployment `cf-warden'

Director task 41

Task 41 done

+---------------------------------------------------------------------------+---------+-----+-----------+--------------+
| VM                                                                        | State   | AZ  | VM Type   | IPs          |
+---------------------------------------------------------------------------+---------+-----+-----------+--------------+
| api_z1/0 (937db9a9-6ccb-4911-a461-4498a4c02438)                           | running | n/a | large_z1  | 10.244.0.134 |
| consul_z1/0 (94b921ab-1707-4bd8-9210-3c98916c244b)                        | running | n/a | small_z1  | 10.244.0.54  |
| doppler_z1/0 (e24d76f4-b4e1-4635-bbea-41b4505a5a94)                       | running | n/a | medium_z1 | 10.244.0.142 |
| etcd_z1/0 (b2a266e6-398b-4267-b320-1d7ede34c279)                          | running | n/a | medium_z1 | 10.244.0.42  |
| ha_proxy_z1/0 (b76a8bee-1625-4494-91cc-130f034877f3)                      | running | n/a | router_z1 | 10.244.0.34  |
| hm9000_z1/0 (57d26dc9-efe4-404f-9098-d53e05f245b2)                        | running | n/a | medium_z1 | 10.244.0.138 |
| loggregator_trafficcontroller_z1/0 (5c74c7d6-9042-43e4-b65e-9ad0efd39e84) | running | n/a | small_z1  | 10.244.0.146 |
| nats_z1/0 (04d0adc1-8285-48b7-8402-308b417a1f86)                          | running | n/a | medium_z1 | 10.244.0.6   |
| postgres_z1/0 (5883ff27-1dcb-46e7-88ea-7dcca97d1ea6)                      | running | n/a | medium_z1 | 10.244.0.30  |
| router_z1/0 (49768ef4-51d6-4f54-a64e-f14443c3eaa1)                        | running | n/a | router_z1 | 10.244.0.22  |
| runner_z1/0 (78ef9673-a2d3-4d3b-b4af-53f72cae7597)                        | running | n/a | runner_z1 | 10.244.0.26  |
| uaa_z1/0 (87d561fc-e996-4fe2-a976-cb30cde240e6)                           | running | n/a | medium_z1 | 10.244.0.130 |
+---------------------------------------------------------------------------+---------+-----+-----------+--------------+

VMs total: 12
Deployment `cf-warden-diego'

Director task 42

Task 42 done

+-----------------------------------------------------------+---------+-----+------------------+---------------+
| VM                                                        | State   | AZ  | VM Type          | IPs           |
+-----------------------------------------------------------+---------+-----+------------------+---------------+
| access_z1/0 (d2815ed8-2bdd-40cb-b083-e325c18678bc)        | running | n/a | access_z1        | 10.244.16.6   |
| brain_z1/0 (09f3cd87-0baa-4208-b2fd-5ce49e36d987)         | running | n/a | brain_z1         | 10.244.16.134 |
| cc_bridge_z1/0 (73efeff5-f14a-48b8-bd99-904f5a4e72e6)     | running | n/a | cc_bridge_z1     | 10.244.16.142 |
| cell_z1/0 (ae7a0324-4aef-4974-a363-aaaf4ba68f30)          | running | n/a | cell_z1          | 10.244.16.138 |
| database_z1/0 (9ce2dd82-dfbd-4bd6-8d11-f261c4ac0118)      | running | n/a | database_z1      | 10.244.16.130 |
| route_emitter_z1/0 (8397532d-7785-4924-ac06-06790ad43aaf) | running | n/a | route_emitter_z1 | 10.244.16.146 |
+-----------------------------------------------------------+---------+-----+------------------+---------------+

VMs total: 6

Diegoがデプロイできれば、この記事のようにDockerイメージをデプロイできる。

$ cf enable-feature-flag diego_docker
Setting status of diego_docker as admin...

OK

Feature diego_docker Enabled.
$ cf push my-app -o cloudfoundry/lattice-app
Creating app my-app in org maki-org / space development as admin...
OK

Creating route my-app.bosh-lite.com...
OK

Binding my-app.bosh-lite.com to my-app...
OK


Starting app my-app in org maki-org / space development as admin...
Creating container
Successfully created container
Staging...
Staging process started ...
Staging process finished
Exit status 0
Staging Complete

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
1 of 1 instances running

App started


OK

App my-app was started using this command `/lattice-app `

Showing health and status for app my-app in org maki-org / space development as admin...
OK

requested state: started
instances: 1/1
usage: 256M x 1 instances
urls: my-app.bosh-lite.com
package uploaded: Thu Jan 7 15:37:35 UTC 2016
stack: cflinuxfs2
buildpack: unknown

     state     since                    cpu    memory      disk      details   
#0   running   2016-01-08 12:38:34 AM   0.0%   0 of 256M   0 of 1G      
$ cf apps
Getting apps in org maki-org / space development as admin...
OK

name     requested state   instances   memory   disk   urls   
my-app   started           1/1         256M     1G     my-app.bosh-lite.com   

http://my-app.bosh-lite.com/


✒️️ Edit  ⏰ History  🗑 Delete