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

Fix data race in OperatingSystemConfig component #5516

Merged
merged 1 commit into from Mar 4, 2022

Conversation

rfranzke
Copy link
Member

@rfranzke rfranzke commented Mar 4, 2022

How to categorize this PR?

/area usability
/kind bug

What this PR does / why we need it:
When a Shoot specifies eviction settings in .spec.kubernetes.kubelet and has more than one worker pool without any overriding kubelet settings (.spec.provider.workers[].kubernetes.kubelet=nil) then there might be a data race in

setDefaultEvictionMemoryAvailable(kubeletConfigParameters.EvictionHard, kubeletConfigParameters.EvictionSoft, o.values.MachineTypes, worker.Machine.Type)
because the maps part of kubeletConfigParameters were shared.

Example Shoot spec:

kind: Shoot
apiVersion: core.gardener.cloud/v1beta1
spec:
  kubernetes:
    kubelet:
      evictionHard:
        memoryAvailable: 1500Mi
      evictionSoft:
        memoryAvailable: 2Gi
      maxPods: 50
      failSwapOn: true
      kubeReserved:
        cpu: 80m
        memory: 1Gi
        pid: 20k
      imageGCHighThresholdPercent: 50
      imageGCLowThresholdPercent: 40
      serializeImagePulls: true
  provider:
    workers:
      - name: cpu-worker-a
        machine:
          type: m5.2xlarge
        maximum: 2
        minimum: 1
        maxSurge: 1
        maxUnavailable: 0
        volume:
          type: gp2
          size: 50Gi
        zones:
          - eu-central-1a
      - name: cpu-worker-c
        machine:
          type: m5.2xlarge
        maximum: 2
        minimum: 1
        maxSurge: 1
        maxUnavailable: 0
        volume:
          type: gp2
          size: 50Gi
        zones:
          - eu-central-1c

Special notes for your reviewer:
/cc @petersutter @dkistner @ialidzhikov

Release note:

A bug has been fixed causing gardenlet to panic when a `Shoot` with multiple worker pools specifies eviction settings for the kubelet configuration in `.spec.kubernetes.kubelet` while `.spec.provider.workers[].kubernetes.kubelet=nil`.

Copy link
Member

@dkistner dkistner left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@petersutter petersutter left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Member

@ialidzhikov ialidzhikov left a comment

Choose a reason for hiding this comment

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

/lgtm

@rfranzke rfranzke merged commit addac87 into gardener:master Mar 4, 2022
@rfranzke rfranzke deleted the fix/osc-data-race branch March 4, 2022 14:05
krgostev pushed a commit to krgostev/gardener that referenced this pull request Apr 21, 2022
krgostev pushed a commit to krgostev/gardener that referenced this pull request Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability Usability related kind/bug Bug 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.

None yet

7 participants