Skip to content
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

Wasm filter with Istio 1.11.3 #278

Open
rupipal opened this issue Dec 23, 2021 · 4 comments
Open

Wasm filter with Istio 1.11.3 #278

rupipal opened this issue Dec 23, 2021 · 4 comments
Labels
question Further information is requested

Comments

@rupipal
Copy link

rupipal commented Dec 23, 2021

Hi,
Following the getting-started https://docs.solo.io/web-assembly-hub/latest/tutorial_code/getting_started I'm trying to deploy the wasm filter to Istio 1.11.3 installed on a minikube cluster. I thought if wasm extensions are merged with Envoy, they should work with recent Istio versions. I have the image successfully pushed to a repository in my account on Web Assembly Hub. After successfully logging into the Hub from my shell, this is what I get. Where I'm going wrong?

$ wasme deploy istio webassemblyhub.io/rpsspr/add-header:v0.1 --id=add-header
INFO[0000] cache namespace already exists cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache configmap already exists cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache service account already exists cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache role updated cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache rolebinding updated cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache daemonset updated cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
Error: image webassemblyhub.io/rpsspr/add-header:v0.1 not supported by istio version 1.11.3
Usage:
wasme deploy istio --id= [--config=] [--root-id=] [--namespaces ] [--name deployment-name] [--patch-context={any|inbound|outbound|gateway}] [flags]

Flags:
--cache-custom-command strings custom command to provide to the cache server image
--cache-image-pull-policy string image pull policy for the cache server daemonset. see https://kubernetes.io/docs/concepts/containers/images/ (default "IfNotPresent")
--cache-name string name of resources for the wasm image cache server (default "wasme-cache")
--cache-namespace string namespace of resources for the wasm image cache server (default "wasme")
--cache-repo string name of the image repository to use for the cache server daemonset (default "quay.io/solo-io/wasme")
--cache-tag string image tag to use for the cache server daemonset (default "0.0.33")
--cache-timeout duration the length of time to wait for the server-side filter cache to pull the filter image before giving up with an error. set to 0 to skip the check entirely (note, this may produce a known race condition). (default 1m0s)
-h, --help help for istio
--ignore-version-check set to disable abi version compatability check.
--istio-namespace string the namespace where the Istio control plane is installed (default "istio-system")
--istiod-name string deployment name of the istiod (default "istiod")
-l, --labels stringToString labels of the deployment or daemonset into which to inject the filter. if not set, will apply to all workloads in the target namespace (default [])
-n, --namespace string namespace of the workload(s) to inject the filter. (default "default")
--patch-context string patch context of the filter. possible values are any, inbound, outbound, gateway (default "inbound")
-t, --workload-type string type of workload into which the filter should be injected. possible values are daemonset, deployment, statefulset (default "deployment")

Global Flags:
--config string optional config that will be passed to the filter. accepts an inline string.
--id string unique id for naming the deployed filter. this is used for logging as well as removing the filter. when running wasme deploy istio, this name must be a valid Kubernetes resource name.
--root-id string optional root ID used to bind the filter at the Envoy level. this value is normally read from the filter image directly.
-v, --verbose verbose output

@rupipal rupipal added the question Further information is requested label Dec 23, 2021
@Sodman
Copy link
Member

Sodman commented Dec 27, 2021

Hi @rupipal, there's currently an open pull request to add official support to Istio 1.11.x. There's still a few things to be ironed out there before merging, but it should be available in the next release (v0.0.34).

In the interim, you can try re-running the wasme deploy istio command with the --ignore-version-check flag. Assuming your filter is compatible with the ABI version in the underlying Envoy which Istio deploys, it should work!

@rupipal
Copy link
Author

rupipal commented Dec 28, 2021

Hi @Sodman

Thanks! It worked.

~$ wasme deploy istio webassemblyhub.io/rpsspr/add-header:v0.1 --id=add-header --ignore-version-check
INFO[0000] cache namespace created cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache configmap created cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache service account created cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache role created cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache rolebinding created cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
INFO[0000] cache daemonset created cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.33"
WARN[0005] ignoreVersionCheck is set, skipping ABI version check image="webassemblyhub.io/rpsspr/add-header:v0.1"
INFO[0005] added image to cache config... cache="{wasme-cache wasme}" image="webassemblyhub.io/rpsspr/add-header:v0.1"
INFO[0005] waiting for event with timeout 1m0s
INFO[0006] cleaning up cache events for image webassemblyhub.io/rpsspr/add-header:v0.1
INFO[0006] updated workload sidecar annotations filter="id:"add-header" image:"webassemblyhub.io/rpsspr/add-header:v0.1" rootID:"add_header" patchContext:"inbound" " workload=petstore
INFO[0006] created Istio EnvoyFilter resource envoy_filter_resource=petstore-add-header.default filter="id:"add-header" image:"webassemblyhub.io/rpsspr/add-header:v0.1" rootID:"add_header" patchContext:"inbound" " workload=petstore

And the filter worked too.

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < content-type: application/xml
    < date: Tue, 28 Dec 2021 07:06:11 GMT
    < content-length: 86
    < x-envoy-upstream-service-time: 0
    < hello: world!
    < server: istio-envoy
    <
    [{"id":1,"name":"Dog","status":"available"},{"id":2,"name":"Cat","status":"pending"}]
  • Connection #0 to host 192.168.105.2 left intact

@Sodman
Copy link
Member

Sodman commented Dec 28, 2021

Great, glad it's working!

This --ignore-version-check workaround will no longer be required once #274 merges and v0.0.34 is released!

@rupipal
Copy link
Author

rupipal commented Dec 28, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants