Commit Graph

49698 Commits

Author SHA1 Message Date
Sharpz7
7e4b5d0d49 Final Fix 2023-09-08 14:44:22 +00:00
Kubernetes Prow Robot
c084719291 Merge pull request #120509 from aojea/aojea_cp_owner
add aojea as controplane reviewer
2023-09-08 02:48:26 -07:00
Kubernetes Prow Robot
a64a3e16ec Merge pull request #120253 from pohly/dra-scheduler-podschedulingcontext-updates
dra scheduler: refactor PodSchedulingContext updates
2023-09-08 02:48:14 -07:00
Stephen Kitt
aa89e6dc97 Use ptr.To to retrieve intstr addresses
This uses the generic ptr.To in k8s.io/utils to replace functions and
code constructs which only serve to return pointers to intstr
values. Other uses of the deprecated pointer package are updated in
modified files.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-09-08 11:10:50 +02:00
Kubernetes Prow Robot
80cd9d7a9a Merge pull request #120105 from princepereira/ppereira-kubeproxy-mock-tests
New mock test framework for windows kubeproxy.
2023-09-08 00:32:14 -07:00
Sascha Grunert
5e0931336b kubelet: fix metric container_start_time_seconds's timestamp
Adapting the tests and reverting https://github.com/kubernetes/kubernetes/pull/103429

Carry-over from https://github.com/kubernetes/kubernetes/pull/117881

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-09-08 09:13:37 +02:00
Patrick Ohly
5c7dac2d77 dra scheduler: refactor PodSchedulingContext updates
Instead of modifying the PodSchedulingContext and then creating or updating it,
now the required changes (selected node, potential nodes) are tracked and the
actual input for an API call is created if (and only if) needed at the end.

This makes the code easier to read and change. In particular, replacing the
Update call with Patch or Apply is easy.
2023-09-08 08:06:06 +02:00
Prince Pereira
7dea3d6c3b New mock test framework for windows kubeproxy. 2023-09-08 08:38:46 +05:30
Antonio Ojea
3a1a67e33d add aojea as controplane reviewer
Change-Id: Ie1aa38791c1cf1399c762120e687fedd360f6067
2023-09-07 21:26:32 +00:00
Kubernetes Prow Robot
440eb7eadb Merge pull request #119495 from bzsuni/cleanup/api/legacyBetaEnabledByDefaultResources
remove resource flowschemas and prioritylevelconfigurations from legacyBetaEnabledByDefaultResources in v1.29
2023-09-07 08:10:58 -07:00
Kubernetes Prow Robot
58ce734223 Merge pull request #120255 from likakuli/feat-addreferenceonlyfirsttime
feat: minimize unnecessary API requests to the API server for the configmap/secret get API
2023-09-07 06:42:57 -07:00
Kubernetes Prow Robot
2d5b6f16f5 Merge pull request #120213 from pohly/dra-scheduler-resourceclass-missing
dra: resourceclass missing
2023-09-06 23:47:09 -07:00
Kubernetes Prow Robot
b27670dfbd Merge pull request #118740 from saschagrunert/kubelet-label-types
Make kubelet label types public
2023-09-06 23:46:57 -07:00
Francesco Romani
2ea47038b9 podresources: e2e: force eager connection
Add and use more facilities to the *internal* podresources client.
Checking e2e test runs, we have quite some
```
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial unix /var/lib/kubelet/pod-resources/kubelet.sock: connect: connection refused": rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial unix /var/lib/kubelet/pod-resources/kubelet.sock: connect: connection refused"
```

This is likely caused by kubelet restarts, which we do plenty in e2e tests,
combined with the fact gRPC does lazy connection AND we don't really
check the errors in client code - we just bubble them up.

While it's arguably bad we don't check properly error codes, it's also
true that in the main case, e2e tests, the functions should just never
fail besides few well known cases, we're connecting over a
super-reliable unix domain socket after all.

So, we centralize the fix adding a function (alongside with minor
cleanups) which wants to trigger and ensure the connection happens,
localizing the changes just here. The main advantage is this approach
is opt-in, composable, and doesn't leak gRPC details into the client
code.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-09-07 08:24:49 +02:00
Lingyan Yin
f47661e1b7 fix inplace VPA stuck in InProgress when custom resources are specified
added unit tests

Co-authored-by: Shengjie Xue <3150104939@zju.edu.cn>
Co-authored-by: Zewei Ding <horace.d@outlook.com>
Co-authored-by: Jiaxin Shan <seedjeffwan@gmail.com>
2023-09-06 10:17:39 -07:00
Patrick Ohly
c682d2b8c5 scheduler: add ResourceClass events
When filtering fails because a ResourceClass is missing, we can treat the pod
as "unschedulable" as long as we then also register a cluster event that wakes
up the pod. This is more efficient than periodically retrying.
2023-09-06 11:14:08 +02:00
Fabian Fulga
2ad4304e8f Add Windows support for IPPVS
Added Windows support for InPlacePodVerticalScaling
2023-09-06 10:01:53 +03:00
Kubernetes Prow Robot
abb74c7afa Merge pull request #120412 from aojea/proxy_invalid
only drop invalid cstate packets if non liberal
2023-09-05 21:32:50 -07:00
Sharpz7
43fc6b5bdb Added suggests changes 2023-09-06 03:05:14 +00:00
Kubernetes Prow Robot
debe30de70 Merge pull request #120281 from gjkim42/feature-gate-sidecar-containers-in-kuberuntime
Feature-gate SidecarContainers code in pkg/kubelet/kuberuntime
2023-09-05 18:34:54 -07:00
Kubernetes Prow Robot
a7f9e70384 Merge pull request #120413 from pohly/scheduler-in-flight-events-fix
scheduler: fix tracking of concurrent events
2023-09-05 15:17:03 -07:00
Kubernetes Prow Robot
f68c66f96d Merge pull request #119142 from aramase/aramase/f/kep_3331_add_feature_flag
[StructuredAuthenticationConfig] Add feature flag and wire up `--authentication-config` flag
2023-09-05 13:08:51 -07:00
Patrick Ohly
c131c92b9f scheduler: unit test case for concurrent event with other pod
The problematic scenario was having one pod in flight, one event in the list,
and then detecting a concurrent event for a second pod after the first pod is
done. The new test case covers that.

To make it work without assumptions about the implementation, the QueuedPodInfo
returned by Pop must be the one passed to AddUnschedulableIfNotPresent
after (potentially) populating UnschedulablePlugins. This is done via callback
functions which bind to the same shared variable.
2023-09-05 21:01:13 +02:00
Kubernetes Prow Robot
73580b2038 Merge pull request #120336 from pohly/dra-generated-name-hyphen
resource claim controller: separate generated suffix from base
2023-09-05 11:22:51 -07:00
Patrick Ohly
cd943dd95e scheduler: fix tracking of concurrent events
The previous approach was based on the assumption that an in-flight pod can use
the head of the received event list as marker for identifying all events that
occur while the pod is in flight. That assumption is incorrect: when that
existing element gets removed from the list because all pods that were
in-flight when it was received are done, that marker's Next method returns nil
and the code which should have seen several concurrent events (if there were
any) missed all of those.

As a result, a pod with concurrent events could incorrectly get moved to the
unschedulable queue where it could got stuck until the next periodic purging
after 5 minutes if there was no other event for it.

The approach with maintaining a single list of concurrent events can be fixed
by inserting each in-flight pod into the list and using that element to
identify "more recent" events for the pod.
2023-09-05 19:58:38 +02:00
Antonio Ojea
933bcc123b only drop invalid cstate packets if non liberal
Conntrack invalid packets may cause unexpected and subtle bugs
on esblished connections, because of that we install by default an
iptables rules that drops the packets with this conntrack state.

However, there are network scenarios, specially those that use multihoming
nodes, that may have legit traffic that is detected by conntrack as
invalid, hence these iptables rules are causing problems dropping this
traffic.

An alternative to solve the spurious problems caused by the invalid
connectrack packets is to set the sysctl nf_conntrack_tcp_be_liberal
option, but this is a system wide setting and we don't want kube-proxy
to be opinionated about the whole node networking configuration.

Kube-proxy will only install the DROP rules for invalid conntrack states
if the nf_conntrack_tcp_be_liberal is not set.

Change-Id: I5eb326931ed915f5ae74d210f0a375842b6a790e
2023-09-05 14:16:17 +00:00
Kubernetes Prow Robot
8e2b12a220 Merge pull request #119068 from lauchokyip/podgc-unit-test
added podgc orphaned pod unit tests
2023-09-05 03:19:49 -07:00
Kubernetes Prow Robot
9fca4ec44a Merge pull request #120399 from SataQiu/clean-scheduler-20230904
scheduler: remove unused constant SchedulerPolicyConfigMapKey
2023-09-05 00:05:52 -07:00
bzsuni
14e7d97151 Remove GA featuregate for JobTrackingWithFinalizers in 1.28
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2023-09-05 14:25:02 +08:00
tao.yang
b35357b6c0 cleanup: omit comparison with bool constants
Signed-off-by: tao.yang <tao.yang@daocloud.io>
2023-09-05 10:24:38 +08:00
bzsuni
7c33b78418 remove resource flowschemas and prioritylevelconfigurations for legacyBetaEnabledByDefaultResources in v1.29
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2023-09-04 21:54:51 +08:00
Kubernetes Prow Robot
5d94b2a8e8 Merge pull request #118709 from ty-dc/pr/ut
[UT] add ut for pkg/registry/networking/ipaddress
2023-09-04 02:49:48 -07:00
SataQiu
cae090e7fe scheduler: remove unused constant SchedulerPolicyConfigMapKey 2023-09-04 17:48:36 +08:00
Patrick Ohly
3c2cfd9a4f resource claim controller: separate generated suffix from base
When the resource claim name inside the pod had some suffix like "1a" in
"resource-1a", the generated name suffix got added directly after that, leading
to "my-pod-resource-1ax6zgt".

Adding another hyphen makes the result more readable: "my-pod-resource-1a-x6zgt".
2023-09-04 09:45:25 +02:00
David Leadbeater
2c5a11a55b Match on cri-o socket suffix only
This deals with the case that a user can configure cri-o to use
/run/crio/crio.sock and get very confusing behavior.

See https://github.com/cri-o/cri-o/issues/7010#issuecomment-1594149469
2023-09-04 15:08:20 +10:00
Kubernetes Prow Robot
d4050a80c7 Merge pull request #119394 from aroradaman/fix/proxy-conntrack
Fix stale conntrack flow detection logic
2023-09-03 14:53:46 -07:00
Kubernetes Prow Robot
03762cbcb5 Merge pull request #120316 from dims/move-to-new-repo-for-reference
New repo who dis? distribution/reference
2023-09-02 21:05:11 -07:00
Davanum Srinivas
ceaed508ce Validate the cloud-provider passed in and the corresponding feature flags
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-09-02 13:08:04 -04:00
Daman Arora
2e5f17166b pkg/proxy: fix stale detection logic
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-09-02 12:45:19 +05:30
Davanum Srinivas
42e8cfa28a fix failing metadata test
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-09-01 15:22:07 -04:00
Davanum Srinivas
cdcbfcc0a6 [KEP-2395] Phase 4 - Disabling In-Tree Providers
https://github.com/kubernetes/enhancements/tree/master/keps/sig-cloud-provider/2395-removing-in-tree-cloud-providers#phase-4---disabling-in-tree-providers

DisableCloudProviders - this feature gate will disable any functionality
in kube-apiserver, kube-controller-manager and kubelet related to the
--cloud-provider component flag.

DisableKubeletCloudCredentialProvider - this feature gate will disable
in-tree functionality in the kubelet to authenticate to the Azure and
GCP container registries for image pull credentials.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-09-01 15:22:07 -04:00
Kubernetes Prow Robot
470fe396bd Merge pull request #120275 from danwinship/kep-3705-to-beta
Bump CloudDualStackNodeIPs to beta for 1.29
2023-09-01 11:28:43 -07:00
Kubernetes Prow Robot
1cadbd5887 Merge pull request #120172 from DrAuYueng/fix-log-in-deployment-controller
Fix pod deletion log in deployment controller
2023-09-01 11:28:31 -07:00
Quan Tian
0fb1f59a88 Improve service unit test failure report
Mark the helper functions with t.Helper() so that if t.Errorf() in these
functions gets called, it will report that the failure occurred on the
line number of the caller of the helper, rather than the line number of
the helper itself, which makes it hard to identify which case causes the
failure.

Signed-off-by: Quan Tian <qtian@vmware.com>
2023-09-01 23:18:45 +08:00
charles-chenzz
bb695ac67a eviction manager: add test case with localStorageCapacityIsolation open 2023-09-01 18:32:48 +08:00
Kubernetes Prow Robot
efadb94a74 Merge pull request #120259 from SataQiu/clean-apf-20230830
apf: remove v1alpha1 API
2023-08-31 19:44:42 -07:00
Kubernetes Prow Robot
36352ba306 Merge pull request #120233 from xuzhenglun/master
KEP-3668: promote ServiceNodePortStaticSubrange to stable
2023-08-31 19:44:31 -07:00
Davanum Srinivas
fcff996909 adjust error message a bit
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-08-31 21:53:43 -04:00
Davanum Srinivas
889c8e919b New repo who dis? distribution/reference
github.com/docker/distribution/reference has a new home github.com/distribution/reference

and a new tag v0.5.0. Let's switch to that.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-08-31 21:53:40 -04:00
Albert Sverdlov
a46bab6930 Fix a job quota related deadlock (#119776)
* Fix a job quota related deadlock

In case ResourceQuota is used and sets a max # of jobs, a CronJob may get
trapped in a deadlock:
  1. Job quota for a namespace is reached.
  2. CronJob controller can't create a new job, because quota is
     reached.
  3. Cleanup of jobs owned by a cronjob doesn't happen, because a
     control loop iteration is finished because of an error to create a
     job.

To fix this we stop early quitting from a control loop iteration when
cronjob reconciliation failed and always let old jobs to be cleaned up.

* Dont reorder imports

* Don't stop requeuing on reconciliation error

Previous code only logged the reconciliation error inside jm.sync() and
didn't return the reconciliation error to it's invoker
processNextWorkItem().

Adding a copy-paste back to avoid this issue.

* Remove copy-pasted cleanupFinishedJobs()

Now we always call jm.cleanupFinishedJobs() first and then
jm.syncCronJob().

We also extract cronJobCopy and updateStatus outside jm.syncCronJob
function and pass pointers to them in both jm.syncCronJob and
jm.cleanupFinishedJobs to make delayed updates handling more explicit
and not dependent on the order in which cleanupFinishedJobs and
syncCronJob are invoked.

* Return updateStatus bool instead of changing the reference

* Explicitly ignore err in tests to fix linter
2023-08-31 08:25:00 -07:00