Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/ce 470 locality aware #19071

Merged
merged 20 commits into from
Oct 6, 2023
Merged

Docs/ce 470 locality aware #19071

merged 20 commits into from
Oct 6, 2023

Conversation

trujillo-adam
Copy link
Contributor

@trujillo-adam trujillo-adam commented Oct 5, 2023

Description

This PR applies the following updates:

  • new params on configuration references pages for enabling locality-aware routing
  • Adds a usage page for routing to local upstreams
  • Updates related overview page,
  • Updates the navigation around traffic management

This PR also includes documentation updates for service-to-service rate limiting.

Links

Google doc draft

Jira tickets:

PR Checklist

  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@trujillo-adam trujillo-adam added type/docs Documentation needs to be created/updated/clarified pr/no-changelog PR does not need a corresponding .changelog entry pr/no-metrics-test pr/no-backport labels Oct 5, 2023
@trujillo-adam trujillo-adam marked this pull request as ready for review October 5, 2023 21:16
@trujillo-adam trujillo-adam requested a review from a team as a code owner October 5, 2023 21:16
@trujillo-adam trujillo-adam marked this pull request as draft October 5, 2023 21:18
@trujillo-adam trujillo-adam marked this pull request as ready for review October 5, 2023 22:50
Copy link
Contributor

@kisunji kisunji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some minor comments and fixes. Thank you for this work!

Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Copy link
Contributor

@boruszak boruszak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work here - I think most of my comments are simple style guide alignments and corrections that you can accept suggestions for.

Big callout - You changed the l7-traffic path to manage-traffic but there aren't any redirects in this PR. Create a folder-level redirect before merging this PR.

Approving on behalf of consul-docs so that you're not blocked. Let me know if you need anything else!

Copy link
Contributor

@kisunji kisunji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still a few floating comments from me but pre-approving from eng side for rate limiting

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
@trujillo-adam trujillo-adam merged commit a9747dc into main Oct 6, 2023
48 checks passed
@trujillo-adam trujillo-adam deleted the docs/CE-470-locality-aware branch October 6, 2023 19:48
Comment on lines +660 to +663
{
"title": "Service intentions",
"href": "/consul/docs/connect/config-entries/service-intentions"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this didn't change from before, but do you know why intentions under failover?


### `RateLimits{}.InstanceLevel{}.RequestsPerScond`

Specifies the average number of requests per second allowed to the service. Consul allows requests to the service when the average number of requests per second exceeds this value, but it temporarily lowers the speed of the transactions. You may also specify the [`RequestsMaxBurst`](#ratelimits-instancelevel-requestsmaxburst) parameter. The number of requests per second to the service can exceed the limit specified in the `RequestsPerSecond` parameter, but not the `RequestsMaxBurst` parameter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this "temporarily lowers the speed of the transactions". From my understanding, it proceeds as normal until the bucket is exhausted.

1. Enable service mesh proxies to route traffic locally within the partition.
1. Start service mesh proxies.

For Kubernetes-orchestrated networks, Consul automatically populates geographic information about service instances using the `topology.kubernetes.io/region` and `topology.kubernetes.io/zone` annotations from the Kubernetes nodes. As a result, you do not need to specify the regions and zones unless you are implementing a custom Kuberenetes deployment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do something similar on the upcoming version of consul-ecs too.

}
```

## Specify the localities of your service instances
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only support running consul-dataplane on consul-k8s and consul-ecs. I think it might be safe to remove this section.

### Configure routing behavior for individual service

1. Create a service resolver configuration entry and specify the following fields:
- `Name`: Specify the name of the service that the routing behavior defined in the configuration entry applies to.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this does the opposite. This is the name of the service that is opting into locality aware routing. This causes downstream services to use locality aware routing when calling this service.


For details about operating an Envoy proxy in Consul, refer to the [Envoy proxy reference](/consul/docs/connect/proxies/envoy).

Use the `/agent/service/register` API endpoint to register sidecars independently from their application services. You must include the `locality` configuration in the payload. Refer to [Register Service](/consul/api-docs/agent/service#register-service) in the API documentation for additional information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this referring to?

By default, Consul balances traffic to all healthy upstream instances in the cluster, even if the instances are in different network zones. You can specify the cloud service provider (CSP) locale for Consul server agents and services registered to the service mesh, which enables several benefits:

- Consul prioritizes the nearest upstream when routing traffic through the mesh.
- When a service instance in the same partition becomes unhealthy, Consul prioritizes failing over to upstream services that are in the same region as the downstream service. Refer to [Failover](/consul/docs/connect/traffic-management/failover) for additional information about failover strategies in Consul.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- When a service instance in the same partition becomes unhealthy, Consul prioritizes failing over to upstream services that are in the same region as the downstream service. Refer to [Failover](/consul/docs/connect/traffic-management/failover) for additional information about failover strategies in Consul.
- When upstream service instances become unhealthy, Consul prioritizes failing over to instances that are in the same region as the downstream service. Refer to [Failover](/consul/docs/connect/traffic-management/failover) for additional information about failover strategies in Consul.

I think it might be clearer to refer to these in plural since currently, we don't support partial failover, and in general, any future change to support that would be in terms of a ratio, not individual instances.


1. Specify the region and zone for your Consul client agents.
1. It is not required, but you can specify the region and zone for your services. Skip this step to allow services to inherit the region and zone configured for the Consul client that the services are registered with.
1. Enable service mesh proxies to route traffic locally within the partition.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Enable service mesh proxies to route traffic locally within the partition.
1. Configure service mesh proxies to route traffic locally within the partition based on locality configuration.

1. Enable service mesh proxies to route traffic locally within the partition.
1. Start service mesh proxies.

For Kubernetes-orchestrated networks, Consul automatically populates geographic information about service instances using the `topology.kubernetes.io/region` and `topology.kubernetes.io/zone` annotations from the Kubernetes nodes. As a result, you do not need to specify the regions and zones unless you are implementing a custom Kuberenetes deployment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For Kubernetes-orchestrated networks, Consul automatically populates geographic information about service instances using the `topology.kubernetes.io/region` and `topology.kubernetes.io/zone` annotations from the Kubernetes nodes. As a result, you do not need to specify the regions and zones unless you are implementing a custom Kuberenetes deployment.
For Kubernetes-orchestrated networks, Consul automatically populates geographic information about service instances using the `topology.kubernetes.io/region` and `topology.kubernetes.io/zone` annotations from the Kubernetes nodes. As a result, you do not need to specify the regions and zones unless you are implementing a custom Kubernetes deployment.

In addition to Eric's comment, small typo here.


## Start the proxies in your datacenter

Envoy requires a bootstrap configuration file before it can start. Use the [`consul connect envoy` command](/consul/commands/connect/envoy) to create the Envoy bootstrap configuration and start the sidecar proxy service. Specify the ID of the sidecar proxy you want to start with the `-sidecar-for` option.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Envoy requires a bootstrap configuration file before it can start. Use the [`consul connect envoy` command](/consul/commands/connect/envoy) to create the Envoy bootstrap configuration and start the sidecar proxy service. Specify the ID of the sidecar proxy you want to start with the `-sidecar-for` option.
Envoy requires a bootstrap configuration file before it can start. Use the [`consul connect envoy` command](/consul/commands/connect/envoy) to create the Envoy bootstrap configuration and start the sidecar proxy service. Specify the ID of service you want to start a proxy for using the `-sidecar-for` option.


Envoy requires a bootstrap configuration file before it can start. Use the [`consul connect envoy` command](/consul/commands/connect/envoy) to create the Envoy bootstrap configuration and start the sidecar proxy service. Specify the ID of the sidecar proxy you want to start with the `-sidecar-for` option.

The following example command starts an Envoy proxy for the `web` proxy service:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following example command starts an Envoy proxy for the `web` proxy service:
The following example command starts an Envoy proxy for the `web` service:

$ consul config write web-resolver.hcl
```

## Start the proxies in your datacenter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the advice to set client locality above (or defer to K8s/ECS), similar to @erichaberkorn 's comment above, I'm not certain we really need this section, since how to start and manage proxies is already documented in other pages, and assumed for a mesh deployment.

jmurret pushed a commit that referenced this pull request Oct 12, 2023
* updated nav; renamed L7 traffic folder

* Added locality-aware routing to traffic mgmt overview

* Added route to local upstreams topic

* Updated agent configuration reference

* Added locality param to services conf ref

* Added locality param to conf entries

* mentioned traffic management in proxies overview

* added locality-aware to failover overview

* added docs for service rate limiting

* updated service defaults conf entry

* Apply suggestions from code review

Co-authored-by: Chris S. Kim <ckim@hashicorp.com>

* Apply suggestions from code review

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>

* updated links and added redirects

---------

Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry pr/no-metrics-test type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants