Commit Graph

40 Commits

Author SHA1 Message Date
Swati Sehgal
d536a342b4 node: topologymgr: GA graduation implies Feature Gate is ON by default
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2023-03-06 12:51:05 +00:00
ruiwen-zhao
572e6e0ffb Add MaxParallelImagePulls support
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2023-03-02 03:57:59 +00:00
Paco Xu
f28f40e521 remove a flag check that was introduced in #112542; address several comments
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-12-13 14:00:29 +08:00
Dmitry Verkhoturov
d0f9e6dc36 clarify CPUCFSQuotaPeriod values, set the minimum to 1ms
cpu.cfs_period_us is measured in microseconds in the kernel but
provided in time.Duration by the user, that change clarifies the code
to make this evident to the reader.

Also, the minimum value for that feature is 1ms and not 1μs, and this
change alters the validation to reject values smaller than 1ms.
2022-09-08 23:29:13 +02:00
Antonio Ojea
d434c588d7 Revert "change CPUCFSQuotaPeriod default value to 100us to match Linux default"
This reverts commit f2d591fae6.
2022-08-26 23:51:04 +02:00
Dmitry Verkhoturov
f2d591fae6 change CPUCFSQuotaPeriod default value to 100us to match Linux default
cpu.cfs_period_us is 100μs by default despite having an "ms" unit
for some unfortunate reason. Documentation:
https://www.kernel.org/doc/html/latest/scheduler/sched-bwc.html#management

The desired effect of that change is to match
k8s default `CPUCFSQuotaPeriod` value (100ms before that change)
with one used in k8s without the `CustomCPUCFSQuotaPeriod` flag enabled
and Linux CFS (100us, 1000x smaller than 100ms).
2022-08-10 03:25:05 +02:00
Sally O'Malley
47e7d8034f
kubelet tracing
Signed-off-by: Sally O'Malley <somalley@redhat.com>
Co-authored-by: David Ashpole <dashpole@google.com>
2022-08-01 12:55:02 -04:00
Patrick Ohly
4c6338ac0f logs: replace config methods with functions
API types are only supposed to have methods related to serialization.
2022-06-17 20:22:13 +02:00
Patrick Ohly
ea3f25f49b logs: add alpha+beta feature gates
It is useful to have the ability to control whether alpha or beta features are
enabled. We can group features under LoggingAlphaOptions and LoggingBetaOptions
because the configuration is designed so that each feature individually must be
enabled via its own option.

Currently, the JSON format itself is beta (graduated in 1.23) but additional
options for it were only added in 1.23 and thus are still alpha:

  $ go run ./staging/src/k8s.io/component-base/logs/example/cmd/logger.go --logging-format=json --log-json-split-stream --log-json-info-buffer-size 1M --feature-gates LoggingBetaOptions=false
  [format: Forbidden: Log format json is BETA and disabled, see LoggingBetaOptions feature, options.json.splitStream: Forbidden: Feature LoggingAlphaOptions is disabled, options.json.infoBufferSize: Forbidden: Feature LoggingAlphaOptions is disabled]

  $ go run ./staging/src/k8s.io/component-base/logs/example/cmd/logger.go --logging-format=json --log-json-split-stream --log-json-info-buffer-size 1M
  [options.json.splitStream: Forbidden: Feature LoggingAlphaOptions is disabled, options.json.infoBufferSize: Forbidden: Feature LoggingAlphaOptions is disabled]

This is the same approach that was taken for CPUManagerPolicyAlphaOptions and
CPUManagerPolicyBetaOptions.

In order to test this without modifying the global feature gate in a test file,
ValidateKubeletConfiguration must take a feature gate as argument.
2022-06-17 20:22:13 +02:00
Patrick Ohly
1aceac797d logs: make LoggingConfiguration an unversioned API
Making the LoggingConfiguration part of the versioned component-base/config API
had the theoretic advantage that components could have offered different
configuration APIs with experimental features limited to alpha versions (for
example, sanitization offered only in a v1alpha1.KubeletConfiguration). Some
components could have decided to only use stable logging options.

In practice, this wasn't done. Furthermore, we don't want different components
to make different choices regarding which logging features they offer to
users. It should always be the same everywhere, for the sake of consistency.

This can be achieved with a saner Go API by dropping the distinction between
internal and external LoggingConfiguration types. Different stability levels of
indidividual fields have to be covered by documentation (done) and potentially
feature gates (not currently done).

Advantages:

- everything related to logging is under component-base/logs;
  previously this was scattered across different packages and
  different files under "logs" (why some code was in logs/config.go
  vs. logs/options.go vs. logs/logs.go always confused me again
  and again when coming back to the code):

  - long-term config and command line API are clearly separated
    into the "api" package underneath that

  - logs/logs.go itself only deals with legacy global flags and
    logging configuration

- removal of separate Go APIs like logs.BindLoggingFlags and
  logs.Options

- LogRegistry becomes an implementation detail, with less code
  and less exported functionality (only registration needs to
  be exported, querying is internal)
2022-06-17 20:22:13 +02:00
caozhiyuan
1a59bcb142 add validation test for RegisterWithTaints 2021-12-08 10:36:43 +08:00
shuheiktgw
35ad91ab37 Refactor Kubelet config validations 2021-11-18 22:31:31 +09:00
Shiming Zhang
7a6f792ff3 Add validation for GracefulNodeShutdownBasedOnPodPriority
Co-authored-by: Elana Hashman <ehashman@users.noreply.github.com>
2021-11-17 11:47:12 +08:00
caozhiyuan
bad4faf1b9 migrate --register-with-taints to KubeletConfiguration 2021-11-16 19:10:36 +08:00
Elana Hashman
642eff0c69
Rename NodeSwapEnabled flag to NodeSwap 2021-07-09 11:39:52 -07:00
Li Bo
c3d9b10ca8 feature: support Memory QoS for cgroups v2 2021-07-08 09:26:46 +08:00
Elana Hashman
39f32d7286
Ensure MemorySwapConfig can't be set without feature flag 2021-06-29 12:08:25 -07:00
Elana Hashman
d3fd1362ca
Rename NoSwap to LimitedSwap as workloads may still swap
Also made the options a kubelet type, address API review feedback
2021-06-29 12:08:21 -07:00
Elana Hashman
7342acb0b8
Add validation for KubeletConfig MemorySwap 2021-06-29 11:59:01 -07:00
Marek Siarkowicz
f9343f837d Use LoggingConfig within LogOptions
Co-authored-by: mengjiao.liu <mengjiao.liu@daocloud.io>
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
Co-authored-by: Heisenberg <yuzhiquanlong@gmail.com>
2021-06-15 17:14:43 +02:00
Artyom Lukianov
102124464a memory manager: improve the reserved memory validation logic
We will have two layers of the validation.

- the first part of the validation logic will be implemented under the
`ValidateKubeletConfiguration` method
- the second one that requires knowledge about machine topology and
node allocatable resources will be implemented under the memory manager.

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 01:10:02 +02:00
David Porter
16f71c6d47 Implement shutdown manager in kubelet
Implements KEP 2000, Graceful Node Shutdown:
https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2000-graceful-node-shutdown

* Add new FeatureGate `GracefulNodeShutdown` to control
enabling/disabling the feature
* Add two new KubeletConfiguration options
  * `ShutdownGracePeriod` and `ShutdownGracePeriodCriticalPods`
* Add new package, `nodeshutdown` that implements the Node shutdown
manager
  * The node shutdown manager uses the systemd inhibit package, to
  create an system inhibitor, monitor for node shutdown events, and
  gracefully terminate pods upon a node shutdown.
2020-11-12 21:47:55 +00:00
Krzysztof Wiatrzyk
ec552e6dc6 Add flag value validation of TopologyManagerPolicy
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:54 +01:00
Krzysztof Wiatrzyk
a05eead211 Add flag value validation of TopologyManagerScope
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:54 +01:00
sw.han
d070bff273 Add kubelet configuration flag 'topology-manager-scope'
add kubelet config option.
* --topology-manager-scope=[ container | pod ]
* default=container

Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:54 +01:00
Qiming Teng
40c4c7906d Use user facing field names in validation message 2020-11-05 13:53:06 +08:00
Karan Goel
a49760bfce Non-zero cfs quota period duration requires feature flag 2020-09-11 08:00:05 -07:00
amash
3ab25f1876 add LoggingConfiguration struct to component-base/config 2020-07-01 20:07:01 +04:30
amash
ac8d2e8978 add loggingConfig struct to kubelet config 2020-07-01 20:07:01 +04:30
amash
ba8189a4f2 add --logging-format flag to kubelet 2020-07-01 20:07:01 +04:30
Jordan Liggitt
71d77b54fd Promote RotateKubeletClientCertificate to GA 2020-06-05 18:45:01 -04:00
Amim Knabben
f6246aba6e Moving Kubelet --node-status-max-images flag to configuration 2020-05-21 22:37:01 -04:00
Marek Siarkowicz
d44d5b35f3 Add show-hidden-metrics-for-version to kubelet 2020-02-25 20:46:34 +01:00
Jianzhu Zhang
89dfd24483 added --reserved-cpus kubelet command option 2019-11-06 07:33:52 -05:00
nolancon
705f97e171 Enable feature gate and kubelet flags for Topology Manager
Nit: remove capitalization of preferred
Remove line from kubelet and add to separate PR for easier merge

nit: dependency added to separate PR

Add check to ensure strict policy cannot be set without feature gate enabled

Topology Manager runs "none" policy by default.

Added constants for policies and updated documentation.
2019-07-02 06:50:17 +01:00
Dr. Stefan Schimanski
37046e3028 Handle feature gate errors 2019-04-03 16:52:05 +02:00
tianshapjq
362f7e2a09 validate if systemReservedCgroup and kubeReservedCgroup compliance with enforNodeAllocatable 2018-09-12 15:17:03 +08:00
Sandor Szücs
588d2808b7
fix #51135 make CFS quota period configurable, adds a cli flag and config option to kubelet to be able to set cpu.cfs_period and defaults to 100ms as before.
It requires to enable feature gate CustomCPUCFSQuotaPeriod.

Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
2018-09-01 20:19:59 +02:00
Lucas Käldström
7a840cb4c8
automated: Rename all package references 2018-08-29 19:07:52 +03:00
Lucas Käldström
62bfe29ce4
automated, boring: Rename pkg/kubelet/apis/{kubelet,}config 2018-08-29 18:59:05 +03:00