Skip to content

Add containerd.runtime.extra_args configuration - #13365

Open
LoniasGR wants to merge 1 commit into
kubernetes-sigs:masterfrom
LoniasGR:containerd-runtime-extra-args
Open

Add containerd.runtime.extra_args configuration#13365
LoniasGR wants to merge 1 commit into
kubernetes-sigs:masterfrom
LoniasGR:containerd-runtime-extra-args

Conversation

@LoniasGR

Copy link
Copy Markdown

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds the ability to configure containerd runtime options. Our main use case was to enable the cgroup_writable option, but I tried to generalize so that the rest of the options can be included. cgroups_writable specifically is also relevant for KEP 5474 and is needed for running specific kinds of workloads in Kubernetes (in our case it was FreeIPA).

Example of usage:

containerd_runc_runtime:
  name: runc
  type: "io.containerd.runc.v2"
  base_runtime_spec: cri-base.json
  extra_args:
    cgroup_writable: true
  options:
    Root: ""
    SystemdCgroup: "{{ containerd_use_systemd_cgroup | ternary('true', 'false') }}"
    BinaryName: "{{ bin_dir }}/runc"

Which issue(s) this PR fixes:

Did not find any relevant issues.

Special notes for your reviewer:

  • The name could be changed, I just couldn't think of a better one, however I could see confusion arising between this and containerd_extra_runtime_args.
  • I'm not sure if this should be also added to the containerd v.1 template.

Does this PR introduce a user-facing change?:

containerd runtime options can be configured under  `runtime.extra_args`

Signed-off-by: Leonidas Avdelas <avdelasleonidas@gmail.com>
Copilot AI review requested due to automatic review settings July 11, 2026 15:59
@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Jul 11, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 11, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: LoniasGR / name: Leonidas Avdelas (5c12701)

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @LoniasGR!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 11, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @LoniasGR. 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.

Details

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-sigs/prow repository.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LoniasGR
Once this PR has been reviewed and has the lgtm label, please assign tico88612 for approval. For more information see the Code Review Process.

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

Details 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends Kubespray’s containerd (v2+ CRI) config.toml template to support injecting additional per-runtime configuration fields (beyond runtime_type, base_runtime_spec, and .options) via a new runtime.extra_args mapping.

Changes:

  • Add runtime.extra_args rendering into config.toml.j2 under each [...runtimes.<name>] stanza.
  • Support string/boolean/non-string values when rendering runtime.extra_args entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +64 to +70
{% if value is string %}
{{ key }} = "{{ value }}"
{% elif value is boolean %}
{{ key }} = {{ value | lower }}
{% else %}
{{ key }} = {{ value }}
{% endif %}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The same code block is used in lines 43-51 to detect the variable type, so i'm not sure these two should differ.

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 11, 2026
@yankay

yankay commented Jul 13, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@kubernetes-prow kubernetes-prow Bot 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 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants