Skip to content

Commit ed26ae0

Browse files
committed
Add more example configurations to seed corpus
Signed-off-by: sudipto baral <[email protected]>
1 parent b02edab commit ed26ae0

File tree

6 files changed

+277
-0
lines changed

6 files changed

+277
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
apiVersion: gateway.envoyproxy.io/v1alpha1
3+
kind: EnvoyPatchPolicy
4+
metadata:
5+
name: custom-response-patch-policy
6+
namespace: default
7+
spec:
8+
targetRef:
9+
group: gateway.networking.k8s.io
10+
kind: Gateway
11+
name: eg
12+
type: JSONPatch
13+
jsonPatches:
14+
- type: "type.googleapis.com/envoy.config.listener.v3.Listener"
15+
# The listener name is of the form <GatewayNamespace>/<GatewayName>/<GatewayListenerName>
16+
name: default/eg/http
17+
operation:
18+
op: add
19+
path: "/default_filter_chain/filters/0/typed_config/local_reply_config"
20+
value:
21+
mappers:
22+
- filter:
23+
status_code_filter:
24+
comparison:
25+
op: EQ
26+
value:
27+
default_value: 404
28+
runtime_key: key_b
29+
status_code: 406
30+
body:
31+
inline_string: "could not find what you are looking for"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: HTTPRoute
4+
metadata:
5+
name: myapp
6+
spec:
7+
parentRefs:
8+
- name: eg
9+
hostnames:
10+
- "www.example.com"
11+
rules:
12+
- matches:
13+
- path:
14+
type: PathPrefix
15+
value: /myapp
16+
backendRefs:
17+
- name: backend
18+
port: 3000
19+
20+
---
21+
apiVersion: gateway.envoyproxy.io/v1alpha1
22+
kind: EnvoyExtensionPolicy
23+
metadata:
24+
name: ext-proc-example
25+
spec:
26+
targetRefs:
27+
- group: gateway.networking.k8s.io
28+
kind: HTTPRoute
29+
name: myapp
30+
extProc:
31+
- backendRefs:
32+
- name: grpc-ext-proc
33+
port: 9002
34+
processingMode:
35+
request: {}
36+
response:
37+
body: Streamed
38+
39+
---
40+
apiVersion: gateway.networking.k8s.io/v1alpha3
41+
kind: BackendTLSPolicy
42+
metadata:
43+
name: grpc-ext-proc-btls
44+
spec:
45+
targetRefs:
46+
- group: ''
47+
kind: Service
48+
name: grpc-ext-proc
49+
validation:
50+
caCertificateRefs:
51+
- name: grpc-ext-proc-ca
52+
group: ''
53+
kind: ConfigMap
54+
hostname: grpc-ext-proc.envoygateway
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: GatewayClass
4+
metadata:
5+
name: eg-marketing
6+
spec:
7+
controllerName: gateway.envoyproxy.io/marketing-gatewayclass-controller
8+
---
9+
apiVersion: gateway.networking.k8s.io/v1
10+
kind: Gateway
11+
metadata:
12+
name: eg
13+
namespace: marketing
14+
spec:
15+
gatewayClassName: eg-marketing
16+
listeners:
17+
- name: http
18+
protocol: HTTP
19+
port: 8080
20+
---
21+
apiVersion: v1
22+
kind: ServiceAccount
23+
metadata:
24+
name: backend
25+
namespace: marketing
26+
---
27+
apiVersion: v1
28+
kind: Service
29+
metadata:
30+
name: backend
31+
namespace: marketing
32+
labels:
33+
app: backend
34+
service: backend
35+
spec:
36+
ports:
37+
- name: http
38+
port: 3000
39+
targetPort: 3000
40+
selector:
41+
app: backend
42+
---
43+
apiVersion: apps/v1
44+
kind: Deployment
45+
metadata:
46+
name: backend
47+
namespace: marketing
48+
spec:
49+
replicas: 1
50+
selector:
51+
matchLabels:
52+
app: backend
53+
version: v1
54+
template:
55+
metadata:
56+
labels:
57+
app: backend
58+
version: v1
59+
spec:
60+
serviceAccountName: backend
61+
containers:
62+
- image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231214-v1.0.0-140-gf544a46e
63+
imagePullPolicy: IfNotPresent
64+
name: backend
65+
ports:
66+
- containerPort: 3000
67+
env:
68+
- name: POD_NAME
69+
valueFrom:
70+
fieldRef:
71+
fieldPath: metadata.name
72+
- name: NAMESPACE
73+
valueFrom:
74+
fieldRef:
75+
fieldPath: metadata.namespace
76+
---
77+
apiVersion: gateway.networking.k8s.io/v1
78+
kind: HTTPRoute
79+
metadata:
80+
name: backend
81+
namespace: marketing
82+
spec:
83+
parentRefs:
84+
- name: eg
85+
hostnames:
86+
- "www.marketing.example.com"
87+
rules:
88+
- backendRefs:
89+
- group: ""
90+
kind: Service
91+
name: backend
92+
port: 3000
93+
weight: 1
94+
matches:
95+
- path:
96+
type: PathPrefix
97+
value: /
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: gateway.networking.k8s.io/v1
2+
kind: Gateway
3+
metadata:
4+
name: eg
5+
namespace: envoy-gateway-system
6+
spec:
7+
gatewayClassName: eg
8+
infrastructure:
9+
parametersRef:
10+
group: gateway.envoyproxy.io
11+
kind: EnvoyProxy
12+
name: prometheus
13+
listeners:
14+
- name: http
15+
protocol: HTTP
16+
port: 80
17+
---
18+
apiVersion: gateway.envoyproxy.io/v1alpha1
19+
kind: EnvoyProxy
20+
metadata:
21+
name: prometheus
22+
namespace: envoy-gateway-system
23+
spec:
24+
telemetry:
25+
metrics:
26+
prometheus:
27+
disable: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apiVersion: gateway.networking.k8s.io/v1
2+
kind: GatewayClass
3+
metadata:
4+
name: eg
5+
spec:
6+
controllerName: gateway.envoyproxy.io/gatewayclass-controller
7+
parametersRef:
8+
group: gateway.envoyproxy.io
9+
kind: EnvoyProxy
10+
name: otel
11+
namespace: envoy-gateway-system
12+
---
13+
apiVersion: gateway.envoyproxy.io/v1alpha1
14+
kind: EnvoyProxy
15+
metadata:
16+
name: otel
17+
namespace: envoy-gateway-system
18+
spec:
19+
telemetry:
20+
tracing:
21+
# sample 1% of requests
22+
samplingRate: 1
23+
provider:
24+
backendRefs:
25+
- name: otel-collector
26+
namespace: monitoring
27+
port: 4317
28+
type: OpenTelemetry
29+
customTags:
30+
# This is an example of using a literal as a tag value
31+
provider:
32+
type: Literal
33+
literal:
34+
value: "otel"
35+
"k8s.pod.name":
36+
type: Environment
37+
environment:
38+
name: ENVOY_POD_NAME
39+
defaultValue: "-"
40+
"k8s.namespace.name":
41+
type: Environment
42+
environment:
43+
name: ENVOY_GATEWAY_NAMESPACE
44+
defaultValue: "envoy-gateway-system"
45+
# This is an example of using a header value as a tag value
46+
header1:
47+
type: RequestHeader
48+
requestHeader:
49+
name: X-Header-1
50+
defaultValue: "-"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
apiVersion: gateway.envoyproxy.io/v1alpha1
3+
kind: EnvoyExtensionPolicy
4+
metadata:
5+
name: wasm-test
6+
spec:
7+
targetRefs:
8+
- group: gateway.networking.k8s.io
9+
kind: HTTPRoute
10+
name: backend
11+
wasm:
12+
- name: wasm-filter
13+
rootID: my_root_id
14+
code:
15+
type: HTTP
16+
http:
17+
url: https://raw.githubusercontent.com/envoyproxy/examples/main/wasm-cc/lib/envoy_filter_http_wasm_example.wasm
18+
sha256: 79c9f85128bb0177b6511afa85d587224efded376ac0ef76df56595f1e6315c0

0 commit comments

Comments
 (0)