Skip to content

Conversation

stevenctl
Copy link
Contributor

@stevenctl stevenctl commented Nov 9, 2021

@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Nov 9, 2021
@istio-policy-bot
Copy link

😊 Welcome! This is either your first contribution to the Istio documentation repo, or
it's been awhile since you've been here. A few things you should know:

  • You can learn about how we write and maintain documentation, about our style guidelines,
    and about all the available web site features by visiting Contributing to the Docs.

  • In the next few minutes, an automatic preview of your change will be
    built as a full copy of the istio.io website. You can find this preview by clicking on
    the Details link next to the deploy/netlify entry in the Status section of this
    page.

  • We care about quality, so we've put in place a number of checks to ensure our documentation
    is top notch. We do spell checking, we sanitize the markdown, we ensure all hyperlinks point
    to valid location, and more. If your PR doesn't pass one of these checks, you'll see a red X in the
    status section of the page. Click on the Details link to get a list of the problems with your PR.
    Fix those problems and push an update to your PR. This will automatically rerun the tests and
    hopefully this time everything will be perfect.

  • Once your changes are accepted and merged into the repository, they will initially show up
    on https://preliminary.istio.io. The changes will be published to https://istio.io
    the next time we do a major release (which typically happens every 3 months or so).

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Nov 9, 2021
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 9, 2021
@istio-testing
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

spec:
hosts:
- mysvc.myns.svc.cluster.local
http:
Copy link
Contributor Author

@stevenctl stevenctl Nov 9, 2021

Choose a reason for hiding this comment

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

without sourceLabels support the VS has to be different in each cluster... and doesn't really work for primary-remote

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you still working on the fix? Can this doc wait until that lands?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

istio/istio#35998

It actually already works :)

load-balanced across all clusters in the mesh for a given service. In some cases, that behavior is not desirable, and
this document describes the different options for overriding that default.

## Cluster Local Services
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we also have a section that highlights locality load balancing as an option? and is this header correct?

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 think we actually define cluster-local as a term. Perhaps you could call this something like Keeping traffic in-cluster?

Backing up a bit, the DR section is actually more generic than "cluster-local" anyway. You could use it for any sort of partitioning by label (network, cluster, etc.). Maybe we should frame it like that?

So the outline might be something like:

  1. Keeping traffic in-cluster
  2. Partitioning Service Endpoints (i.e. Subsetting)
  3. Services that are not the same

And the partitioning example could effectively also be a cluster-local example, just doing it a different way. And just explain that it's actually a more flexible tool and can do more than just cluster-local.

test: no
---

Within a multicluster mesh, [namespace sameness](https://github.com/kubernetes/community/blob/master/sig-multicluster/namespace-sameness-position-statement.md)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this the right place for the sameness note? Or should it live in deployment models? Or both?

Copy link
Contributor

Choose a reason for hiding this comment

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

This should definitely go in deployment models. Maybe we need a glossary entry as well for namespace sameness. I'm fine duplicating the link here.

load-balanced across all clusters in the mesh for a given service. In some cases, that behavior is not desirable, and
this document describes the different options for overriding that default.

## Cluster Local Services
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 think we actually define cluster-local as a term. Perhaps you could call this something like Keeping traffic in-cluster?

Backing up a bit, the DR section is actually more generic than "cluster-local" anyway. You could use it for any sort of partitioning by label (network, cluster, etc.). Maybe we should frame it like that?

So the outline might be something like:

  1. Keeping traffic in-cluster
  2. Partitioning Service Endpoints (i.e. Subsetting)
  3. Services that are not the same

And the partitioning example could effectively also be a cluster-local example, just doing it a different way. And just explain that it's actually a more flexible tool and can do more than just cluster-local.

spec:
hosts:
- mysvc.myns.svc.cluster.local
http:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you still working on the fix? Can this doc wait until that lands?


### Per-cluster `Service` or `Namespace`

If `Services` aren't meant to be used cross-cluster at all, it may make sense to simply give them unique names in each
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we come up with a more concrete example for this? I'm having trouble picturing how this is different from cluster-local.

### Keeping traffic in-cluster

In some cases the default cross-cluster load balancing behavior is not desirable. To keep traffic "cluster-local" (i.e.
traffic sent from `cluster-a` will only reach destinations in `cluster-a`), there are multiple-approaches.
Copy link
Member

Choose a reason for hiding this comment

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

there is another approach localityloadbalancing.FailoverPriority

Copy link
Contributor

Choose a reason for hiding this comment

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

Locality load balancing is a slightly different topic. Locality LB allows spill over into other localities. Here we're specifically protecting against that in order to draw strict partitions within the mesh. Any locality LB would apply within the partitions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! Definitely want to fit that in.

@stevenctl stevenctl marked this pull request as ready for review November 12, 2021 20:30
@stevenctl stevenctl requested a review from a team as a code owner November 12, 2021 20:30
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Nov 12, 2021

On top of default locality components of `region/zone/subzone`, you can use [`failoverPriority`](/docs/reference/config/networking/destination-rule/#LocalityLoadBalancerSetting)
to failover based on the cluster or network explicitly. Using the following destination rule, traffic will prefer first
in-cluster traffic, then in-network, then in-region, etc.
Copy link
Member

Choose a reason for hiding this comment

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

Not exactly, matching all the labels first, then second, match the first N-1 labels.


## Cluster Local Services
If there is no case where this traffic should be sent across clusters, consider giving the services a different name in each cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sounds like cluster-local services could apply here too ... in which case they are the same service, but happen to be stateful.

@@ -7,15 +7,16 @@ owner: istio/wg-networking-maintainers
test: no
---

### Services that are not the same
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just call this Namespace Sameness?


If there is no case where this traffic should be sent across clusters, consider giving the services a different name in each cluster.

### Partitioning Service Endpoints (i.e. creating subsets)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just call this Partitioning a Service


### Partitioning Service Endpoints (i.e. creating subsets)

Using the label `topology.istio.io/cluster` in the subset selector for a DestinationRule, you can create
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's begin by making a more general statement that you can partition anyway you like by label, using subsets. Maybe we can even link to the list of labels in the API? Then as the example, we can build a cluster-local service using the cluster label.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 I think a list of the available built-in labels that one can use, would be really good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sgtm. Would be cool if we included something in /reference/config/labels/ that additionally highlights the which ones are built-in.

subset: cluster-2
{{< /text >}}

#### Global `MeshConfig` settings
Copy link
Contributor

Choose a reason for hiding this comment

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

I actually think this should be a top-level section along side the Partitioning a Service section. The partitioning section is all about subsets .... this is different.

Maybe we call this something like Keeping Traffic In-Cluster? We've never actually defined cluster-local AFAIK :).

So I'm thinking we could re-arrange the contents to:

  • Namespace Sameness
    • Here we just keep you section as-is .. just introduce/re-introduce the concept.
  • Keeping Traffic In-Cluster
    • The mesh-config solution.
  • Service Partitioning
    • We describe that this is a general way of partitioning your service endpoints and we'll re-do the "Keeping Traffic In-Cluster" using subsets as an example.

WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That sounds good to me. It would be good to also explain that service partitioning can also be used to keep traffic in-cluster and maybe touch on why use one vs the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've put things in this structure, but I can't really think of a good way to word the pros/cons of each of the "cluster-local" approaches.

On one hand, the subsetting approach allows a bit more granular control, but it also starts to mix service-level policy with topology-level policy. For example, a config that sends 10% of traffic to v2 now needs 2x subsets (i.e. cluster-1-v2, cluster-2-v2)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than pros/cons I was thinking just a high level statement, maybe along the lines of what you just said. The one is generally more appropriate for setting topology-level policy, while the other is more service focused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a section at the bottom

### Keeping traffic in-cluster

In some cases the default cross-cluster load balancing behavior is not desirable. To keep traffic "cluster-local" (i.e.
traffic sent from `cluster-a` will only reach destinations in `cluster-a`), there are multiple-approaches.
Copy link
Contributor

Choose a reason for hiding this comment

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

Locality load balancing is a slightly different topic. Locality LB allows spill over into other localities. Here we're specifically protecting against that in order to draw strict partitions within the mesh. Any locality LB would apply within the partitions.

@stevenctl
Copy link
Contributor Author

Locality load balancing is a slightly different topic.

I think it still has a place here but I don't feel strongly.

@nmittler
Copy link
Contributor

Locality load balancing is a slightly different topic.

I think it still has a place here but I don't feel strongly.

We already have docs (a task) for locality LB. We could mention it somewhere here and link to the docs?

@stevenctl
Copy link
Contributor Author

Locality load balancing is a slightly different topic.

I think it still has a place here but I don't feel strongly.

We already have docs (a task) for locality LB. We could mention it somewhere here and link to the docs?

Probably just need to update it with details/examples for the new failoverPriority API.


On top of default locality components of `region/zone/subzone`, you can use [`failoverPriority`](/docs/reference/config/networking/destination-rule/#LocalityLoadBalancerSetting)
to failover based on the cluster or network explicitly. Using the following destination rule, traffic will prefer first
in-cluster traffic, then in-network, then in-region, etc.
Copy link
Member

Choose a reason for hiding this comment

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

This desc is not quite right

Comment on lines 139 to 143
- "topology.istio.io/cluster"
- "topology.istio.io/network"
- "topology.kubernetes.io/region"
- "topology.kubernetes.io/zone"
- "topology.istio.io/subzone"
Copy link
Member

Choose a reason for hiding this comment

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

maybe you can remove the region/zone/subzone

Comment on lines 29 to 31
clusterLocal: true
hosts:
- "mysvc.myns.svc.cluster.local"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be indented more?

btw, where is the proto for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch – and I'm not sure what you mean by where is the proto?


{{< tab name="per-service" category-value="service" >}}

{{< text yaml >}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should give more context. What CRD is this, and were is it applied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

…ter/index.md

Co-authored-by: Frank Budinsky <frankb@ca.ibm.com>
Steven Landow and others added 2 commits January 5, 2022 12:04
…ter/index.md

Co-authored-by: Frank Budinsky <frankb@ca.ibm.com>
…ter/index.md

Co-authored-by: Frank Budinsky <frankb@ca.ibm.com>
@frankbu
Copy link
Collaborator

frankbu commented Jan 10, 2022

/test gencheck_istio.io

@frankbu frankbu added the do-not-merge Block automatic merging of a PR. label Jan 10, 2022
…ter/index.md

Co-authored-by: Frank Budinsky <frankb@ca.ibm.com>
@frankbu frankbu removed the do-not-merge Block automatic merging of a PR. label Jan 11, 2022
@istio-testing istio-testing merged commit 337c78b into istio:master Jan 11, 2022
istio-testing pushed a commit that referenced this pull request Mar 10, 2022
* feat/content/zh/docs/ops/configuration/traffic-management/multicluster/index.md

* feat/content/zh/docs/ops/configuration/traffic-management/multicluster/index.md

* feat/multicluster traffic management docs

* fix/content/zh/docs/releases/bugs/index.md

* "2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants