route traffic based on headers and weight

This commit is contained in:
Stefan Prodan
2018-02-24 23:38:40 +02:00
parent 864f93c5fa
commit 89864c2bec
2 changed files with 29 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ metadata:
kind: Mapping
name: blue
prefix: /
host: blue.test
host: podinfo.test
service: blue.default:9898
spec:
type: ClusterIP

View File

@@ -10,8 +10,11 @@ metadata:
kind: Mapping
name: green
prefix: /
host: green.test
host: podinfo.test
service: green.default:9898
weight: 50
headers:
X-Subscription: trial
spec:
type: ClusterIP
ports:
@@ -20,3 +23,27 @@ spec:
protocol: TCP
selector:
app: green
---
apiVersion: v1
kind: Service
metadata:
name: blue-trial
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v0
kind: Mapping
name: blue-trial
prefix: /
host: podinfo.test
service: blue.default:9898
headers:
X-Subscription: trial
spec:
type: ClusterIP
ports:
- port: 9898
targetPort: 9898
protocol: TCP
selector:
app: blue