Update deployment topics and screenshots (#108)
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 116 KiB |
|
@ -1,34 +1,42 @@
|
||||||
---
|
---
|
||||||
title: Deploy a service
|
title: Deploy a service
|
||||||
description: Learn how to deploy services to a cluster managed by Universal Control Plane.
|
description: Learn how to deploy services to a swarm managed by Universal Control Plane.
|
||||||
keywords: docker, ucp, deploy, service
|
keywords: ucp, deploy, service
|
||||||
---
|
---
|
||||||
|
|
||||||
You can deploy and monitor your services from the UCP web UI. In this example
|
You can deploy and monitor your services from the UCP web UI. In this example
|
||||||
we'll deploy an NGINX web server, and make it accessible on port `8000`.
|
we'll deploy an [NGINX](https://www.nginx.com/) web server and make it
|
||||||
|
accessible on port `8000`.
|
||||||
|
|
||||||
Navigate to the **UCP web UI**, click the **Resources** tab, and choose
|
In your browser, navigate to the UCP web UI and click **Services**. On the
|
||||||
**Services**.
|
**Create a Service** page, click **Create Service** to configure the
|
||||||
|
NGINX service.
|
||||||
|
|
||||||
{: .with-border}
|
Fill in the following fields:
|
||||||
|
|
||||||
Click the **Create a Service** button to deploy the NGINX service.
|
|
||||||
|
|
||||||
{: .with-border}
|
|
||||||
|
|
||||||
Fill-in the following fields:
|
|
||||||
|
|
||||||
| Field | Value |
|
| Field | Value |
|
||||||
|:--------------|:------|
|
|:--------------|:------|
|
||||||
| Service name | nginx |
|
| Service name | nginx |
|
||||||
| Image name | nginx |
|
| Image name | nginx:latest |
|
||||||
|
|
||||||
|
{: .with-border}
|
||||||
|
|
||||||
|
In the left pane, click **Network**. In the **Ports** section,
|
||||||
|
click **Publish Port** and fill in the following fields:
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
|:--------------|:------|
|
||||||
| Internal port | 80 |
|
| Internal port | 80 |
|
||||||
| Public port | 8000 |
|
| Protocol | tcp |
|
||||||
|
| Publish mode | Ingress |
|
||||||
|
| Public port | 8000 |
|
||||||
|
|
||||||
{: .with-border}
|
{: .with-border}
|
||||||
|
|
||||||
Once you've specified the service image and ports, click **Deploy now** to
|
Click **Confirm** to map the ports for the NGINX service.
|
||||||
deploy the service into a node in the UCP cluster.
|
|
||||||
|
Once you've specified the service image and ports, click **Create** to
|
||||||
|
deploy the service into the UCP swarm.
|
||||||
|
|
||||||
Once the service is up and running, you'll be able to see the default NGINX
|
Once the service is up and running, you'll be able to see the default NGINX
|
||||||
page, by going to `http://<node-ip>:8000`.
|
page, by going to `http://<node-ip>:8000`.
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
---
|
---
|
||||||
description: Learn how to deploy containerized applications on a swarm, with Docker
|
|
||||||
Universal Control Plane.
|
|
||||||
keywords: deploy, application
|
|
||||||
title: Deploy an app from the CLI
|
title: Deploy an app from the CLI
|
||||||
|
description: Learn how to deploy containerized applications on a swarm, with Docker Universal Control Plane.
|
||||||
|
keywords: ucp, deploy, application, stack, service, compose
|
||||||
---
|
---
|
||||||
|
|
||||||
With Docker Universal Control Plane you can deploy your apps from the CLI,
|
With Docker Universal Control Plane you can deploy your apps from the CLI,
|
||||||
|
@ -11,20 +10,21 @@ application that allows users to vote on whether they prefer cats or dogs.
|
||||||
|
|
||||||
## Get a client certificate bundle
|
## Get a client certificate bundle
|
||||||
|
|
||||||
Docker UCP secures your Docker swarm with role-based access control, so that
|
Docker UCP secures your Docker swarm with
|
||||||
only authorized users can deploy applications. To be able to run Docker commands
|
[role-based access control](../../admin/manage-users/index.md),
|
||||||
on a swarm managed by UCP, you need to configure your Docker CLI client to
|
so that only authorized users can deploy applications. To be able to run Docker
|
||||||
authenticate to UCP using client certificates.
|
commands on a swarm managed by UCP, you need to configure your Docker CLI
|
||||||
|
client to authenticate to UCP using client certificates.
|
||||||
[Learn how to set your CLI to use client certificates](../access-ucp/cli-based-access.md).
|
[Learn how to set your CLI to use client certificates](../access-ucp/cli-based-access.md).
|
||||||
|
|
||||||
## Deploy the voting app
|
## Deploy the voting application
|
||||||
|
|
||||||
The application we're going to deploy is composed of several services:
|
The application we're going to deploy is composed of several services:
|
||||||
|
|
||||||
* `vote`: The web application that presents the voting interface via port 5000
|
* `vote`: The web application that presents the voting interface via port 5000
|
||||||
* `result`: A web application that displays the voting results via port 5001
|
* `result`: A web application that displays the voting results via port 5001
|
||||||
* `visualizer`: A web application that shows a map of the deployment of the various services across the available nodes via port 8080
|
* `visualizer`: A web application that shows a map of the deployment of the
|
||||||
|
various services across the available nodes via port 8080
|
||||||
* `redis`: Collects raw voting data and stores it in a key/value queue
|
* `redis`: Collects raw voting data and stores it in a key/value queue
|
||||||
* `db`: A PostgreSQL service which provides permanent storage on a host volume
|
* `db`: A PostgreSQL service which provides permanent storage on a host volume
|
||||||
* `worker`: A background service that transfers votes from the queue to permanent storage
|
* `worker`: A background service that transfers votes from the queue to permanent storage
|
||||||
|
@ -120,15 +120,13 @@ volumes:
|
||||||
|
|
||||||
> You can define services in this YAML file that feature a `deploy:` key, which
|
> You can define services in this YAML file that feature a `deploy:` key, which
|
||||||
schedules the containers on certain nodes, defines their restart behavior,
|
schedules the containers on certain nodes, defines their restart behavior,
|
||||||
configures the number of replicas, and so on. These features are provided by the
|
configures the number of replicas, and so on. These features are provided
|
||||||
Compose V3 file format, which is currently in beta. You can [read the
|
by the Compose V3 file format.
|
||||||
pre-release documentation for Compose V3 on Docker's preview URL for the
|
[Learn about Compose files](/compose/compose-file/).
|
||||||
upcoming Compose
|
|
||||||
documentation](http://docker-docs-vnext-compose.netlify.com/compose/compose-file/#/deploy).
|
|
||||||
|
|
||||||
In your command line, navigate to the place where you've created the
|
In your command line, navigate to the place where you've created the
|
||||||
`docker-compose.yml` file and deploy the application to UCP by running `docker
|
`docker-compose.yml` file and deploy the application to UCP by running `docker
|
||||||
stack deploy` and giving the application a name, such as "VotingApp" used here:
|
stack deploy` and giving the application a name, like "VotingApp":
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker stack deploy --compose-file docker-compose.yml VotingApp
|
docker stack deploy --compose-file docker-compose.yml VotingApp
|
||||||
|
@ -148,9 +146,10 @@ op3z6z5ri4k3 VotingApp_worker replicated 1/2 manomarks/examplevotin
|
||||||
umoqinuwegzj VotingApp_vote replicated 6/6 manomarks/examplevotingapp_vote:latest
|
umoqinuwegzj VotingApp_vote replicated 6/6 manomarks/examplevotingapp_vote:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
As you saw earlier, a service called `visualizer` was deployed and published to
|
As you saw earlier, a service called `VotingApp_visualizer` was deployed and
|
||||||
port 8080. Visiting that port accesses the running instance of the `visualizer`
|
published to port 8080. Visiting that port accesses the running instance of
|
||||||
service in your browser, which shows a map of how this application was deployed:
|
the visualizer service in your browser, which shows a map of how this application
|
||||||
|
was deployed:
|
||||||
|
|
||||||
{: .with-border}
|
{: .with-border}
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
---
|
---
|
||||||
description: Learn how to deploy containerized applications on a cluster, with Docker
|
|
||||||
Universal Control Plane.
|
|
||||||
keywords: ucp, deploy, application
|
|
||||||
title: Deploy an app from the UI
|
title: Deploy an app from the UI
|
||||||
|
description: Learn how to deploy containerized applications on a cluster, with Docker Universal Control Plane.
|
||||||
|
keywords: ucp, deploy, application, stack, service, compose
|
||||||
---
|
---
|
||||||
|
|
||||||
With Docker Universal Control Plane you can deploy applications from the UI
|
With Docker Universal Control Plane you can deploy applications from the UI
|
||||||
using `docker-compose.yml` files. In this example, we're going to deploy an
|
using `docker-compose.yml` files. In this example, we're going to deploy an
|
||||||
application that allows users to vote on whether they prefer cats or dogs. 😺 🐶
|
application that allows users to vote on whether they prefer cats or dogs. 😺 🐶
|
||||||
|
|
||||||
## Deploy voting application
|
## Deploy the voting application
|
||||||
|
|
||||||
In your browser, **log in** to UCP, and navigate to the **Stacks & Applications** page.
|
|
||||||
There, click the **Deploy** button, to deploy a new application.
|
|
||||||
|
|
||||||
{: .with-border}
|
|
||||||
|
|
||||||
The application we're going to deploy is composed of several services:
|
The application we're going to deploy is composed of several services:
|
||||||
|
|
||||||
* `vote`: The web application that presents the voting interface via port 5000
|
* `vote`: The web application that presents the voting interface via port 5000
|
||||||
* `result`: A web application that displays the voting results via port 5001
|
* `result`: A web application that displays the voting results via port 5001
|
||||||
* `visualizer`: A web application that shows a map of the deployment of the various services across the available nodes via port 8080
|
* `visualizer`: A web application that shows a map of the deployment of the
|
||||||
|
various services across the available nodes via port 8080
|
||||||
* `redis`: Collects raw voting data and stores it in a key/value queue
|
* `redis`: Collects raw voting data and stores it in a key/value queue
|
||||||
* `db`: A PostgreSQL service which provides permanent storage on a host volume
|
* `db`: A PostgreSQL service which provides permanent storage on a host volume
|
||||||
* `worker`: A background service that transfers votes from the queue to permanent storage
|
* `worker`: A background service that transfers votes from the queue to permanent storage
|
||||||
|
|
||||||
Click **Deploy** and paste the following YAML into the **APPLICATION DEFINITION**
|
In your browser, log in to the UCP web UI, and navigate to the
|
||||||
field.
|
**Stacks** page. Click **Create Stack** to deploy a new application.
|
||||||
|
|
||||||
|
Give the application a name, like "VotingApp", and in the **Mode** field,
|
||||||
|
select **Services**.
|
||||||
|
|
||||||
|
Paste the following YAML into the **COMPOSE.YML** editor.
|
||||||
|
|
||||||
```none
|
```none
|
||||||
version: "3"
|
version: "3"
|
||||||
|
@ -114,31 +114,41 @@ volumes:
|
||||||
db-data:
|
db-data:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{: .with-border}
|
||||||
|
|
||||||
> When "Services" is selected, you can define services in this YAML file that
|
> When "Services" is selected, you can define services in this YAML file that
|
||||||
have a `deploy:` key, which schedules the containers on certain nodes, defines
|
have a `deploy:` key, which schedules the containers on certain nodes, defines
|
||||||
their restart behavior, configures the number of replicas, and so on. These
|
their restart behavior, configures the number of replicas, and so on. These
|
||||||
features are provided by the Compose V3 file format, which is currently in beta.
|
features are provided by the Compose V3 file format.
|
||||||
You can [read the pre-release documentation for Compose V3 on Docker's preview
|
[Learn about Compose files](/compose/compose-file/).
|
||||||
URL for the upcoming Compose
|
|
||||||
documentation](http://docker-docs-vnext-compose.netlify.com/compose/compose-file/#/deploy).
|
|
||||||
|
|
||||||
Give the application a name (such as "VotingApp," used here), and click
|
Click **Create** to build and deploy the application. When you see the **Created successfully** message, click **Done**.
|
||||||
**Create**.
|
|
||||||
|
|
||||||
Once UCP deploys the application, click on **VotingApp** or go to **Services** on the left navigation,
|
In the left pane, click **Services** to see the details of the services that
|
||||||
to see the details of the services you have deployed across your nodes. Try
|
you deployed across your nodes. Click the `VotingApp_vote` service and find the **Published Endpoint** field in the details pane. Click the link to visit
|
||||||
clicking on the `visualizer` service, and scroll to the bottom of the detail page.
|
the voting page, which is published on port `5000`.
|
||||||
You'll see a link to your UCP instance's URL that includes the published port
|
|
||||||
of that service, which is 8080 in this case.
|
|
||||||
|
|
||||||
{: .with-border}
|
{: .with-border}
|
||||||
|
|
||||||
Visiting that URL accesses the running instance of the `visualizer` service in
|
Click **Cats** and **Dogs** a few times to register some votes, and notice
|
||||||
your browser, which shows a map of how this application was deployed:
|
that each click is processed by a different container.
|
||||||
|
|
||||||
|
Go back to the **Services** page in the UCP web UI. Click the
|
||||||
|
`VotingApp_result` service and find the **Published Endpoint** field in
|
||||||
|
the details pane. It has the same URL as the other `VotingApp` services,
|
||||||
|
but it's published on port `5001`. Click the link to view the vote tally.
|
||||||
|
|
||||||
|
Back in the **Services** page, click the
|
||||||
|
`VotingApp_visualizer` service and find the **Published Endpoint** field in
|
||||||
|
the details pane. You'll see a link to your UCP instance's URL that includes
|
||||||
|
the published port of the visualizer service, which is 8080 in this case.
|
||||||
|
|
||||||
|
Visiting this URL accesses the running instance of the `VotingApp_visualizer`
|
||||||
|
service in your browser, which shows a map of how this application was deployed:
|
||||||
|
|
||||||
{: .with-border}
|
{: .with-border}
|
||||||
|
|
||||||
Here you can see some of the characteristics of the deployment specification
|
You can see some of the characteristics of the deployment specification
|
||||||
from the Compose file in play. For example, the manager node is running the
|
from the Compose file in play. For example, the manager node is running the
|
||||||
PostgreSQL container, as configured by setting `[node.role == manager]` as a
|
PostgreSQL container, as configured by setting `[node.role == manager]` as a
|
||||||
constraint in the `deploy` key for the `db` service.
|
constraint in the `deploy` key for the `db` service.
|
||||||
|
|