Set Up Space Cloud
The first step to start using Space Cloud is setting it up. Space Cloud requires several components to be running for proper functions. The most notable components are:
- Gateway: Responsible for ingress traffic and generation of REST / GaphQL APIs
- Runner: Responsible for intra cluster traffic and policy enforcement
- Container Registry: Responsible for storing docker images. We won’t be needing this for local setup.
Luckily, we don’t have to interact with these components in most use cases directly. Space Cloud ships with a utility named
space-cli which will bootstrap a cluster for us.
- Make sure you have Docker installed.
Downloading Space CLI
The first step is downloading
space-cli. You can download a version for your particular platform:
Unzip the compressed archive.
For Linux / Mac:
unzip space-cli.zip && chmod +x space-cli
For Windows: Right-click on the archive and select
To make sure if space-cli binary is correct, type the following command from the directory where space-cli is downloaded:
For Linux / Mac:
This will print the
Optionally, you can copy the
space-clibinary to your environment path variable for global usage.
Setting up Space Cloud
We can set up all Space Cloud components using a single command.
./space-cli setup --dev
setup command selects
Docker as a target by default and runs all the containers required to setup Space Cloud. On successful installation it will generate an output similar to this one:
INFO Setting up space cloud on docker INFO Starting container space-cloud-gateway... INFO Starting container space-cloud-runner... INFO Space Cloud (id: "local-admin") has been successfully setup! :D INFO You can visit mission control at http://localhost:4122/mission-control INFO Your login credentials: [username: "local-admin"; key: "kUkqBffI1ISR"]
Verify the installation run the following docker command:
docker ps --filter=name=space-cloud
You should see an output similar to this!
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1263f8ab1372 spaceuptech/runner "./app start" About a minute ago Up About a minute space-cloud-runner 35f820b550c7 spaceuptech/gateway "./app run" About a minute ago Up About a minute 0.0.0.0:4122->4122/tcp space-cloud-gateway
Creating your first project
Now that we have got Space Cloud setup, we can open
Mission Control (Space cloud’s admin UI) on http://localhost:4122/mission-control.
You will be greeted by a screen like this:
Hit on the
CREATE A PROJECT button to open the following page:
Enter a project name. You can stick to
MyProject for this one.
Create Project button.
Mission Control will ask for setting up a database now:
If you already have one, feel free to configure it. For now, we’ll skip this step since we don’t have a database running at this point.
You can destroy the Space Cloud cluster along with all the deployments by running the
Great! We successfully set up a Space Cloud on Docker and created our first project with it.
Continue to the next guide to add a database to our newly created project and perform some queries on it.