-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Wasm extension HTTP code source #3164
Changes from 1 commit
d0cb214
b6cc5a6
64b76a9
d05c8ec
0b47909
164f6d8
67977a3
880d436
59ff9a2
6f5a419
4ba3921
c48eadc
0c4400c
0369f4f
e82e79b
3b9510b
67baf73
416eeb9
20038ab
6a4942e
bfb649d
6086333
cb2b993
8d536ba
a13e258
0c52d50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,8 +78,9 @@ type WasmCodeSource struct { | |
Image *ImageWasmCodeSource `json:"image,omitempty"` | ||
|
||
// SHA256 checksum that will be used to verify the wasm code. | ||
// +optional | ||
// SHA256 *string `json:"sha256,omitempty"` | ||
// | ||
// kubebuilder:validation:Pattern=`^[a-f0-9]{64}$` | ||
SHA256 string `json:"sha256"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make SHA256 mandatory for now to avoid downloading wasm and calculate SHA in the control plane. We can make it optional without breaking changes if we opt to build a cache in the control plane in the future. |
||
} | ||
|
||
// WasmCodeSourceType specifies the types of sources for the wasm code. | ||
|
@@ -92,6 +93,9 @@ const ( | |
|
||
// ImageWasmCodeSourceType allows the user to specify the wasm code in an OCI image. | ||
ImageWasmCodeSourceType WasmCodeSourceType = "Image" | ||
|
||
// ConfigMapCodeSourceType allows the user to specify the wasm code in a ConfigMap. | ||
zhaohuabing marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ConfigMapWasmCodeSourceType WasmCodeSourceType = "ConfigMap" | ||
) | ||
|
||
// HTTPWasmCodeSource defines the HTTP URL containing the wasm code. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
gateways: | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
namespace: envoy-gateway | ||
name: gateway-1 | ||
spec: | ||
gatewayClassName: envoy-gateway-class | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
allowedRoutes: | ||
namespaces: | ||
from: All | ||
httpRoutes: | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
namespace: default | ||
name: httproute-1 | ||
spec: | ||
hostnames: | ||
- www.example.com | ||
parentRefs: | ||
- namespace: envoy-gateway | ||
name: gateway-1 | ||
sectionName: http | ||
rules: | ||
- matches: | ||
- path: | ||
value: "/foo" | ||
backendRefs: | ||
- name: service-1 | ||
port: 8080 | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
namespace: default | ||
name: httproute-2 | ||
spec: | ||
hostnames: | ||
- www.example.com | ||
parentRefs: | ||
- namespace: envoy-gateway | ||
name: gateway-1 | ||
sectionName: http | ||
rules: | ||
- matches: | ||
- path: | ||
value: "/bar" | ||
backendRefs: | ||
- name: service-1 | ||
port: 8080 | ||
envoyextensionpolicies: | ||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyExtensionPolicy | ||
metadata: | ||
namespace: envoy-gateway | ||
name: policy-for-gateway # This policy should attach httproute-2 | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: Gateway | ||
name: gateway-1 | ||
namespace: envoy-gateway | ||
wasm: | ||
- name: wasm-filter-1 | ||
code: | ||
type: HTTP | ||
http: | ||
url: https://www.example.com/wasm-filter-1.wasm | ||
sha256: 746df05c8f3a0b07a46c0967cfbc5cbe5b9d48d0f79b6177eeedf8be6c8b34b5 | ||
config: | ||
parameter1: | ||
key1: value1 | ||
key2: value2 | ||
parameter2: value3 | ||
- name: wasm-filter-2 | ||
code: | ||
type: HTTP | ||
http: | ||
url: https://www.example.com/wasm-filter-2.wasm | ||
sha256: a1efca12ea51069abb123bf9c77889fcc2a31cc5483fc14d115e44fdf07c7980 | ||
config: | ||
parameter1: value1 | ||
parameter2: value2 | ||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyExtensionPolicy | ||
metadata: | ||
namespace: default | ||
name: policy-for-http-route # This policy should attach httproute-1 | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
name: httproute-1 | ||
namespace: default | ||
wasm: | ||
- name: wasm-filter-3 | ||
code: | ||
type: HTTP | ||
http: | ||
url: https://www.test.com/wasm-filter-3.wasm | ||
sha256: a1f0b78b8c1320690327800e3a5de10e7dbba7b6c752e702193a395a52c727b6 | ||
config: | ||
parameter1: | ||
key1: value1 | ||
parameter2: | ||
key2: | ||
key3: value3 | ||
failOpen: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pascal case semantics ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the name convention here:https://webassembly.org/