Browse Source

tweaks to the language used in the requirements section

pull/11945/head
trujillo-adam 3 years ago
parent
commit
2ff5f50e8c
  1. 78
      website/content/docs/connect/config-entries/exported-services.mdx

78
website/content/docs/connect/config-entries/exported-services.mdx

@ -10,29 +10,28 @@ description: >-
<EnterpriseAlert /> <EnterpriseAlert />
This topic describes the `exported-services` configuration entry type. The `exported-services` configuration entry enables Consul to export service instances to other admin partitions from a single file. This enables your services to be networked across admin partitions. See [Admin Partitions](/docs/enterprise/admin-partitions) for additional information. This topic describes the `exported-services` configuration entry type. The `exported-services` configuration entry enables Consul to export service instances to other admin partitions from a single file. This enables your services to be networked across admin partitions. See [Admin Partitions](/docs/enterprise/admin-partitions) for additional information.
-> **v1.11.0+:** This config entry is supported in Consul Enterprise versions 1.11.0+. -> **v1.11.0+:** This config entry is supported in Consul Enterprise versions 1.11.0+.
## Introduction ## Introduction
You can configure Consul to export services contained in an admin partition to one or more additional partitions by declaring the `exported-services` configuration entry in the `kind` field. This enables you to route traffic between services in different clusters that share a single set of Consul servers. You can configure Consul to export services contained in an admin partition to one or more additional partitions by declaring the `exported-services` configuration entry in the `kind` field. This enables you to route traffic between services in different clusters that share a single set of Consul servers.
You can configure the settings defined in the `exported-services` configuration entry to apply to all namespaces and federated datacenters. You can configure the settings defined in the `exported-services` configuration entry to apply to all namespaces and federated datacenters.
## Requirements ## Requirements
* A Consul Enterprise binary - A Consul Enterprise binary
* A partition that corresponds to the configuration entry. As in, the exported services config entry for partition "frontend" requires that the "frontend" partition exists - A corresponding partition that the configuration entry can export to. For example, the `exported-services` configuration entry for a partition named `frontend` requires an existing `frontend` partition.
## Usage ## Usage
1. Verify that your datacenter meets the conditions specified in the [Requirements](#requirements). 1. Verify that your datacenter meets the conditions specified in the [Requirements](#requirements).
1. Specify the `exported-services` configuration in the agent configuration file (see [`config_entries`](/docs/agent/options#config_entries)) as described in [Configuration](#configuration). 1. Specify the `exported-services` configuration in the agent configuration file (see [`config_entries`](/docs/agent/options#config_entries)) as described in [Configuration](#configuration).
1. Apply the configuration using one of the following methods: 1. Apply the configuration using one of the following methods:
* Kubernetes CRD: Refer to the [Custom Resource Definitions](/docs/k8s/crds) documentation for details. - Kubernetes CRD: Refer to the [Custom Resource Definitions](/docs/k8s/crds) documentation for details.
* Issue the `consul config write` command: Refer to the [Consul Config Write](/commands/config/write) documentation for details. - Issue the `consul config write` command: Refer to the [Consul Config Write](/commands/config/write) documentation for details.
## Configuration ## Configuration
@ -48,15 +47,16 @@ Name = "<partition containing services to export>"
Services = [ Services = [
{ {
Name = "<name of service to export>" Name = "<name of service to export>"
Namespace = "<namespace in the partition containing the service to export>" Namespace = "<namespace in the partition containing the service to export>"
Consumers = [ Consumers = [
{ {
Partition = "<name of the partition that will dial the exported service>" Partition = "<name of the partition that will dial the exported service>"
}, },
] ]
} }
] ]
``` ```
</CodeBlockConfig> </CodeBlockConfig>
<CodeBlockConfig> <CodeBlockConfig>
@ -65,13 +65,14 @@ apiVersion: consul.hashicorp.com/v1alpha1
Kind: ExportedServices Kind: ExportedServices
metadata: metadata:
name: <partition containing services to export> name: <partition containing services to export>
spec: spec:
services: services:
- name: <name of service to export> - name: <name of service to export>
namespace: <namespace in the partition containing the service to export> namespace: <namespace in the partition containing the service to export>
consumers: consumers:
- partition: <name of the partition that will dial the exported service> - partition: <name of the partition that will dial the exported service>
``` ```
</CodeBlockConfig> </CodeBlockConfig>
<CodeBlockConfig> <CodeBlockConfig>
@ -91,6 +92,7 @@ spec:
} }
] ]
``` ```
</CodeBlockConfig> </CodeBlockConfig>
</CodeTabs> </CodeTabs>
@ -98,31 +100,31 @@ spec:
The following table describes the parameters associated with the `exported-services` configuration entry. The following table describes the parameters associated with the `exported-services` configuration entry.
| Parameter | Description | Required | Default | | Parameter | Description | Required | Default |
| --- | --- | --- | --- | | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| `Kind` | String value that enables the configuration entry. The value should always be `exported-services` (HCL and JSON) or `ExportedServices` (YAML) | Required | None | | `Kind` | String value that enables the configuration entry. The value should always be `exported-services` (HCL and JSON) or `ExportedServices` (YAML) | Required | None |
| `Partition` | String value that specifies the name of the partition that contains the services you want to export. | Required | None | | `Partition` | String value that specifies the name of the partition that contains the services you want to export. | Required | None |
| `Name` | String value that specifies the name of the partition that contains the services you want to export. | Required | None | | `Name` | String value that specifies the name of the partition that contains the services you want to export. | Required | None |
| `Services` | List of objects that specify which services to export. See [`Services`](#services) for details. | Required | None| | `Services` | List of objects that specify which services to export. See [`Services`](#services) for details. | Required | None |
| `Meta` | Object that defines a map of the max 64 key/value pairs. | Optional | None | | `Meta` | Object that defines a map of the max 64 key/value pairs. | Optional | None |
### Services ### Services
The `Services` parameter contains one or more lists of parameters that specify which services to export, which namespaces the services reside, and the destination partition for the exported services. Each list in the `Services` block must contain the following parameters: The `Services` parameter contains one or more lists of parameters that specify which services to export, which namespaces the services reside, and the destination partition for the exported services. Each list in the `Services` block must contain the following parameters:
* `Name`: Specifies the name of the service to export. You can use a asterisk wildcard (`*`) to include all services in the namespace. - `Name`: Specifies the name of the service to export. You can use a asterisk wildcard (`*`) to include all services in the namespace.
* `Namespace`: Specifies the namespace containing the services to export. You can use a asterisk wildcard (`*`) to include all namespaces in the partition. - `Namespace`: Specifies the namespace containing the services to export. You can use a asterisk wildcard (`*`) to include all namespaces in the partition.
* `Consumers`: Specifies one ore more objects that identify a destination partition for the exported services. - `Consumers`: Specifies one ore more objects that identify a destination partition for the exported services.
## Example ## Example
The following example configures the agent to export the `billing` service from the `default` namespace of the `finance` admin partition to the `frontend` and `backend` partitions. Additionally, all services in all namespaces within the `finance` partition will be exported to the `monitoring` partition. The following example configures the agent to export the `billing` service from the `default` namespace of the `finance` admin partition to the `frontend` and `backend` partitions. Additionally, all services in all namespaces within the `finance` partition will be exported to the `monitoring` partition.
<CodeTabs heading="" tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}> <CodeTabs heading="" tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig> <CodeBlockConfig>
```hcl ```hcl
Kind = "exported-services" Kind = "exported-services"
Partition = "finance" Partition = "finance"
Name = "finance" Name = "finance"
@ -157,19 +159,19 @@ Services = [
```yaml ```yaml
apiVersion: consul.hashicorp.com/v1alpha1 apiVersion: consul.hashicorp.com/v1alpha1
Kind: ExportedServices Kind: ExportedServices
metadata: metadata:
name: finance name: finance
spec: spec:
services: services:
- name: mesh-gateway - name: mesh-gateway
namespace: default namespace: default
consumers: consumers:
- partition: default - partition: default
- name: billing - name: billing
namespace: default namespace: default
consumers: consumers:
- partition: frontend - partition: frontend
- partition: backend - partition: backend
``` ```
</CodeBlockConfig> </CodeBlockConfig>
@ -215,8 +217,8 @@ When an exported service has been imported to another partition, you can use the
$ curl 'localhost:8500/v1/health/connect/billing?partition=finance' $ curl 'localhost:8500/v1/health/connect/billing?partition=finance'
``` ```
An ACL token with `service:write` permissions is required for the partition from which the query is made. If the call in the previous example is made from a service named `web` in a partition named `frontend`, then the request will require a token with `write` permissions to `web` in the `frontend` partition. An ACL token with `service:write` permissions is required for the partition from which the query is made. If the call in the previous example is made from a service named `web` in a partition named `frontend`, then the request will require a token with `write` permissions to `web` in the `frontend` partition.
Exports are available to all services in the consumer partition. In the previous example, any service with `write` permissions for the `frontend` partition will be able to read exports. Exports are available to all services in the consumer partition. In the previous example, any service with `write` permissions for the `frontend` partition will be able to read exports.
See [Health HTTP Endpoint](/api-docs/health) for additional information. See [Health HTTP Endpoint](/api-docs/health) for additional information.

Loading…
Cancel
Save