Created
August 8, 2019 17:21
-
-
Save jonmoter/222f5f83732e0a76d08c28bc199be737 to your computer and use it in GitHub Desktop.
example of how we could route traffic by header
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
# There's an assumption here that there are multiple Services defined | |
# for ProxySQL, each with a label of `cluster`. Each Service points to | |
# its own Deployment, which handles requests for that cluster | |
--- | |
apiVersion: networking.istio.io/v1alpha3 | |
kind: DestinationRule | |
metadata: | |
name: reviews | |
spec: | |
host: proxysql | |
subsets: | |
- { name: cluster-100, labels: { cluster: "100" } } | |
- { name: cluster-101, labels: { cluster: "101" } } | |
- { name: cluster-102, labels: { cluster: "102" } } | |
--- | |
apiVersion: networking.istio.io/v1alpha3 | |
kind: VirtualService | |
metadata: | |
name: proxysql-cluster | |
spec: | |
hosts: | |
- proxysql-header | |
http: | |
# Cluster-100 | |
- match: | |
- headers: { X-Zendesk-Cluster-Id: { exact: "100" } } | |
route: | |
- destination: { host: proxysql, subset: cluster-100 } | |
# Cluster-101 | |
- match: | |
- headers: { X-Zendesk-Cluster-Id: { exact: "101" } } | |
route: | |
- destination: { host: proxysql, subset: cluster-101 } | |
### Default route | |
- route: | |
- destination: { host: proxysql, subset: cluster-100 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment