deislabs / containerd-wasm-shims

containerd shims for running WebAssembly workloads in Kubernetes
Apache License 2.0
312 stars 48 forks source link

How to make capaiblities configurable at K8S for slight shim #66

Closed huangyingting closed 1 year ago

huangyingting commented 1 year ago

I tried to deploy a slight wasm application into k8s cluster with kv redis capaiblity, however could not find a way to make REDIS_ADDRESS configurable, it is defined in slightfile.yaml, by the time shim starts, it needs this file in place, so looks like no way to dynamically configure my redis address.

Mossaka commented 1 year ago

The slightfile can read REDIS_ADDRESS from enviornment variable, which you can pass the value of the address from pod yaml.

See https://github.com/deislabs/containerd-wasm-shims/blob/main/deployments/chat-workloads/workload.yaml#L21-L22 and https://github.com/deislabs/spiderlightning/blob/main/examples/keyvalue-demo/keyvalue_azblob_slightfile.toml#L7