Open drnic opened 6 years ago
WIP, I tried adding simple.knative.starkandwayne.com
to the existing virtualservice but a) the route never worked; and b) within a few seconds knative re-wrote the virtualservice to remove my appended /spec/hosts
item.
kubectl patch virtualservices.networking.istio.io -n my-simple-app --type json --patch '[{"op": "add", "path": "/spec/hosts/-", "value": "simple.knative.starkandwayne.com"}]' simple-app
Sweet, the following worked:
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: simple-app-entry-route
namespace: my-simple-app
spec:
gateways:
- knative-shared-gateway.knative-serving.svc.cluster.local
hosts:
- simple.knative.starkandwayne.com
http:
- match:
- uri:
prefix: "/"
rewrite:
authority: simple-app.my-simple-app.svc.cluster.local
route:
- destination:
host: knative-ingressgateway.istio-system.svc.cluster.local
weight: 100
$ curl simple-app.my-simple-app.knative.starkandwayne.com
<h1>Built from Git repo using Buildpack template</h1>
$ curl simple.knative.starkandwayne.com
<h1>Built from Git repo using Buildpack template</h1>
Draft blog post which sets up two routes to two apps https://starkandwayne.com/blog/p/8a1e05ef-b2f8-4ac3-93cd-d2421ddddeca/ (will be published in a couple weeks)
very nice! one concern i have is how to make sure istio doesnt creep in too much into knctl since knative community is in the midst of making routing (istio) pluggable.
i am marking this feature request as blocked on public api from knative.
Knative/Istio supports custom host/path routing:
Would be lovely for this to be nicely handled by
knctl
.