-
Notifications
You must be signed in to change notification settings - Fork 49
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
Using limits
with the shim makes the pod fail.
#194
Comments
limit
with the shim makes the pod fail.limits
with the shim makes the pod fail.
Just wanted to add my findings in here as well. It seems like there is a CPU spike during startup that is throttled by the resource limits. This might not be specific to the shim but a general issue with resource limits in Kubernetes. For example, I used the following two deployments to check how long it took for Spin's port to be opened and with higher or no limits on the pod it does open the port in a relatively short time. apiVersion: apps/v1
kind: Deployment
metadata:
name: spin-slow-start
spec:
replicas: 1
selector:
matchLabels:
app: spin-slow-start
template:
metadata:
labels:
app: spin-slow-start
spec:
runtimeClassName: wasmtime-spin
containers:
- name: spin-hello
image: ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:v0.10.0
command: ["/"]
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
- image: alpine:latest
name: debug-alpine
command: ["/bin/sh", "-c"]
args:
- |
TARGET_HOST='127.0.0.1'
echo "START: waiting for $TARGET_HOST:80"
timeout 60 sh -c 'until nc -z $0 $1; do sleep 1; done' $TARGET_HOST 80
echo "END: waiting for $TARGET_HOST:80"
sleep 100000000
resources: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: spin-faster-start
spec:
replicas: 1
selector:
matchLabels:
app: spin-faster-start
template:
metadata:
labels:
app: spin-faster-start
spec:
runtimeClassName: wasmtime-spin
containers:
- name: spin-hello
image: ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:v0.10.0
command: ["/"]
resources:
limits:
cpu: 400m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
- image: alpine:latest
name: debug-alpine
command: ["/bin/sh", "-c"]
args:
- |
TARGET_HOST='127.0.0.1'
echo "START: waiting for $TARGET_HOST:80"
timeout 60 sh -c 'until nc -z $0 $1; do sleep 1; done' $TARGET_HOST 80
echo "END: waiting for $TARGET_HOST:80"
sleep 100000000
resources: {} Maybe the fix here is to just remove the limits from example deployments or bump them up? We could also evaluate adding |
@mikkelhegn could you check to see if higher limits helps? You might also play with
|
I had to bump |
The livenessProbe reports failure continuously. Not sure if the pod is restarted because of that, but that it actually runs, or what the problem is.
Repro using k3d
Then apply the following workloads for comparison:
The text was updated successfully, but these errors were encountered: