2 views
Skip to first unread message

Jagadishchandra Bandagar

unread,
Feb 7, 2020, 12:47:20 AM2/7/20
to nebula-or...@googlegroups.com

Hi

I followed all steps, unable to get result.

 

Hello World tutorial

The easiest way to get started is usually with a hands on approach, the following tutorial will use docker-compose to set a local Nebula cluster on your machine that includes MongoDB, the manager & the worker (which normally you will want be different devices but for testing this is sufficient), it of course requires docker & docker-compose installed so if you don't have them install them first.

Tip

You can run the following and skip to step 4 if you don't want to change the docker-compose to add a private Docker registry access:

curl -L "https://raw.githubusercontent.com/nebula-orchestrator/docs/master/examples/hello-world/docker-compose.yml" -o docker-compose.yml && sudo docker-compose up -d

1.    First get the docker-compose.yml of this tutorial and save it locally on your machine

2.    Nebula is geared towards using a private registry but will also work with docker hub, to use your own user\pass (by default no auth is used) edit the docker-compose.yml by entering your docker hub user & password into "REGISTRY_AUTH_USER" & "REGISTRY_AUTH_PASSWORD" under the "worker" container, if your using a private registry change the "REGISTRY_HOST" variable as well to point to your private registry, if you are planning on only using public images you can keep the settings as is and use no Docker registry auth.

3.    from the directory where you saved docker-compose.yml at (same name is important) run docker-compose up -d (you might need to sudo su first if you didn't set your user to be part of the docker group), don't worry if you see the worker & manager restarting, it's because the mongo container take a couple of seconds to initialize.

4.    You now have a running Nebula cluster, lets use Curl to create an nginx app to fill the "example" app that we will run as part of our device_group:

5. curl -X POST \
6.   http://127.0.0.1/api/v2/apps/example \
7.   -H 'authorization: Basic bmVidWxhOm5lYnVsYQ==' \
8.   -H 'cache-control: no-cache' \
9.   -H 'content-type: application/json' \
10.         -d '{
11.         "starting_ports": [{"81":"80"}],
12.         "containers_per": {"server": 1},
13.         "env_vars": {},
14.         "docker_image" : "nginx",
15.         "running": true,
16.         "volumes": ["/tmp:/tmp/1", "/var/tmp/:/var/tmp/1:ro"],
17.         "networks": ["nebula"],
18.         "privileged": false,
19.         "devices": [],
20.         "rolling_restart": false
21.       }'

22. Now that we have an app let's create an the "example" device_group with the "example" app part of it by using another curl command:

23.       curl -X POST \
24.         http://127.0.0.1/api/v2/device_groups/example \
25.         -H 'Authorization: Basic bmVidWxhOm5lYnVsYQ==' \
26.         -H 'Content-Type: application/json' \
27.         -H 'cache-control: no-cache' \
28.         -d '{
29.           "apps": [
30.               "example"
31.           ]
32.       }'

33. Either wait for the changes to catch (usually few seconds at most) or restart the worker container, you now have your first nebula worker (try logging into 127.0.0.1:81 in your browser to see), because the network is internal in this tutorial you can only run more on the same machine (which kinda defeats the purpose) but after you deploy Nebula by following the install guide you can run as many workers as you need by having multiple servers running the same worker container with the same envvars\config file.

 

 

Please help me setup nebula cluster with running app.

 

Regards

Jagadishchandra

.

Reply all
Reply to author
Forward
0 new messages