-
Notifications
You must be signed in to change notification settings - Fork 305
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, kubernetes: support wasm for kubernetes infrastructure with side-cars with wasm-smart and compat-smart annotation
#886
Conversation
|
@giuseppe PTAL. I just need to confirm if |
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.
just a typo, otherwise LGTM
9d90e7d
to
cb0fdbc
Compare
cb0fdbc
to
dd3f5d4
Compare
|
Thanks for working on that @flouthoc! The only thing I'm a bit concerned about is that a sidecars entrypoint maybe ends on |
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.
LGTM
Thanks for trying this out and confirming.
@0xE282B0 I did not understand this question completely. I have added |
|
Sorry for being imprecise. For me it looks like |
Oh fair request. Let me amend the the commit. |
dd3f5d4
to
2513559
Compare
79c0076
to
43c5b42
Compare
…e-cars
Complex kubernetes infrastructure contains pod and most likely pod with
side-cars. Therefore `wasm` integration is not useful for cases where
side-cars are almost there in most of the deployments example
infrastrcuture setups with `service-mesh` like `linkerd` and `istio`.
Following use-case is solved by adding two smart annotations for only
wasm-handlers i.e `compat-smart` and `wasm-smart`
compat-smart, wasm-smart: annotation is a smart switch which only toggles wasm
runtime if its necessary otherwise fallbacks to native container runtime
hence in deployments with `side-cars` only containers which contains
valid `wasm` workload will be treated be executed by `wasm-handlers` and
regular containers are treated as it is.
Simple tryout example with `module.wasm.image/variant: compat-smart`
```yaml
apiVersion: v1
kind: Pod
metadata:
name: wasm-hello
annotations:
module.wasm.image/variant: compat-smart
spec:
containers:
- image: busybox
name: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
- name: wasm-hello
image: your-wasm-image:latest
imagePullPolicy: IfNotPresent
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
```
* Commit also refactor's handler code into a shared handler-utils.c
Signed-off-by: Aditya R <arajan@redhat.com>
Update man page to document `compat-smart`, `wasm-smart` and rectify known issues. Signed-off-by: Aditya R <arajan@redhat.com>
43c5b42
to
77df89b
Compare
| /* | ||
| * crun - OCI runtime written in C | ||
| * | ||
| * Copyright (C) 2017, 2018, 2019 Giuseppe Scrivano <giuseppe@scrivano.org> |
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.
@giuseppe Might want to extend your copyright...
|
LGTM |
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.
LGTM
|
@flouthoc I can open an issue in the wasmedge repo to add the annotations to the docs. |
|
@0xE282B0 Thanks. |
|
We really need to have a nice blog/article/demo showing us using crun/wasm to run containers. Would it make sense to have entrypoint oci-runtimes named wasm-smart and compat-smart and just specify the oci runtime rather then setting annotations? |
|
@rhatdan I think the convention was initially set by |
Complex kubernetes infrastructure contains pod and most likely pod with
side-cars. Therefore
wasmintegration is not useful for cases whereside-cars are almost there in most of the deployments example
infrastrcuture setups with
service-meshlikelinkerd,glooandistioand proxy like
envoy.Following use-case is solved by adding two smart annotations for only
wasm-handlers i.e
compat-smartandwasm-smartcompat-smart, wasm-smart: annotation is a smart switch which only toggles wasm
runtime if its necessary otherwise fallbacks to native container runtime
hence in deployments with
side-carsonly containers which containsvalid
wasmworkload will be treated be executed bywasm-handlersandregular containers are treated as it is.
Simple tryout example with
module.wasm.image/variant: compat-smartCloses: #829