Skip to content

Unexpected Resources behaviour in spec #961

Description

@xelab04

Environmental Info:
Host Cluster Version:
k3s 1.35.4

Node(s) CPU architecture, OS, and Version:
x86, openSUSE Leap 15.6

Host Cluster Configuration:
3 control plane nodes

Describe the bug:

The CRD for a cluster allows both serverLimit and serverResources. I created a cluster, specifying only serverResources, with the following under spec:

serverResources:
    limits:
      cpu: 400m
      memory: 600Mi
    requests:
      cpu: 100m
      memory: 400Mi

However, when the cluster is created, the following server pod is created (with the fluff removed for simplicity). The limits of 100m/100Mi and requests of 50m/75Mi are from the VCP defaults.

spec:
  containers:
  - image: rancher/k3s:v1.35.4-k3s1
    resources:
      limits:
        cpu: 100m
        memory: 100Mi
      requests:
        cpu: 50m
        memory: 75Mi
  resources:
    limits:
      cpu: 400m
      memory: 600Mi
    requests:
      cpu: 100m
      memory: 400Mi

Expected behavior:
The resources are applied to the container as well, to prevent default values from the VirtualClusterPolicy from affecting the container in the server (and probably worker) pods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions