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

When a runtime is specified as default_runtime_name, the cri_handler of the runtime cannot be used. #10091

Open
ToviHe opened this issue Apr 19, 2024 · 0 comments

Comments

@ToviHe
Copy link

ToviHe commented Apr 19, 2024

I have a config.toml configuration as follows

[plugins."io.containerd.grpc.v1.cri".containerd]
   default_runtime_name = "kata"
    [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
           runtime_type = "io.containerd.runc.v2"
        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata]
           runtime_type = "io.containerd.kata.v2"
           cri_handler = "cc"

When I create a new pod, for example

cat <<-EOF | kubectl apply -f -
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
  name: kata
handler: kata
EOF

cat <<-EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: nginx-sandbox
spec:
  runtimeClassName: kata
  containers:
  - image: docker.io/zhouliang121/alpine-84688df7-2c0c-40fa-956b-29d8e74d16c1-gcm:latest
    command:
      - top
    imagePullPolicy: IfNotPresent
    name: alpine
  restartPolicy: Never
EOF

It was found that the pod startup uses the cri_handler="cc" feature.
But when I deleted the runtimeClassName:kata corresponding to the pod, I found that the feature of cri_handler="cc" was not used.
like:

cat <<-EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: nginx-sandbox
spec:
  containers:
  - image: docker.io/zhouliang121/alpine-84688df7-2c0c-40fa-956b-29d8e74d16c1-gcm:latest
    command:
      - top
    imagePullPolicy: IfNotPresent
    name: alpine
  restartPolicy: Never
EOF

Is there any special connection between the runtimeClassName provided in k8s and the runtime declared in containerd? Why does cri_handler not take effect?

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

No branches or pull requests

1 participant