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

Spicify the runc path when we use the containerd container engine and change the bin_dir path. #10154

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

qlijin
Copy link
Member

@qlijin qlijin commented May 30, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it:
when we use the containerd container engine and change the bin_dir path, the installation will stop and with kubelet error:
May 26 02:19:44 localhost containerd: time="2023-05-26T02:19:44.252978056-04:00" level=error msg="RunPodSandbox for &PodSandboxMetadata{Name:kube-scheduler-node1,Uid:bd557bf0bab279ad21231c6c93dfdecb,Namespace:kube-system,Attempt:0,} failed, error" error="failed to create containerd task: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/k8s.io/5d728ef6fd58040d715c1f60923185eee7645e0fbc5d9b7feb27760bc1ba329d/log.json: no such file or directory): exec: \"runc\": executable file not found in $PATH: unknown

bugfix:
we need import the binaryName param metioned in the document:

  name: runc
  type: "io.containerd.runc.v2"
  engine: ""
  root: ""
  options:
    systemdCgroup: "false"
    binaryName: /usr/local/bin/my-runc
  base_runtime_spec: cri-base.json

https://github.com/kubernetes-sigs/kubespray/blob/master/docs/containerd.md?plain=1#L58

Does this PR introduce a user-facing change?:

[containerd] Specify the runc path when we use the containerd container engine and change the bin_dir path.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 30, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @qlijin. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 30, 2023
@@ -35,7 +35,11 @@ oom_score = {{ containerd_oom_score }}

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}.options]
{% for key, value in runtime.options.items() %}
{% if value|bool %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you wanted to check if it's a boolean to not add quote right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The systemdCgroup is boolean, it cannot be quoted. And the binaryName var is string type.
They need to be treated separatorly. Otherwise it will raise error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure this doesn't work then, what if the value is supposed to be false for instance? It will be converted to a boolean and will go into the else...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll check the var is boolean type or not. Thank you~

@qlijin qlijin force-pushed the about_runc_path branch from a07ab47 to 6e2bb36 Compare July 5, 2023 02:43
@qlijin qlijin requested a review from MrFreezeex July 14, 2023 02:00
Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution and bearing with me! :D
/lgtm
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 17, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2023
@floryut floryut added the kind/container-managers Containers section in the release note label Oct 30, 2023
Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qlijin Thank you 👍

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, MrFreezeex, qlijin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 30, 2023
@k8s-ci-robot k8s-ci-robot merged commit af7bc17 into kubernetes-sigs:master Oct 30, 2023
guytet pushed a commit to guytet/kubespray that referenced this pull request Oct 30, 2023
… change the bin_dir path. (kubernetes-sigs#10154)

* Specify the runc path when we use the containerd container engine
and change the bin_dir path.

Signed-off-by: Jin Li <[email protected]>

* Update roles/container-engine/containerd/templates/config.toml.j2

Co-authored-by: Arthur Outhenin-Chalandre <[email protected]>

---------

Signed-off-by: Jin Li <[email protected]>
Co-authored-by: Arthur Outhenin-Chalandre <[email protected]>
@yankay yankay mentioned this pull request Dec 15, 2023
@qlijin qlijin deleted the about_runc_path branch January 11, 2024 02:09
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
… change the bin_dir path. (kubernetes-sigs#10154)

* Specify the runc path when we use the containerd container engine
and change the bin_dir path.

Signed-off-by: Jin Li <[email protected]>

* Update roles/container-engine/containerd/templates/config.toml.j2

Co-authored-by: Arthur Outhenin-Chalandre <[email protected]>

---------

Signed-off-by: Jin Li <[email protected]>
Co-authored-by: Arthur Outhenin-Chalandre <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/container-managers Containers section in the release note lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants