Skip to content

kubevirt for able to run CX or RT type of instances. - #757

Merged
Andrei Kvapil (kvaps) merged 2 commits into
cozystack:mainfrom
jokeOps:main
Apr 9, 2025
Merged

kubevirt for able to run CX or RT type of instances.#757
Andrei Kvapil (kvaps) merged 2 commits into
cozystack:mainfrom
jokeOps:main

Conversation

@jokeOps

@jokeOps Pavlo Gaponuk (jokeOps) commented Apr 5, 2025

Copy link
Copy Markdown
Contributor

Without this, kubevirt does not recognize that cpu-manager is being used on the node and does not change the label "cpumanager=false" on nodes, which prevents the starting of instances with types CX or RT.

Summary by CodeRabbit

  • New Features
    • Introduced the CPUManager feature to enhance CPU resource management for virtual machines in KubeVirt.

@coderabbitai

coderabbitai Bot commented Apr 5, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The change introduces a new feature gate, CPUManager, to the featureGates list within the developerConfiguration section of the KubeVirt specification. This addition enhances the configuration by enabling the CPUManager feature, which is intended to improve CPU resource management for virtual machines. The rest of the configuration remains unchanged, with no deletions or modifications to existing entries.

Changes

File Change Summary
packages/system/.../kubevirt-cr.yaml Added CPUManager feature gate to the developerConfiguration section.

Sequence Diagram(s)

sequenceDiagram
    participant Loader as ConfigLoader
    participant Spec as KubeVirtSpec
    participant VM as VMManager

    Loader->>Spec: Load developerConfiguration
    Spec-->>Loader: Return configuration (includes CPUManager flag)
    Spec->>VM: Pass CPUManager configuration for CPU resource management
Loading

Poem

I'm a bunny with a spring in my hop,
Skipping through code, I never stop.
CPUManager's new in the configuration mix,
Helping VMs with clever CPU tricks.
Hoppy changes make my code carrot-top!
🥕🐇 Happy coding, tip-top!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a1c3b6 and 4078b21.

📒 Files selected for processing (1)
  • packages/system/kubevirt/templates/kubevirt-cr.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/system/kubevirt/templates/kubevirt-cr.yaml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kvaps

Andrei Kvapil (kvaps) commented Apr 7, 2025

Copy link
Copy Markdown
Member

Thank you, did you tested this with Talos Linux. There were some issues, but it seems they are fixed now.

Also, could you fix DCO by signing your commit with --signoff option, please ?

Signed-off-by: Pavlo Gaponuk <pashagaponuk@gmail.com>
@jokeOps

Copy link
Copy Markdown
Contributor Author

Thank you, did you tested this with Talos Linux. There were some issues, but it seems they are fixed now.

Also, could you fix DCO by signing your commit with --signoff option, please ?

I tested this with Talos, with this configuration, and signed off on the commit.
Thanks.

machine:
  kubelet:
    extraArgs:
      cpu-manager-policy: static
      cpu-manager-reconcile-period: 5s
      kube-reserved: "cpu=2,memory=2Gi"
      system-reserved: "cpu=1,memory=1Gi"
      feature-gates: "CPUManager=true"
    extraConfig:
      maxPods: 512
      cpuManagerPolicy: "static"
      cpuManagerReconcilePeriod: 5s
      featureGates:
        CPUManager: true
    nodeIP:
      validSubnets:
      - 10.11.10.0/24
      - 10.11.11.0/24
  kernel:
    modules:
    - name: openvswitch
    - name: drbd
      parameters:
        - usermode_helper=disabled
    - name: zfs
    - name: spl
  install:
    image: ghcr.io/cozystack/cozystack/talos:v1.9.5
    extraKernelArgs:
      - cpufreq.default_governor=performance
      - amd_pstate=active
      - hugepagesz=1G
      - hugepages=288
  files:
  - content: |
      [plugins]
        [plugins."io.containerd.grpc.v1.cri"]
          device_ownership_from_security_context = true
        [plugins."io.containerd.cri.v1.runtime"]
          device_ownership_from_security_context = true
    path: /etc/cri/conf.d/20-customization.part
    op: create

  sysctls:
    kernel.sched_rt_runtime_us: -1
    kernel.sched_rt_period_us: 1000000
    vm.nr_hugepages: 2048

cluster:
  network:
    cni:
      name: none
    dnsDomain: cozy.local
    podSubnets:
    - 10.244.0.0/16
    serviceSubnets:
    - 10.96.0.0/16
  apiServer:
    extraArgs:
      oidc-issuer-url: "https://keycloak.my.localcloud.com/realms/cozy"
      oidc-client-id: "kubernetes"
      oidc-username-claim: "preferred_username"
      oidc-groups-claim: "groups"

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your config, we should consider including these options by default:

machine:
  kubelet:
    extraArgs:
      cpu-manager-policy: static
      cpu-manager-reconcile-period: 5s
      kube-reserved: "cpu=2,memory=2Gi"
      system-reserved: "cpu=1,memory=1Gi"
      feature-gates: "CPUManager=true"
    extraConfig:
      cpuManagerPolicy: "static"
      cpuManagerReconcilePeriod: 5s
      featureGates:
        CPUManager: true

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

Successfully merging this pull request may close these issues.

2 participants