forked from hashicorp/consul
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport of NET-4952 Add docs for export command into release/1.16.x (h…
…ashicorp#18449) * backport of commit d6d0450 * backport of commit 39feb99 * backport of commit 8b1398a * backport of commit 47b9c12 * backport of commit db8d974 * backport of commit f64e808 * backport of commit 6b6dbb4 * backport of commit 2e34721 * backport of commit 2d52b0c --------- Co-authored-by: Nathan Coleman <[email protected]>
- Loading branch information
1 parent
232f0f6
commit 08c47c9
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
layout: commands | ||
page_title: 'Commands: Services Export' | ||
description: | | ||
The `consul services export` command exports a service from one peer or admin partition to another. | ||
--- | ||
|
||
# Consul Services Export | ||
|
||
Command: `consul services export` | ||
|
||
The `services export` command exports a service from one admin partition | ||
or cluster peer to another. This command can be used in lieu of creating or updating the corresponding | ||
`exported-services` configuration entry. Running the command multiple times with the same | ||
arguments results in a no-op. | ||
|
||
```text | ||
Usage: consul services export [options] -name <service name> -consumer-peers <other cluster name> | ||
Export a service to a peered cluster. | ||
$ consul services export -name=web -consumer-peers=other-cluster | ||
Use the -consumer-partitions flag instead of -consumer-peers to export to a different partition in the same cluster. | ||
$ consul services export -name=web -consumer-partitions=other-partition | ||
Additional flags and more advanced use cases are detailed below. | ||
``` | ||
|
||
#### Command options | ||
|
||
- `-name=<string>` - (Required) The name of the service to export. | ||
|
||
- `-consumer-peers=<string>` - (Required) A comma-separated list of cluster peers to export the service to. | ||
In Consul Enterprise, this flag is optional when `-consumer-partitions` is specified. | ||
|
||
#### Enterprise options | ||
|
||
- `-consumer-partitions=<string>` - A comma-separated list of admin partitions within the | ||
same datacenter to export the service to. This flag is optional when `-consumer-peers` is specified. | ||
|
||
@include 'http_api_partition_options.mdx' | ||
|
||
@include 'http_api_namespace_options.mdx' | ||
|
||
#### API options | ||
|
||
@include 'http_api_options_client.mdx' | ||
|
||
## Examples | ||
|
||
In the following example, the `consul services export` command makes the `web` service available to services running in a cluster named `dc2` that has a previously-established cluster peering connection. | ||
|
||
```shell-session hideClipboard | ||
$ consul services export -name=web -consumer-peers=dc2 | ||
``` | ||
|
||
In the following example, the `consul services export` command makes the `web` service located in the | ||
namespace `ns1` and the admin partition `alpha` to other admin partitions named `beta` and `delta`. | ||
|
||
```shell-session hideClipboard | ||
$ consul services export -name=web -namespace=ns1 -partition=alpha -consumer-partitions=beta,delta | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters