Commit Graph

49698 Commits

Author SHA1 Message Date
Rodrigo Campos
a56d483df0 kubelet/userns: Use t.TempDir()
These tests will create the userns record mapping file, so let's use a
temporal directory for that.

Without specifying one, by mistake we were using the
"/tmp/non-existant-dir.This-is-not-used-in-tests/" directory.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-01 12:02:29 +01:00
Rodrigo Campos
0f7b9cc4f5 pkg/kubelet/userns: Simplify error messages
The error we are wrapping is already verbose, let's just use minimal
wrapping as it is usually the case in go code.

Note that the error on parseUserNsFileAndRecord() can be returned to the
user, so we added some context about user namespace. Otherwise, an error
to parse the json would not be clear to which of all the json the kubelet
parses it refers to.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-01 12:02:29 +01:00
Rodrigo Campos
fdc20de500 kubelet/userns: Wrap error message
Most error messages are properly wrapped already, but this was missing.

The kubelet logs will show something like this now:

	E0201 12:00:03.505680 3007049 run.go:74] "command failed" err="failed to run Kubelet: failed to create kubelet: record pod mappings: create user namespace store: mkdir XXX: permission denied"

Before this commit, the message was not so clear:

	E0120 16:02:40.484404  474711 run.go:74] "command failed" err="failed to run Kubelet: failed to create kubelet: mkdir XXX: permission denied"

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-02-01 12:02:06 +01:00
NoicFank
227c1915db enhancement(scheduler): share waitingPods among profiles 2024-02-01 10:06:23 +08:00
Hemant Kumar
d190fa3e7d Fix race condition between external-resizer and kubelet
This fixes the race condition that could happen because
resize controller just finished volume expansiona and has only
finished marking PV and yet to mark PVC.

The workaround proposed here should not be necessary once
RecoverVolumeExpansionFailure goes GA/beta.
2024-01-31 12:23:56 -05:00
Jan Safranek
593654eaa3 Fix cleanup of file subpaths
Allow kubelet orphan cleanup to delete both files and empty directories as
subpath mount points.

A pod does not need to use a directory as a subpath, it can use a file
(unix domain socket, pipe, ...) too. Therefore the cleanup should use
`os.Remove` that deletes both files and empty directories.
2024-01-31 15:13:03 +01:00
Huan Yan
01dbb85974 fix: correct incorrect comment & function name about SchedulingGated 2024-01-31 11:27:14 +08:00
Kubernetes Prow Robot
46c9bd1267 Merge pull request #123039 from tallclair/configutil
Clean up single use pkg/util/config
2024-01-30 18:03:54 -08:00
Kubernetes Prow Robot
7080b51ee9 Merge pull request #123038 from alculquicondor/sched_metric
Fix deprecated version for pod_scheduling_duration_seconds
2024-01-30 16:49:30 -08:00
Aldo Culquicondor
b8c19dd1d2 Fix deprecated version for pod_scheduling_duration_seconds
Change-Id: Ia0ad9381057a4a1a4a4490861a0d7c1a7ba800cb
2024-01-30 23:41:49 +00:00
Kubernetes Prow Robot
c5de44f9a4 Merge pull request #121978 from carlory/fix-101332
Remove deprecated comment about cleanup the target_path of CSI volumes
2024-01-30 15:27:59 -08:00
Tim Allclair
77f03c1744 Don't export single-use types 2024-01-30 12:02:23 -08:00
Tim Allclair
01155f59c3 Merge pkg/util/config into pkg/kubelet/config 2024-01-30 11:57:35 -08:00
Tim Allclair
049261aca1 Delete unused config utilities 2024-01-30 11:46:18 -08:00
Kubernetes Prow Robot
fedb5842e5 Merge pull request #122807 from carlory/fix-121472
Fix AtomicWriter may not create user visible files after kubelet was restarted
2024-01-30 04:19:26 -08:00
carlory
e198938671 Remove deprecated comment about cleanup the target_path of CSI volumes 2024-01-30 18:47:59 +08:00
carlory
77fed9d2b7 fix GenerateUnmapVolumeFunc missing globalUnmapPath when kubelet tries to clean up all volumes that failed reconstruction. 2024-01-30 17:29:54 +08:00
xigang
f589b911f8 node_controller: improve taint eviction queue add worker time args
Signed-off-by: xigang <wangxigang2014@gmail.com>
2024-01-30 10:18:59 +08:00
Kubernetes Prow Robot
7f5cd1961c Merge pull request #122961 from alexanderConstantinescu/kep-3458-stable
KEP 3458 - promote to stable
2024-01-29 15:19:08 -08:00
Kubernetes Prow Robot
0209c546fd Merge pull request #121824 from carlory/clean-112
adc remove stale comments
2024-01-29 14:13:17 -08:00
Kubernetes Prow Robot
c55848a724 Merge pull request #122958 from cyclinder/mark_kubeproxy_drainingTerminatingNodes_beta
kep-3836: promote to beta in 1.30
2024-01-29 10:26:34 -08:00
Kubernetes Prow Robot
56ee53faf5 Merge pull request #110601 from claudiubelu/path-filepath-update
Replaces path.Operation with filepath.Operation
2024-01-29 06:49:26 -08:00
Kubernetes Prow Robot
bb3030bf0e Merge pull request #121995 from carlory/fix-getDeviceNameFromMount
fix incorrect getDeviceNameFromMount comment
2024-01-29 05:40:53 -08:00
Kubernetes Prow Robot
9e34bac02a Merge pull request #119395 from carlory/patch-expand-001
getPersistentVolume remove reduant deep copy
2024-01-29 05:40:40 -08:00
Kubernetes Prow Robot
eb0fcf9e21 Merge pull request #123007 from sanposhiho/correct-doc
fix(scheduler/metrics) correct the documentation on `plugin_evaluation_total`
2024-01-28 20:36:01 -08:00
Kubernetes Prow Robot
27ad20db35 Merge pull request #123005 from danwinship/minor-proxy-cleanup
Minor proxy cleanup
2024-01-28 08:44:38 -08:00
Dan Winship
da05076868 Reorganize a bit of winkernel proxier setup
Rather than doing winkernel-specific parsing of generic config data in
cmd/kube-proxy, do it in pkg/proxy/winkernel.
2024-01-28 09:30:51 -05:00
Dan Winship
33bd5fb3c4 Remove unused param to winkernel proxier
The winkernel code was originally based on the iptables code but never
made use of some parts of it. (e.g., it logs a warning if you didn't
set `--cluster-cidr`, even though it doesn't actually use
`--cluster-cidr` if you do set it.)
2024-01-28 09:30:51 -05:00
Kensei Nakada
a62579a5eb fix(scheduler/metrics) correct the documentation on plugin_evaluation_total 2024-01-28 02:59:17 +00:00
Kubernetes Prow Robot
c606448922 Merge pull request #122996 from Huang-Wei/cleanup-dra-postfilter
DRA: always returns Unschedulable in PostFilter
2024-01-27 08:19:44 -08:00
Kubernetes Prow Robot
7abf6770fd Merge pull request #122147 from pohly/kubelet-context-support
kubelet: enhance context support
2024-01-27 05:16:17 -08:00
Daniel Hu
1baf7d4586 Corrected some spelling and grammatical errors
Signed-off-by: Daniel Hu <farmer.hutao@outlook.com>
2024-01-27 10:10:25 +08:00
Alexander Zielenski
768c169dd8 feature: promote CRDValidationRatcheting to beta
also fixup test which needs feature to be disabled
it was set to enable by default in this CL
2024-01-26 13:17:17 -08:00
Abu Kashem
5f75c35edf apiserver: allow zero value for the 'nominalConcurrencyShares' field 2024-01-26 15:55:50 -05:00
Kubernetes Prow Robot
02aaad0de9 Merge pull request #121876 from pohly/dra-reserve-during-pod-binding
dra: reserve + publish during pod binding
2024-01-26 19:58:01 +01:00
Mark Rossetti
85684ec485 fixing issue with GetCPUUsageNanoCores on Windows 2024-01-26 10:37:21 -08:00
Alexander Constantinescu
a15f437669 KEP 3458 - promote to stable 2024-01-26 19:22:15 +01:00
Wei Huang
ceabc4aba8 DRA: always returns Unschedulable in PostFilter 2024-01-26 09:44:00 -08:00
Kubernetes Prow Robot
7811ba3d4d Merge pull request #122872 from tnqn/fix-ClusterIPOutOfRange-warning
Reduce verbose logs in MetaAllocator
2024-01-26 17:53:16 +01:00
Kubernetes Prow Robot
c4feb19195 Merge pull request #122878 from liggitt/typecheck-kube-proxy-darwin
Re-allow building kube-proxy on all platforms
2024-01-26 16:32:12 +01:00
Kubernetes Prow Robot
053acbed90 Merge pull request #122724 from nayihz/feat_nft_nodeport_addr
change --nodeport-addresses behavior to default to primary node ip only
2024-01-26 16:32:03 +01:00
Patrick Ohly
6cf4203751 dra scheduler: reformat code
By continuing with the next item in the if clause, the else is no longer needed
and indention can be reduced.
2024-01-26 10:58:03 +01:00
Patrick Ohly
a809a6353b scheduler: publish PodSchedulingContext during PreBind
Blocking API calls during a scheduling cycle like the DRA plugin is doing slow
down overall scheduling, i.e. also affecting pods which don't use DRA.

It is easy to move the blocking calls into a goroutine while the scheduling
cycle ends with "pod unschedulable". The hard part is handling an error when
those API calls then fail in the background. There is a solution for that
(see https://github.com/kubernetes/kubernetes/pull/120963), but it's complex.

Instead, publishing the modified PodSchedulingContext can also be done
later. In the more common case of a pod which is ready for binding except for
its claims, that'll be in PreBind, which runs in a separate goroutine already.

In the less common case that a pod cannot be scheduled, that'll be in
Unreserve which is still blocking.
2024-01-26 10:58:03 +01:00
Patrick Ohly
5d1509126f dra: patch ReservedFor during PreBind
This moves adding a pod to ReservedFor out of the main scheduling cycle into
PreBind. There it is done concurrently in different goroutines. For claims
which were specifically allocated for a pod (the most common case), that
usually makes no difference because the claim is already reserved.

It starts to matter when that pod then cannot be scheduled for other reasons,
because then the claim gets unreserved to allow deallocating it. It also
matters for claims that are created separately and then get used multiple times
by different pods.

Because multiple pods might get added to the same claim rapidly independently
from each other, it makes sense to do all claim status updates via patching:
then it is no longer necessary to have an up-to-date copy of the claim because
the patch operation will succeed if (and only if) the patched claim is valid.

Server-side-apply cannot be used for this because a client always has to send
the full list of all entries that it wants to be set, i.e. it cannot add one
entry unless it knows the full list.
2024-01-26 10:58:03 +01:00
Kubernetes Prow Robot
e023511deb Merge pull request #122920 from danwinship/knftables-migration
Update knftables, with new sigs.k8s.io module name
2024-01-26 07:14:16 +01:00
Jordan Liggitt
6a60a1ddad Mark conntrack/fake as linux-only, add non-OS doc.go 2024-01-25 23:15:49 -05:00
Kubernetes Prow Robot
3da22db11c Merge pull request #121499 from matte21/add-comments-to-cpu-accumulator
Improve understandability of kubelet's cpu accumulator code
2024-01-26 00:56:21 +01:00
Dan Winship
ebba2d4472 Move some code in the proxiers
For no real reason, the core Proxier definitions weren't at the start
of the files.

(This just moves code around. It doesn't change anything.)
2024-01-25 18:41:58 -05:00
Kubernetes Prow Robot
6c493a1ef9 Merge pull request #122969 from kerthcet/fix/claim
[DRA] Fix indexing the error value in unavailableClaim
2024-01-25 17:34:11 +01:00
kerthcet
7801173f6e get the error claim in dra
Signed-off-by: kerthcet <kerthcet@gmail.com>
2024-01-25 23:22:50 +08:00