Skip to content

Commit

Permalink
Fix example manifests (#1016)
Browse files Browse the repository at this point in the history
* use correct envoyfleet name

* update example to use new static route format
  • Loading branch information
Kyle Hodgetts authored Dec 7, 2022
1 parent 60e56fc commit 7eafb52
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 49 deletions.
4 changes: 2 additions & 2 deletions config/samples/gateway_v1_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: api-sample
spec:
fleet:
name: default
namespace: default
name: kusk-gateway-envoy-fleet
namespace: kusk-system
# service name and port should be specified inside x-kusk annotation
spec: |
openapi: 3.0.2
Expand Down
3 changes: 2 additions & 1 deletion config/samples/gateway_v1_envoyfleet.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apiVersion: gateway.kusk.io/v1alpha1
kind: EnvoyFleet
metadata:
name: default
name: kusk-gateway-envoy-fleet
namespace: kusk-system
spec:
image: "docker.io/envoyproxy/envoy:v1.23.1"
default: true
Expand Down
20 changes: 8 additions & 12 deletions config/samples/gateway_v1_staticroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ metadata:
name: staticroute-sample
spec:
hosts: [ "*" ]
paths:
/:
get:
route:
upstream:
host:
hostname: httpbin
port: 8080
/static:
get:
redirect:
port_redirect: 81
fleet:
name: kusk-gateway-envoy-fleet
namespace: kusk-system
upstream:
service:
name: httpbin
namespace: default
port: 8080
39 changes: 5 additions & 34 deletions examples/httpbin/httpbin_v1_staticroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,8 @@ spec:
namespace: kusk-system
# should work with localhost, example.org
hosts: ["localhost", "*"]
paths:
# Root goes to httpbin
/:
get: &root_route
route:
upstream:
host:
hostname: httpbin.default.svc.cluster.local
port: 8080
rewrite:
pattern: "^/$"
substitution: "/get"
# copying for all methods
post: *root_route
put: *root_route
head: *root_route
# /static -> /
/static:
get:
redirect:
path_redirect: "/"
response_code: 308
# /get2 routed to k8s service httpbin in default namespace with rewrite to /get
/get2:
get:
route:
upstream:
service:
name: httpbin
namespace: default
port: 8080
rewrite:
pattern: "^/get2$"
substitution: "/get"
upstream:
service:
name: httpbin
namespace: default
port: 8080

0 comments on commit 7eafb52

Please sign in to comment.