Last active
February 15, 2021 12:54
-
-
Save Spazzy757/58c19c013f2c1e4e1920b6d0b91a2ccc to your computer and use it in GitHub Desktop.
This is a very simple example of how to create a sticky session configuration for a application running behind istio
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
--- | |
apiVersion: networking.istio.io/v1beta1 | |
kind: DestinationRule | |
metadata: | |
name: <app-name> | |
spec: | |
host: <app-name>.<app-namespace>.svc.cluster.local | |
trafficPolicy: | |
loadBalancer: | |
consistentHash: | |
httpCookie: | |
name: cookie | |
path: <cookie to use for sessions> | |
ttl: "3600s" |
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
--- | |
apiVersion: networking.istio.io/v1alpha3 | |
kind: VirtualService | |
metadata: | |
name: <app-name> | |
namespace: istio-system | |
spec: | |
hosts: | |
- <host> | |
gateways: | |
- <gateway-name> | |
http: | |
- match: | |
- uri: | |
prefix: / | |
route: | |
- destination: | |
port: | |
number: 80 | |
host: <app-name>.<app-namespace>.svc.cluster.local | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment