mirror of https://github.com/docker/docs.git
Remove deploy apps with hrm
This commit is contained in:
parent
ad99769c85
commit
b083b2a923
|
|
@ -1673,8 +1673,6 @@ manuals:
|
|||
section:
|
||||
- path: /datacenter/ucp/3.0/guides/user/services/deploy-a-service/
|
||||
title: Deploy a service
|
||||
- path: /datacenter/ucp/3.0/guides/user/services/use-domain-names-to-access-services/
|
||||
title: Use domain names to access services
|
||||
- path: /datacenter/ucp/3.0/guides/user/services/
|
||||
title: Deploy an app from the UI
|
||||
- path: /datacenter/ucp/3.0/guides/user/services/deploy-app-cli/
|
||||
|
|
|
|||
|
|
@ -1,198 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="740px" height="250px" viewBox="0 0 740 250" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>use-domain-names-2</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<circle id="path-1" cx="4" cy="4" r="4"></circle>
|
||||
<mask id="mask-2" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="-2" y="-2" width="12" height="12">
|
||||
<rect x="-2" y="-2" width="12" height="12" fill="white"></rect>
|
||||
<use xlink:href="#path-1" fill="black"></use>
|
||||
</mask>
|
||||
<circle id="path-3" cx="4" cy="4" r="4"></circle>
|
||||
<mask id="mask-4" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="-2" y="-2" width="12" height="12">
|
||||
<rect x="-2" y="-2" width="12" height="12" fill="white"></rect>
|
||||
<use xlink:href="#path-3" fill="black"></use>
|
||||
</mask>
|
||||
<circle id="path-5" cx="4" cy="4" r="4"></circle>
|
||||
<mask id="mask-6" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="-2" y="-2" width="12" height="12">
|
||||
<rect x="-2" y="-2" width="12" height="12" fill="white"></rect>
|
||||
<use xlink:href="#path-5" fill="black"></use>
|
||||
</mask>
|
||||
<circle id="path-7" cx="4" cy="4" r="4"></circle>
|
||||
<mask id="mask-8" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="-2" y="-2" width="12" height="12">
|
||||
<rect x="-2" y="-2" width="12" height="12" fill="white"></rect>
|
||||
<use xlink:href="#path-7" fill="black"></use>
|
||||
</mask>
|
||||
<circle id="path-9" cx="4" cy="4" r="4"></circle>
|
||||
<mask id="mask-10" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="-2" y="-2" width="12" height="12">
|
||||
<rect x="-2" y="-2" width="12" height="12" fill="white"></rect>
|
||||
<use xlink:href="#path-9" fill="black"></use>
|
||||
</mask>
|
||||
</defs>
|
||||
<g id="ucp-diagrams" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="use-domain-names-2">
|
||||
<g id="nodes" transform="translate(108.000000, 104.000000)">
|
||||
<g id="workers" transform="translate(321.000000, 0.000000)">
|
||||
<g id="node-1" transform="translate(107.000000, 0.000000)">
|
||||
<text id="192.168.99.104" font-family="OpenSans-Semibold, Open Sans" font-size="10" font-weight="500" fill="#82949E">
|
||||
<tspan x="13.4824219" y="116">192.168.99.104</tspan>
|
||||
</text>
|
||||
<g id="node">
|
||||
<g id="node-label">
|
||||
<path d="M0,2.00295631 C0,0.896754086 0.897702336,0 1.99174577,0 L71,0 L71,10.6452381 C71,16.5244408 66.2312425,21.2904762 60.3513837,21.2904762 L0,21.2904762 L0,2.00295631 Z" id="Rectangle-127" fill="#445D6E"></path>
|
||||
<text id="worker-node" font-family="OpenSans, Open Sans" font-size="8" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="6" y="14">worker node</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
<g id="app" transform="translate(1.000000, 79.000000)">
|
||||
<rect id="Rectangle-138" fill="#439FD1" x="0" y="0" width="95" height="22" rx="2"></rect>
|
||||
<text id="UCP" font-family="OpenSans, Open Sans" font-size="10" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="38.1953125" y="15">UCP </tspan>
|
||||
</text>
|
||||
</g>
|
||||
<g id="app-copy" transform="translate(1.000000, 56.000000)">
|
||||
<rect id="Rectangle-138" fill="#FFB463" x="0" y="0" width="95" height="22" rx="2"></rect>
|
||||
<text id="wordpress:8000" font-family="OpenSans, Open Sans" font-size="10" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="10.5390625" y="15">wordpress:8000</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<rect id="node-border" stroke="#445D6E" stroke-width="2" x="0" y="0" width="97" height="102" rx="2"></rect>
|
||||
</g>
|
||||
<g id="node-1-copy">
|
||||
<text id="192.168.99.103" font-family="OpenSans-Semibold, Open Sans" font-size="10" font-weight="500" fill="#82949E">
|
||||
<tspan x="13.4824219" y="116">192.168.99.103</tspan>
|
||||
</text>
|
||||
<g id="node">
|
||||
<g id="node-label">
|
||||
<path d="M0,2.00295631 C0,0.896754086 0.897702336,0 1.99174577,0 L71,0 L71,10.6452381 C71,16.5244408 66.2312425,21.2904762 60.3513837,21.2904762 L0,21.2904762 L0,2.00295631 Z" id="Rectangle-127" fill="#E0E4E7"></path>
|
||||
<text id="worker-node" font-family="OpenSans, Open Sans" font-size="8" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="6" y="14">worker node</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
<g id="app" transform="translate(1.000000, 79.000000)">
|
||||
<rect id="Rectangle-138" fill="#A1CFE8" x="0" y="0" width="95" height="22" rx="2"></rect>
|
||||
<text id="UCP" font-family="OpenSans, Open Sans" font-size="10" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="38.1953125" y="15">UCP</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<rect id="node-border" stroke="#E0E4E7" stroke-width="2" x="0" y="0" width="97" height="102" rx="2"></rect>
|
||||
</g>
|
||||
</g>
|
||||
<g id="managers">
|
||||
<g id="node-1" transform="translate(214.000000, 0.000000)">
|
||||
<text id="192.168.99.102" font-family="OpenSans-Semibold, Open Sans" font-size="10" font-weight="500" fill="#82949E">
|
||||
<tspan x="13.4824219" y="116">192.168.99.102</tspan>
|
||||
</text>
|
||||
<g id="node">
|
||||
<g id="node-label">
|
||||
<path d="M0,2.00295631 C0,0.896754086 0.897702336,0 1.99174577,0 L71,0 L71,10.6452381 C71,16.5244408 66.2312425,21.2904762 60.3513837,21.2904762 L0,21.2904762 L0,2.00295631 Z" id="Rectangle-127" fill="#E0E4E7"></path>
|
||||
<text id="manager-node" font-family="OpenSans, Open Sans" font-size="8" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="6" y="14">manager node</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
<g id="app" transform="translate(1.000000, 79.000000)">
|
||||
<rect id="Rectangle-138" fill="#A1CFE8" x="0" y="0" width="95" height="22" rx="2"></rect>
|
||||
<text id="UCP" font-family="OpenSans, Open Sans" font-size="10" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="38.1953125" y="15">UCP</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<rect id="node-border" stroke="#E0E4E7" stroke-width="2" x="0" y="0" width="97" height="102" rx="2"></rect>
|
||||
</g>
|
||||
<g id="node-1-copy-3" transform="translate(107.000000, 0.000000)">
|
||||
<text id="192.168.99.101" font-family="OpenSans-Semibold, Open Sans" font-size="10" font-weight="500" fill="#82949E">
|
||||
<tspan x="13.4824219" y="116">192.168.99.101</tspan>
|
||||
</text>
|
||||
<g id="node">
|
||||
<g id="node-label">
|
||||
<path d="M0,2.00295631 C0,0.896754086 0.897702336,0 1.99174577,0 L71,0 L71,10.6452381 C71,16.5244408 66.2312425,21.2904762 60.3513837,21.2904762 L0,21.2904762 L0,2.00295631 Z" id="Rectangle-127" fill="#E0E4E7"></path>
|
||||
<text id="manager-node" font-family="OpenSans, Open Sans" font-size="8" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="6" y="14">manager node</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
<g id="app" transform="translate(1.000000, 79.000000)">
|
||||
<rect id="Rectangle-138" fill="#A1CFE8" x="0" y="0" width="95" height="22" rx="2"></rect>
|
||||
<text id="UCP" font-family="OpenSans, Open Sans" font-size="10" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="38.1953125" y="15">UCP</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<rect id="node-border" stroke="#E0E4E7" stroke-width="2" x="0" y="0" width="97" height="102" rx="2"></rect>
|
||||
</g>
|
||||
<g id="node-1-copy-2">
|
||||
<text id="192.168.99.100-copy-4" font-family="OpenSans-Semibold, Open Sans" font-size="10" font-weight="500" fill="#82949E">
|
||||
<tspan x="13.4824219" y="116">192.168.99.100</tspan>
|
||||
</text>
|
||||
<g id="node">
|
||||
<g id="node-label">
|
||||
<path d="M0,2.00295631 C0,0.896754086 0.897702336,0 1.99174577,0 L71,0 L71,10.6452381 C71,16.5244408 66.2312425,21.2904762 60.3513837,21.2904762 L0,21.2904762 L0,2.00295631 Z" id="Rectangle-127" fill="#E0E4E7"></path>
|
||||
<text id="manager-node" font-family="OpenSans, Open Sans" font-size="8" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="6" y="14">manager node</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
<g id="app" transform="translate(1.000000, 79.000000)">
|
||||
<rect id="Rectangle-138" fill="#A1CFE8" x="0" y="0" width="95" height="22" rx="2"></rect>
|
||||
<text id="UCP" font-family="OpenSans, Open Sans" font-size="10" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="38.1953125" y="15">UCP</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<rect id="node-border" stroke="#E0E4E7" stroke-width="2" x="0" y="0" width="97" height="102" rx="2"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="load-balancer" transform="translate(107.000000, 59.000000)">
|
||||
<g id="lb">
|
||||
<rect id="Rectangle-138" fill="#445D6E" x="0" y="0" width="527" height="22" rx="2"></rect>
|
||||
<text id="HTTP-routing-mesh" font-family="OpenSans, Open Sans" font-size="10" font-weight="normal" fill="#FFFFFF">
|
||||
<tspan x="218.33504" y="15">HTTP routing mesh</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<g id="arrow-copy-2" transform="translate(477.500000, 32.500000) scale(1, -1) rotate(-90.000000) translate(-477.500000, -32.500000) translate(465.500000, 28.500000)">
|
||||
<path d="M2,4 L24,4" id="Line" stroke="#445D6E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<g id="Oval">
|
||||
<use fill="#445D6E" fill-rule="evenodd" xlink:href="#path-1"></use>
|
||||
<use stroke="#F7F8F9" mask="url(#mask-2)" stroke-width="4" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
</g>
|
||||
<g id="arrow-copy-3" transform="translate(370.500000, 32.500000) scale(1, -1) rotate(-90.000000) translate(-370.500000, -32.500000) translate(358.500000, 28.500000)">
|
||||
<path d="M2,4 L24,4" id="Line" stroke="#E0E4E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<g id="Oval">
|
||||
<use fill="#E0E4E7" fill-rule="evenodd" xlink:href="#path-3"></use>
|
||||
<use stroke="#F7F8F9" mask="url(#mask-4)" stroke-width="4" xlink:href="#path-3"></use>
|
||||
</g>
|
||||
</g>
|
||||
<g id="arrow-copy-4" transform="translate(263.500000, 32.500000) scale(1, -1) rotate(-90.000000) translate(-263.500000, -32.500000) translate(251.500000, 28.500000)">
|
||||
<path d="M2,4 L24,4" id="Line" stroke="#E0E4E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<g id="Oval">
|
||||
<use fill="#E0E4E7" fill-rule="evenodd" xlink:href="#path-5"></use>
|
||||
<use stroke="#F7F8F9" mask="url(#mask-6)" stroke-width="4" xlink:href="#path-5"></use>
|
||||
</g>
|
||||
</g>
|
||||
<g id="arrow-copy-5" transform="translate(156.500000, 32.500000) scale(1, -1) rotate(-90.000000) translate(-156.500000, -32.500000) translate(144.500000, 28.500000)">
|
||||
<path d="M2,4 L24,4" id="Line" stroke="#E0E4E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<g id="Oval">
|
||||
<use fill="#E0E4E7" fill-rule="evenodd" xlink:href="#path-7"></use>
|
||||
<use stroke="#F7F8F9" mask="url(#mask-8)" stroke-width="4" xlink:href="#path-7"></use>
|
||||
</g>
|
||||
</g>
|
||||
<g id="arrow-copy-6" transform="translate(49.500000, 32.500000) scale(1, -1) rotate(-90.000000) translate(-49.500000, -32.500000) translate(37.500000, 28.500000)">
|
||||
<path d="M2,4 L24,4" id="Line" stroke="#E0E4E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<g id="Oval">
|
||||
<use fill="#E0E4E7" fill-rule="evenodd" xlink:href="#path-9"></use>
|
||||
<use stroke="#F7F8F9" mask="url(#mask-10)" stroke-width="4" xlink:href="#path-9"></use>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="user" transform="translate(306.000000, 4.000000)" fill="#82949E">
|
||||
<text id="wordpress.example.or" font-family="OpenSans-Semibold, Open Sans" font-size="10" font-weight="500">
|
||||
<tspan x="0.0424804688" y="42">wordpress.example.org:80</tspan>
|
||||
</text>
|
||||
<path d="M64,13 C67.59125,13 70.5,10.083125 70.5,6.5 C70.5,2.90875 67.59125,0 64,0 C60.40875,0 57.5,2.90875 57.5,6.5 C57.5,10.083125 60.40875,13 64,13 L64,13 Z M64,16.25 C59.669375,16.25 51,18.419375 51,22.75 L51,26 L77,26 L77,22.75 C77,18.419375 68.330625,16.25 64,16.25 L64,16.25 Z" id="Shape"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 74 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 265 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 259 KiB |
|
|
@ -1,217 +0,0 @@
|
|||
---
|
||||
title: Use domain names to access services
|
||||
description: Learn how to configure your services to make them accessible using a hostname instead of IP addresses and ports.
|
||||
keywords: ucp, services, http, dns, https, routing
|
||||
---
|
||||
|
||||
You can make it easier for users to access your HTTP and HTTPS services by
|
||||
making them accessible from a domain name, instead of an IP address.
|
||||
|
||||

|
||||
|
||||
In this example, we're going to deploy a WordPress service and make it accessible
|
||||
to users at `http://wordpress.example.org`.
|
||||
|
||||
## Enable the HTTP routing mesh
|
||||
|
||||
Before you start, make sure an administrator user has enabled the HTTP routing
|
||||
mesh service You also need permissions to attach services to the `ucp-hrm` network.
|
||||
|
||||
## Deploy WordPress
|
||||
|
||||
Log in to the UCP web UI, navigate to the **Services** page, and click
|
||||
**Create Service**. Then create a WordPress service with the following
|
||||
configuration:
|
||||
|
||||
| Field | Value |
|
||||
|:-------------|:-----------------|
|
||||
| Service name | wordpress |
|
||||
| Image name | wordpress:latest |
|
||||
|
||||
In the left pane, click **Network**. In the **Ports** section, click **Publish Port**
|
||||
and assign the following values.
|
||||
|
||||
|
||||
| Field | Value |
|
||||
|:--------------|:--------|
|
||||
| Internal port | 80 |
|
||||
| Protocol | tcp |
|
||||
| Publish Mode | ingress |
|
||||
| Public port | 8000 |
|
||||
|
||||
Click **Add Hostname based routes** and assign the routing values.
|
||||
|
||||
| Field | Value |
|
||||
|:------------------|:----------------------|
|
||||
| External scheme | http:// |
|
||||
| Routing mesh host | wordpress.example.com |
|
||||
|
||||
Finally, you need to connect the service to the `ucp-hrm` network. This is
|
||||
what ensures traffic sent to the HTTP routing mesh is redirected to your
|
||||
service. In the **Networks** section, click **Attach Network** and select
|
||||
`ucp-hrm` from the dropdown list.
|
||||
|
||||
When creating the service, make sure to publish both internal and public ports.
|
||||
This example maps the port 80 on the container running the service, to port 8000
|
||||
on the ingress routing mesh.
|
||||
|
||||
{: .with-border}
|
||||
|
||||
Click **Confirm** to assign the network configuration, and click **Create**
|
||||
to deploy your service. Once the service is deployed, the HTTP routing mesh
|
||||
service is reconfigured to redirect HTTP requests with the hostname set to
|
||||
`wordpress.example.org`, to the WordPress service.
|
||||
|
||||
## Add a DNS entry
|
||||
|
||||
Now that WordPress is deployed, add a new DNS entry that maps
|
||||
`wordpress.example.org` to the IP address of any node in the UCP cluster.
|
||||
When testing locally, you can also change your `/etc/hosts` file to
|
||||
create this mapping, instead of using a DNS service.
|
||||
|
||||
Once this is done, you can access the wordpress service from your browser.
|
||||
|
||||
{: .with-border}
|
||||
|
||||
## From the CLI
|
||||
|
||||
To deploy the WordPress service from the CLI, you need to add labels to the
|
||||
service that are specific to the HTTP routing mesh.
|
||||
|
||||
Once you get your [UCP client bundle](../access-ucp/cli-based-access.md), you
|
||||
can run:
|
||||
|
||||
```none
|
||||
docker service create \
|
||||
--publish target=80,published=8000 \
|
||||
--network ucp-hrm \
|
||||
--label com.docker.ucp.mesh.http=external_route=http://wordpress.example.org,internal_port=80 \
|
||||
--name wordpress \
|
||||
wordpress:latest
|
||||
```
|
||||
|
||||
## Under the hood
|
||||
|
||||
Under the hood, UCP relies on labels to configure your services to use the
|
||||
HTTP routing mesh. The UCP web UI automatically adds labels to your services,
|
||||
but when deploying from the CLI or using compose files, you need to add labels
|
||||
to your services.
|
||||
|
||||
The HTTP routing mesh can route to a service, as long as that service:
|
||||
|
||||
* Is attached to a network that has the `com.docker.ucp.mesh.http` label.
|
||||
You can use the default `ucp-hrm` network or create your own.
|
||||
* Has one or more labels with the prefix `com.docker.ucp.mesh.http`, specifying
|
||||
the ports to route to.
|
||||
|
||||
### Service labels
|
||||
|
||||
The HTTP routing mesh label that you apply to your services needs to have a list
|
||||
of keys and values separated by a comma, specifying how to route the traffic to
|
||||
your service.
|
||||
|
||||
The label for the WordPress service you just created looks like this:
|
||||
|
||||
- Key: `com.docker.ucp.mesh.http.80-1`
|
||||
- Value: `internal_port=8000,external_route=http://wordpress.example.com`
|
||||
|
||||
The label syntax looks like this:
|
||||
|
||||
```none
|
||||
com.docker.ucp.mesh.http[.label-number]=<key-1>=<value-1>,<key-2>=<value-2>
|
||||
```
|
||||
|
||||
Where `.label-number` is an optional number that you can include in your label
|
||||
name if you want to have multiple routes to the same service. As an example
|
||||
you could have one route for HTTP and another for HTTPS. In that case you'd
|
||||
apply two labels:
|
||||
|
||||
```none
|
||||
com.docker.ucp.mesh.http.1=<key-1>=<value-1>
|
||||
com.docker.ucp.mesh.http.2=<key-1>=<value-1>
|
||||
```
|
||||
|
||||
The keys and values in your label are what defined the route configuration.
|
||||
These keys are supported:
|
||||
|
||||
| Key | Mandatory | Values | Description |
|
||||
|:----------------------|:---------------------------------------------------------|:------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------|
|
||||
| external_route | yes | http://domain-name, http://domain-name/path, or sni://domain-name | The external URL to route to this service |
|
||||
| internal_port | yes, if the service publishes no ports or multiple ports | port-number | The internal port to use for the service |
|
||||
| sticky_sessions | no | cookie-name | Always route a user to the same service, using HTTP cookies. This option can't be used with HTTPS routes |
|
||||
| redirect | no | http://domain-name, or sni://domain-name | Redirect incoming requests to another route using an HTTP 301 redirect |
|
||||
| include_forwarded_for | no | true | If present, include the X-Forwarded-For header in requests |
|
||||
|
||||
|
||||
### Sticky sessions
|
||||
|
||||
You can use the `sticky_sessions` value to always route a user to the same
|
||||
backend service. The first time a user makes a request, the service includes
|
||||
a cookie in the response. When the user makes a new request, their browser
|
||||
will send the cookie, and the HTTP routing mesh can use it to decide to which
|
||||
service to route to.
|
||||
|
||||
Since this requires the HTTP routing mesh to be able to read the cookie, this
|
||||
option only works with HTTP routes.
|
||||
|
||||
Sticky sessions might stop temporarily if the service is reconfigured to
|
||||
change the number of replicas, or if the replicas are restarted.
|
||||
|
||||
### HTTP redirects
|
||||
|
||||
You can use the `redirect` option to redirect requests from one route to
|
||||
another.
|
||||
|
||||
This allows you to redirect traffic to a new domain name if you've renamed the
|
||||
domain you're using to serve your services. For that, you apply two labels to
|
||||
your service:
|
||||
|
||||
```none
|
||||
com.docker.ucp.mesh.http.1=external_route=http://old.example.org,redirect=http://new.example.org
|
||||
com.docker.ucp.mesh.http.2=external_route=http://new.example.org
|
||||
```
|
||||
|
||||
You can also use this to redirect HTTP requests to an HTTPS route. For that you
|
||||
apply two labels to your service:
|
||||
|
||||
```none
|
||||
com.docker.ucp.mesh.http.1=external_route=http://example.org,redirect=https://example.org
|
||||
com.docker.ucp.mesh.http.2=external_route=sni://example.org
|
||||
```
|
||||
|
||||
### X-Forwarded-For header
|
||||
|
||||
Because HRM forwards traffic to your application, the requests that your application receives will all appear to come from HRM's IP address. If you add `include_forwarded_for=true` in the HRM label for your service, HRM will add an HTTP header to every request called `X-Forwarded-For` that will contain the IP address that the original request came from. Note that this feature will only work if your external_route field begins with `http://`.
|
||||
|
||||
### Default Service
|
||||
|
||||
If you want a particular service to serve all requests that don't match an otherwise defined `external_route`, set an `external_route` to a blank hostname. For example:
|
||||
|
||||
```none
|
||||
com.docker.ucp.mesh.http.1=external_route=http://
|
||||
com.docker.ucp.mesh.http.2=external_route=sni://
|
||||
```
|
||||
|
||||
If you don't define `external_route=sni://` on any service, HRM will default to use the UCP controller itself as the default SNI route. If you don't define `external_route=http://` on any service, HRM will return an http 503 error.
|
||||
|
||||
### Keep services isolated
|
||||
|
||||
If you want to keep the services from sharing the same network, before
|
||||
enabling the HTTP routing mesh:
|
||||
|
||||
1. Create multiple networks and apply the `com.docker.ucp.mesh.http` label to them
|
||||
2. Enable the HTTP routing mesh
|
||||
3. Attach each service to one of the different networks you've created
|
||||
|
||||
The HTTP routing mesh will route to all services in these networks, but services
|
||||
on different networks can't communicate directly.
|
||||
|
||||
When using a UCP client bundle for an admin user, or a user with administrator privileges,
|
||||
you can create an overlay network that contains the `com.docker.mesh.http` label by running the following command.
|
||||
|
||||
```none
|
||||
docker network create -d overlay --label com.docker.ucp.mesh.http=true new-hrm-network
|
||||
```
|
||||
|
||||
If you're creating a a new HRM network you need to disable the HRM service first, or disable
|
||||
and enable the HRM service after you create the network else HRM will not be available on new network.
|
||||
Loading…
Reference in New Issue