Skip to content

Commit

Permalink
tweaks to titles and phrasing
Browse files Browse the repository at this point in the history
  • Loading branch information
trujillo-adam committed Feb 1, 2023
1 parent a64c481 commit db97967
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Larger integer values increase the weight state. Services have the following def
- `"passing" : 1`
- `"warning" : 1`

Services in a `critical` state are excluded from DNS responses by default. Services with `warning` checks are included in responses by default. Refer to [Enable Static DNS Queries](/consul/docs/services/discovery/dns-static-lookups) for additional information.
Services in a `critical` state are excluded from DNS responses by default. Services with `warning` checks are included in responses by default. Refer to [Perform Static DNS Queries](/consul/docs/services/discovery/dns-static-lookups) for additional information.

In the following example, service instances in a `passing` state respond to DNS SRV requests, while instances in a `critical` instance can still respond at a lower frequency:

Expand Down
57 changes: 30 additions & 27 deletions website/content/docs/services/discovery/dns-dynamic-lookups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: ->
---

# Enable Dynamic Queries DNS Queries
This topic describes how to dynamically query the Consul catalog using prepared queries. Prepared queries are configurations that enable you to register a complex service query and execute it on demand. For information about how to perform standard node and service lookups, refer to [Enable Static DNS Queries](/consul/docs/services/discovery/dns-static-lookups).
This topic describes how to dynamically query the Consul catalog using prepared queries. Prepared queries are configurations that enable you to register a complex service query and execute it on demand. For information about how to perform standard node and service lookups, refer to [Perform Static DNS Queries](/consul/docs/services/discovery/dns-static-lookups).

## Introduction
Prepared queries provide a rich set of lookup features, such as filtering by multiple tags and automatically failing over to look for services in remote datacenters if no healthy nodes are available in the local datacenter. You can also create prepared query templates that match names using a prefix match, allowing a single template to apply to potentially many services. Refer to [Query Consul Nodes and Services Overview](/consul/docs/services/discovery/dns-overview) for additional information about DNS query behaviors.
Expand All @@ -26,45 +26,48 @@ Refer to the [prepared query reference](/consul/api-docs/query#create-prepared-q

1. Specify the prepared query options in JSON format. The following prepared query targets all instances of the `redis` service in `dc1` and `dc2`:

```json
{
"Name": "my-query",
"Session": "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
"Token": "",
```json
{
"Name": "my-query",
"Session": "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
"Token": "",
"Service": {
"Service": "redis",
"Failover": {
"Service": "redis",
"Failover": {
"NearestN": 3,
"Datacenters": ["dc1", "dc2"]
},
"Near": "node1",
"OnlyPassing": false,
"Tags": ["primary", "!experimental"],
"NodeMeta": {
"instance_type": "m3.large"
},
"Near": "node1",
"OnlyPassing": false,
"Tags": ["primary", "!experimental"],
"NodeMeta": { "instance_type": "m3.large" },
"ServiceMeta": { "environment": "production" }
},
"ServiceMeta": {
"environment": "production"
}
},
"DNS": {
"TTL": "10s"
}
}

```
"TTL": "10s"
}
}
```

Refer to the [prepared query configuration reference](/consul/api-docs/query#create-prepared-query) for information about all available options.

1. Send the query in a POST request to the [`/query` API endpoint](/consul/api-docs/query). If the request is successful, Consul prints an ID for the prepared query.

In the following example, the prepared query configuration is stored in the `payload.json` file:
In the following example, the prepared query configuration is stored in the `payload.json` file:

```shell-session
$ curl --request POST --data @payload.json http://127.0.0.1:8500/v1/query
{"ID":"014af5ff-29e6-e972-dcf8-6ee602137127"}%
```
```shell-session
$ curl --request POST --data @payload.json http://127.0.0.1:8500/v1/query
{"ID":"014af5ff-29e6-e972-dcf8-6ee602137127"}%
```
1. To run the query, send a GET request to the endpoint and specify the ID returned from the POST call.

```shell-session
$ curl http://127.0.0.1:8500/v1/query/14af5ff-29e6-e972-dcf8-6ee602137127/execute\?near\=_agent
```
```shell-session
$ curl http://127.0.0.1:8500/v1/query/14af5ff-29e6-e972-dcf8-6ee602137127/execute\?near\=_agent
```

## Execute prepared queries
You can execute a prepared query using the standard lookup format or the strict RFC 2782 SRV lookup.
Expand Down
10 changes: 5 additions & 5 deletions website/content/docs/services/discovery/dns-overview.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
layout: docs
page_title: Discover Consul Nodes and Services Overview
page_title: DNS Usage Overview
description: >-
For service discovery use cases, Domain Name Service (DNS) is the main interface to look up, query, and address Consul nodes and services. Learn how a Consul DNS lookup can help you find services by tag, name, namespace, partition, datacenter, or domain.
---

# Discover Consul Nodes and Services Overview
# DNS Usage Overview

This topic provides overview information about how to discover Consul nodes and services.
This topic provides overview information about how to look up Consul nodes and services using the Consul DNS.

## Consul DNS
The primary interface for discovering services registered in the Consul catalog is the Consul DNS. The DNS enables you to look up services and nodes registered with Consul using terminal commands instead of making HTTP API requests to Consul.
Expand Down Expand Up @@ -35,7 +35,7 @@ Node lookups and service lookups are the fundamental types of static queries. De

Consul relies on a very specific format for queries to resolve names. Note that all queries are case-sensitive.

Refer to [Use Static Lookups](/consul/docs/services/usage/query-nodes-and-services/static-lookups) for details about how to perform node and service lookups.
Refer to [Perform Static DNS Lookups](/consul/docs/services/discovery/dns-static-lookups) for details about how to perform node and service lookups.

## Prepared queries
Prepared queries are configurations that enable you to register complex DNS queries. They provide lookup features that extend Consul's service discovery capabilities, such as filtering by multiple tags and automatically querying remote datacenters for services if no healthy nodes are available in the local datacenter. You can also create prepared query templates that match names using a prefix match, allowing a single template to apply to potentially many services. Refer to [Perform Dynamic DNS Queries]() for additional information.
Prepared queries are configurations that enable you to register complex DNS queries. They provide lookup features that extend Consul's service discovery capabilities, such as filtering by multiple tags and automatically querying remote datacenters for services if no healthy nodes are available in the local datacenter. You can also create prepared query templates that match names using a prefix match, allowing a single template to apply to potentially many services. Refer to [Enable Dynamic DNS Queries](/consul/docs/services/discovery/dns-dynamic-lookups) for additional information.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
layout: docs
page_title: Enable Static DNS Queries
page_title: Perform Static DNS Queries
description: ->
Learn how to use standard Consul DNS lookup formats to enable service discovery for services and nodes.
---

# Enable Static DNS Queries
# Perform Static DNS Queries
This topic describes how to query the Consul DNS to look up nodes and services registered with Consul. Refer to [Enable Dynamic DNS Queries](/consul/docs/services/discovery/dns-dynamic-lookups) for information about using prepared queries.

## Introduction
Node lookups and service lookups are the fundamental types of queries you can perform using the Consul DNS. Node lookups interrogate the catalog for named Consul agents. Service lookups interrogate the catalog for services registered with Consul. Refer to [Discover Consul Nodes and Services Overivew](/consul/docs/services/discovery/dns-overview) for additional background information.
Node lookups and service lookups are the fundamental types of queries you can perform using the Consul DNS. Node lookups interrogate the catalog for named Consul agents. Service lookups interrogate the catalog for services registered with Consul. Refer to [DNS Usage Overivew](/consul/docs/services/discovery/dns-overview) for additional background information.

## Requirements
All versions of Consul support DNS lookup features.
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/services/services.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For service discovery, the core Consul workflow for services consists of three s

1. **Register services and health checks**: After defining your services and health checks, you must register them with a Consul agent. Refer to [Register Services and Health Checks](/consul/docs/services/usage/register-services-checks) for additional information.

1. **Discover services**: After registering your services and health checks, other services in your network can use the DNS to perform static or dynamic lookups to access your service. Refer to [Discover Consul Nodes and Services Overview](/consul/docs/services/discovery/dns-overview) for additional information about the different ways to discover services in your datacenters.
1. **Query for services**: After registering your services and health checks, other services in your network can use the DNS to perform static or dynamic lookups to access your service. Refer to [DNS Usage Overview](/consul/docs/services/discovery/dns-overview) for additional information about the different ways to discover services in your datacenters.


## Service mesh use cases
Expand Down
6 changes: 3 additions & 3 deletions website/data/docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,18 @@
]
},
{
"title": "Discover",
"title": "Service Discovery",
"routes": [
{
"title": "Overview",
"title": "DNS Usage Overview",
"path": "services/discovery/dns-overview"
},
{
"title": "Configure Consul DNS Behavior",
"path": "services/discovery/dns-configuration"
},
{
"title": "Enable Static DNS Lookups",
"title": "Perform Static DNS Lookups",
"path": "services/discovery/dns-static-lookups"
},
{
Expand Down

0 comments on commit db97967

Please sign in to comment.