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

WINC-1374,WINC-926,WINC-1373: Adjust kubelet configuration for NodeAllocatable, EvictionHard and System Memory #2709

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jrvaldes
Copy link
Contributor

@jrvaldes jrvaldes commented Feb 13, 2025

In this PR

  • stop using hard-coded resource names for the SystemReserved in the Kubelet configuration for the corresponding constants
  • set the reserved memory for the Windows host with at least 2GiB following upstream recommendations for kubelet running on Windows
  • introduces EnforceNodeAllocatable with value none in the kubelet configuration to avoid post-processing the generated configuration (WINC-926)
  • explicitly set available hard-evictions thresholds for Windows

In addition, aligns the e2e test with the proposed configuration.

Resulting kubelet configuration with the proposed changes.

{
  "kubeletconfig": {
    "enableServer": true,
    "podLogsDir": "/var/log/pods",
    "syncFrequency": "1m0s",
    "fileCheckFrequency": "20s",
    "httpCheckFrequency": "20s",
    "address": "0.0.0.0",
    "port": 10250,
    "rotateCertificates": true,
    "serverTLSBootstrap": true,
    "authentication": {
      "x509": {
        "clientCAFile": "C:\\k\\kubelet-ca.crt"
      },
      "webhook": {
        "enabled": true,
        "cacheTTL": "2m0s"
      },
      "anonymous": {
        "enabled": false
      }
    },
    "authorization": {
      "mode": "Webhook",
      "webhook": {
        "cacheAuthorizedTTL": "5m0s",
        "cacheUnauthorizedTTL": "30s"
      }
    },
    "registryPullQPS": 5,
    "registryBurst": 10,
    "eventRecordQPS": 50,
    "eventBurst": 100,
    "enableDebuggingHandlers": true,
    "healthzPort": 10248,
    "healthzBindAddress": "127.0.0.1",
    "oomScoreAdj": -999,
    "clusterDomain": "cluster.local",
    "clusterDNS": [
      "172.30.0.10"
    ],
    "streamingConnectionIdleTimeout": "4h0m0s",
    "nodeStatusUpdateFrequency": "10s",
    "nodeStatusReportFrequency": "5m0s",
    "nodeLeaseDurationSeconds": 40,
    "imageMinimumGCAge": "2m0s",
    "imageMaximumGCAge": "0s",
    "imageGCHighThresholdPercent": 85,
    "imageGCLowThresholdPercent": 80,
    "volumeStatsAggPeriod": "1m0s",
    "cgroupsPerQOS": false,
    "cgroupDriver": "cgroupfs",
    "cpuManagerPolicy": "none",
    "cpuManagerReconcilePeriod": "10s",
    "memoryManagerPolicy": "None",
    "topologyManagerPolicy": "none",
    "topologyManagerScope": "container",
    "runtimeRequestTimeout": "10m0s",
    "hairpinMode": "promiscuous-bridge",
    "maxPods": 250,
    "podPidsLimit": -1,
    "resolvConf": "",
    "cpuCFSQuota": true,
    "cpuCFSQuotaPeriod": "100ms",
    "nodeStatusMaxImages": 50,
    "maxOpenFiles": 1000000,
    "contentType": "application/vnd.kubernetes.protobuf",
    "kubeAPIQPS": 50,
    "kubeAPIBurst": 100,
    "serializeImagePulls": false,
    "evictionHard": {
      "imagefs.available": "15%",
      "nodefs.available": "10%"
    },
    "evictionPressureTransitionPeriod": "5m0s",
    "enableControllerAttachDetach": true,
    "makeIPTablesUtilChains": true,
    "iptablesMasqueradeBit": 14,
    "iptablesDropBit": 15,
    "featureGates": {
      "RotateKubeletServerCertificate": true
    },
    "failSwapOn": true,
    "memorySwap": {},
    "containerLogMaxSize": "50Mi",
    "containerLogMaxFiles": 5,
    "containerLogMaxWorkers": 1,
    "containerLogMonitorInterval": "10s",
    "configMapAndSecretChangeDetectionStrategy": "Watch",
    "systemReserved": {
      "cpu": "500m",
      "ephemeral-storage": "1Gi",
      "memory": "2Gi"
    },
    "enforceNodeAllocatable": [
      "none"
    ],
    "volumePluginDir": "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
    "logging": {
      "format": "text",
      "flushFrequency": "5s",
      "verbosity": 2,
      "options": {
        "text": {
          "infoBufferSize": "0"
        },
        "json": {
          "infoBufferSize": "0"
        }
      }
    },
    "enableSystemLogHandler": true,
    "enableSystemLogQuery": true,
    "shutdownGracePeriod": "0s",
    "shutdownGracePeriodCriticalPods": "0s",
    "crashLoopBackOff": {},
    "enableProfilingHandler": true,
    "enableDebugFlagsHandler": true,
    "seccompDefault": false,
    "memoryThrottlingFactor": 0.9,
    "registerWithTaints": [
      {
        "key": "os",
        "value": "Windows",
        "effect": "NoSchedule"
      }
    ],
    "registerNode": true,
    "localStorageCapacityIsolation": true,
    "containerRuntimeEndpoint": "npipe://./pipe/containerd-containerd",
    "failCgroupV1": false
  }
}

@jrvaldes
Copy link
Contributor Author

/test vsphere-e2e-operator

1 similar comment
@jrvaldes
Copy link
Contributor Author

/test vsphere-e2e-operator

@sebsoto
Copy link
Contributor

sebsoto commented Feb 14, 2025

/hold

Needs a JIRA ticket

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 14, 2025
@jrvaldes jrvaldes marked this pull request as draft February 18, 2025 22:10
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 18, 2025
@jrvaldes
Copy link
Contributor Author

Moved to draft to avoid trigger the e2e jobs

This commit replaces the hard-coded resource names for the SystemReserved
in the Kubelet configuration for the corresponding constants, so that
it can react to changes and consistency.
This commit set the reserved memory for the Windows host with at least 2GiB
following upstream recommendations for kubelet running on Windows.
This commit introduces EnforceNodeAllocatable with value `none` in the
kubelet configuration to avoid post-processing the generated configuration.

Fixes https://issues.redhat.com/browse/WINC-926
This commit explicitly set available hard-evictions thresholds for Windows.
Given, the values passed are subtracted from Capacity to calculate the node
allocatable to avoid defaulting to Linux-only signals.
@jrvaldes jrvaldes force-pushed the kubelet-config-updates branch from 1eca4a5 to 4a9b9cc Compare February 19, 2025 14:49
@jrvaldes jrvaldes changed the title Adjust kubelet configuration for NodeAllocatable, EvictionHard and System Memory WINC-1374,WINC-926,WINC-1373: Adjust kubelet configuration for NodeAllocatable, EvictionHard and System Memory Feb 19, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 19, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 19, 2025

@jrvaldes: This pull request references WINC-1374 which is a valid jira issue.

This pull request references WINC-926 which is a valid jira issue.

This pull request references WINC-1373 which is a valid jira issue.

In response to this:

In this PR

  • stop using hard-coded resource names for the SystemReserved in the Kubelet configuration for the corresponding constants
  • set the reserved memory for the Windows host with at least 2GiB following upstream recommendations for kubelet running on Windows
  • introduces EnforceNodeAllocatable with value none in the kubelet configuration to avoid post-processing the generated configuration (WINC-926)
  • explicitly set available hard-evictions thresholds for Windows

In addition, aligns the e2e test with the proposed configuration.

Resulting kubelet configuration with the proposed changes.

{
 "kubeletconfig": {
   "enableServer": true,
   "podLogsDir": "/var/log/pods",
   "syncFrequency": "1m0s",
   "fileCheckFrequency": "20s",
   "httpCheckFrequency": "20s",
   "address": "0.0.0.0",
   "port": 10250,
   "rotateCertificates": true,
   "serverTLSBootstrap": true,
   "authentication": {
     "x509": {
       "clientCAFile": "C:\\k\\kubelet-ca.crt"
     },
     "webhook": {
       "enabled": true,
       "cacheTTL": "2m0s"
     },
     "anonymous": {
       "enabled": false
     }
   },
   "authorization": {
     "mode": "Webhook",
     "webhook": {
       "cacheAuthorizedTTL": "5m0s",
       "cacheUnauthorizedTTL": "30s"
     }
   },
   "registryPullQPS": 5,
   "registryBurst": 10,
   "eventRecordQPS": 50,
   "eventBurst": 100,
   "enableDebuggingHandlers": true,
   "healthzPort": 10248,
   "healthzBindAddress": "127.0.0.1",
   "oomScoreAdj": -999,
   "clusterDomain": "cluster.local",
   "clusterDNS": [
     "172.30.0.10"
   ],
   "streamingConnectionIdleTimeout": "4h0m0s",
   "nodeStatusUpdateFrequency": "10s",
   "nodeStatusReportFrequency": "5m0s",
   "nodeLeaseDurationSeconds": 40,
   "imageMinimumGCAge": "2m0s",
   "imageMaximumGCAge": "0s",
   "imageGCHighThresholdPercent": 85,
   "imageGCLowThresholdPercent": 80,
   "volumeStatsAggPeriod": "1m0s",
   "cgroupsPerQOS": false,
   "cgroupDriver": "cgroupfs",
   "cpuManagerPolicy": "none",
   "cpuManagerReconcilePeriod": "10s",
   "memoryManagerPolicy": "None",
   "topologyManagerPolicy": "none",
   "topologyManagerScope": "container",
   "runtimeRequestTimeout": "10m0s",
   "hairpinMode": "promiscuous-bridge",
   "maxPods": 250,
   "podPidsLimit": -1,
   "resolvConf": "",
   "cpuCFSQuota": true,
   "cpuCFSQuotaPeriod": "100ms",
   "nodeStatusMaxImages": 50,
   "maxOpenFiles": 1000000,
   "contentType": "application/vnd.kubernetes.protobuf",
   "kubeAPIQPS": 50,
   "kubeAPIBurst": 100,
   "serializeImagePulls": false,
   "evictionHard": {
     "imagefs.available": "15%",
     "nodefs.available": "10%"
   },
   "evictionPressureTransitionPeriod": "5m0s",
   "enableControllerAttachDetach": true,
   "makeIPTablesUtilChains": true,
   "iptablesMasqueradeBit": 14,
   "iptablesDropBit": 15,
   "featureGates": {
     "RotateKubeletServerCertificate": true
   },
   "failSwapOn": true,
   "memorySwap": {},
   "containerLogMaxSize": "50Mi",
   "containerLogMaxFiles": 5,
   "containerLogMaxWorkers": 1,
   "containerLogMonitorInterval": "10s",
   "configMapAndSecretChangeDetectionStrategy": "Watch",
   "systemReserved": {
     "cpu": "500m",
     "ephemeral-storage": "1Gi",
     "memory": "2Gi"
   },
   "enforceNodeAllocatable": [
     "none"
   ],
   "volumePluginDir": "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
   "logging": {
     "format": "text",
     "flushFrequency": "5s",
     "verbosity": 2,
     "options": {
       "text": {
         "infoBufferSize": "0"
       },
       "json": {
         "infoBufferSize": "0"
       }
     }
   },
   "enableSystemLogHandler": true,
   "enableSystemLogQuery": true,
   "shutdownGracePeriod": "0s",
   "shutdownGracePeriodCriticalPods": "0s",
   "crashLoopBackOff": {},
   "enableProfilingHandler": true,
   "enableDebugFlagsHandler": true,
   "seccompDefault": false,
   "memoryThrottlingFactor": 0.9,
   "registerWithTaints": [
     {
       "key": "os",
       "value": "Windows",
       "effect": "NoSchedule"
     }
   ],
   "registerNode": true,
   "localStorageCapacityIsolation": true,
   "containerRuntimeEndpoint": "npipe://./pipe/containerd-containerd",
   "failCgroupV1": false
 }
}

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 openshift-eng/jira-lifecycle-plugin repository.

@jrvaldes
Copy link
Contributor Author

/hold

Needs a JIRA ticket

/hold cancel

@jrvaldes
Copy link
Contributor Author

Jira cards created and linked to the PR

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 19, 2025
@jrvaldes
Copy link
Contributor Author

/test vsphere-e2e-operator

@jrvaldes
Copy link
Contributor Author

/test unit

@jrvaldes
Copy link
Contributor Author

/test lint

Copy link
Contributor

openshift-ci bot commented Feb 19, 2025

@jrvaldes: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/azure-e2e-operator 1eca4a5 link true /test azure-e2e-operator
ci/prow/aws-e2e-operator 1eca4a5 link true /test aws-e2e-operator
ci/prow/azure-e2e-upgrade 1eca4a5 link true /test azure-e2e-upgrade
ci/prow/nutanix-e2e-operator 1eca4a5 link true /test nutanix-e2e-operator
ci/prow/vsphere-proxy-e2e-operator 1eca4a5 link true /test vsphere-proxy-e2e-operator
ci/prow/vsphere-disconnected-e2e-operator 1eca4a5 link true /test vsphere-disconnected-e2e-operator

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@jrvaldes
Copy link
Contributor Author

/test gcp-e2e-operator

@jrvaldes
Copy link
Contributor Author

/test vsphere-e2e-operator

Copy link
Contributor

openshift-ci bot commented Feb 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jrvaldes, mansikulkarni96

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2025
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants