Commit Graph

11746 Commits

Author SHA1 Message Date
Dave Chen
f407b31d42 kubeadm: Fix typo where API group is not correct
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-08-18 17:26:39 +08:00
Dave Chen
72af21e1a1 kubeadm: Cleanup the unused input parameters
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-08-18 17:20:22 +08:00
Dave Chen
1eb6282016 kubeadm: Move the method used only in the test to postupgrade_test.go
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-08-18 16:59:08 +08:00
xin.li
fd3f82531f kubeadm: increase ut coverage fo util/kubeconfig
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-08-18 14:49:59 +08:00
SataQiu
427b703c37 scheduler: remove deprecated v1beta2 KubeSchedulerConfiguration 2023-08-17 13:27:21 +08:00
Kubernetes Prow Robot
4f874a224a
Merge pull request #119562 from my-git9/proxyut
kubeadm: increase ut for cmd/kubeadm/app/phases/addons/proxy
2023-08-16 19:44:21 -07:00
git-jxj
a5b3a4b738
cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions
2023-08-16 09:33:01 -07:00
Lubomir I. Ivanov
7a6e056bbd kubeadm: add TODO for NewMapStringString() and CLI extra-args 2023-08-16 13:27:05 +03:00
Lubomir I. Ivanov
f3da0d4ed3 kubeadm: update the rest of the code base for structured ExtraArgs
In all places map[string]string compounds were used directly
for extra args. Modify said locations to use []Arg
and the new utilities Get/SetArgValue(), ArgumentsTo/FromCommand().
2023-08-16 13:27:05 +03:00
Lubomir I. Ivanov
a505c7160e kubeadm: adapt the validation and utils for structured ExtraArgs
Use []kubeadm.Arg instead of map[string]string when
validating ExtraArgs in the API.

Add new GetArgValue() and SetArgValue() utilities
and tests in apis/kubeadm.

Add new utils for constucting commands from and to
a []kubeadm.Arg slice.
2023-08-16 13:27:05 +03:00
Lubomir I. Ivanov
bc6fcb72a8 kubeadm: add structured ExtraArgs in v1beta4
Add a new type Arg that holds a dedicated Name and Value.
Instead of using map[string]string for ExtraArgs in the
API use []Arg.

Adapt v1beta3 conversion to convert to/from the
legacy map[string]string.
2023-08-16 13:27:05 +03:00
Kubernetes Prow Robot
b51ad13bf7
Merge pull request #119938 from my-git9/certlist-ut
kubeadm: increase ut for certs/certlist
2023-08-16 01:22:37 -07:00
Kubernetes Prow Robot
85e018634c
Merge pull request #119859 from SataQiu/fix-healthcheck-client-cert-20230809
kubeadm: remove 'system:masters' organization from etcd/healthcheck-client certificate
2023-08-16 01:22:26 -07:00
Kubernetes Prow Robot
0491866c64
Merge pull request #119753 from pacoxu/kubeadm-reset-nil
kubeadm: fix nil pointer when etcd member is already removed
2023-08-15 23:12:26 -07:00
Kubernetes Prow Robot
ad15077193
Merge pull request #119742 from liggitt/unwanted-deps
Catch direct references to unwanted dependencies in kubernetes modules
2023-08-15 21:04:27 -07:00
Kubernetes Prow Robot
b406e49123
Merge pull request #119515 from haojue/dev/postupgradecomment
adjust order and fix typo for kube upgrade
2023-08-15 19:42:50 -07:00
xin.li
4950521ad8 kubeadm: increase ut for certs/certlist
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-08-16 10:04:03 +08:00
Kubernetes Prow Robot
5054f2954d
Merge pull request #119279 from chendave/dryrun_init
kubeadm: Make dry-run is configurable in initConfiguration and joinConfiguration
2023-08-15 15:18:03 -07:00
Kubernetes Prow Robot
1acd489dca
Merge pull request #118455 from linxiulei/managedFields
Trim managedFields in controller-manager
2023-08-15 15:17:12 -07:00
Kubernetes Prow Robot
322acc0f88
Merge pull request #117977 from liggitt/available-resources
Drop AvailableResources from controller context
2023-08-15 15:16:39 -07:00
Patrick Ohly
6ddcdef29a kube-proxy: fix combination of --config and logging command line flags
When parsing a config file, all settings derived from command line flags are
discarded because only the config settings are used. That has been the
traditional behavior for non-logging flags.

But `--config ... -v=4` used to work until
71ef0dafa7 added logging to the configuration.
To restore the original behavior, kube-proxy now:
- parses flags
- reads the config file
- applies logging settings from the flags to the config loaded from file
- uses that merged config
2023-08-10 11:14:04 +02:00
SataQiu
5fb543a411 kubeadm: remove 'system:masters' organization from etcd/healthcheck-client certificate 2023-08-09 19:23:06 +08:00
Paco Xu
3a2c4d6f09 kubeadm: fix nil pointer when etcd member is already removed 2023-08-04 11:37:00 +08:00
Jordan Liggitt
a5fff9a5d0
Catch direct references to unwanted dependencies in kubernetes modules 2023-08-02 15:44:25 -04:00
Jordan Liggitt
b6ae858e01
Drop AvailableResources from controller context 2023-08-01 14:52:45 -04:00
xin.li
1b8fb69d9e kubeadm: increase ut for cmd/kubeadm/app/phases/addons/proxy
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-07-26 16:28:07 +08:00
haojue
6d244728b9 adjust order and fix typo for kube upgrade 2023-07-22 00:03:41 -04:00
Alexander Zielenski
ef8670c946 refactor: replace usage of v1alpha1 with v1beta1
v1alpha -> v1beta

fill in DenyAction where there is no ParameterNotFoundAction
2023-07-21 13:41:24 -07:00
Wojciech Tyczyński
6acfa3cb4a Graduate APIListChunking to GA 2023-07-21 14:09:40 +02:00
Alexander Zielenski
88becfc0ba api: add v1beta1 ValidatingAdmissionPolicy/Binding types and storage 2023-07-20 13:24:09 -07:00
Kubernetes Prow Robot
8c1dc65da9
Merge pull request #119390 from sohankunkerkar/add-dropin
cmd/kubelet: implement drop-in configuration directory for kubelet
2023-07-18 19:44:02 -07:00
Sohan Kunkerkar
06a81d1395 cmd/kubelet: implement drop-in configuration directory for kubelet
This implements a drop-in configuration directory for the kubelet
by introducing a "--config-dir" flag. Users can provide individual
kubelet config snippets in separate files, formatted similarly to
kubelet.conf. The kubelet will process the files in alphanumeric order,
appending configurations if subfield(s) doesn't exist, overwriting them if
they do, and handling lists by overwriting instead of merging.

Co-authored-by: Yu Qi Zhang <jerzhang@redhat.com>
2023-07-18 21:41:14 -04:00
Richa Banker
c1aef65640 Add integration test 2023-07-18 17:36:30 -07:00
Richa Banker
cd5f3d9f9d Add impl for uvip 2023-07-18 17:36:22 -07:00
Eric Lin
173b5a75b9 Trim managedFields in controller-manager
Signed-off-by: Eric Lin <exlin@google.com>
2023-07-18 18:31:26 +00:00
Kubernetes Prow Robot
ff90c1cc73
Merge pull request #119374 from danwinship/kep-3178-ga
move KEP-3178 IPTablesOwnershipCleanup to GA
2023-07-17 15:53:47 -07:00
Dan Winship
f1e7386fbc Deprecate now-unused kubelet iptables flags 2023-07-17 16:51:47 -04:00
Peter Hunt
bfa62e0009 kubelet: retry RuntimeConfig call and prep for nil values from GetLinux
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2023-07-17 13:05:30 -04:00
Markus Lehtonen
d7797fbc61 kubelet: get cgroup driver config from CRI
This patch modifies kubelet to get the cgroup driver setting from the
CRI runtime using the newly added RuntimeConfig rpc. The new code path
only takes place if the KubeletCgroupDriverFromCRI feature gate is
enabled. If the runtime returns a not-implemented error kubelet falls
back to using the cgroupDriver configuration option, with a log message
instructing the user to upgrade to w newer container runtime. Other rpc
errors cause kubelet to exit as is the case if the runtime returns an
unknown cgroup driver.
2023-07-17 12:27:05 -04:00
Markus Lehtonen
fd434003f3 kubelet: initialization of runtime service earlier in the startup
This patch refactors the kubelet startup code to initialize the runtime
service earlier in the startup sequence. We want this to be able to
query the cgroup driver setting from the CRI befure initializing the
cgroup manager.
2023-07-17 12:27:05 -04:00
Dave Chen
2ce07981af kubeadm: Make dry-run is configurable in joinConfiguration
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-17 17:37:50 +08:00
Dave Chen
f5a6797e56 kubeadm: Make dry-run is configurable in initConfiguration
The `dry-run` flag was able to use with the config file, since it was not
configurable in the config file.

Make it configurable in v1beta4, so that eventually, kubeadm could deprecate
the flag and suggest to use the config file instead.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-17 17:37:45 +08:00
Kubernetes Prow Robot
16534deedf
Merge pull request #119351 from SataQiu/fix-kubeadm-20230716
kubeadm: remove the limitation that the 'ignorePreflightErrors' field can not be set to 'all' in kubeadm config file
2023-07-16 22:07:07 -07:00
Kubernetes Prow Robot
7c4eb66b6f
Merge pull request #119319 from chendave/validate_config
kubeadm: Support `kubeadm config validate` for ResetConfiguration
2023-07-16 19:41:07 -07:00
Kubernetes Prow Robot
71f8a2405d
Merge pull request #119333 from liggitt/flushfrequencystring
Conditionally serialize flushFrequency as int
2023-07-16 07:09:06 -07:00
Jordan Liggitt
6c0ea702d4
Conditionally serialize flushFrequency as int 2023-07-16 08:37:37 -04:00
SataQiu
bd9b78d686 kubeadm: remove the limitation that the 'ignorePreflightErrors' field can not be set to 'all' in kubeadm config file, and keep CLI / config consistent 2023-07-16 12:37:12 +08:00
Kubernetes Prow Robot
f34365789d
Merge pull request #116470 from alexanderConstantinescu/kep-3836-impl
[Kube-proxy]: Implement KEP-3836
2023-07-15 05:43:04 -07:00
Dave Chen
b883f30501 kubeadm: Support kubeadm config validate for ResetConfiguration
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-15 19:29:18 +08:00
Kubernetes Prow Robot
871e6b5b8d
Merge pull request #119313 from chendave/migrate_config
kubeadm: Support `kubeadm config migrate` for ResetConfiguration
2023-07-15 00:31:22 -07:00
Dave Chen
8f9e2cb8a8 kubeadm: Support kubeadm config migrate for ResetConfiguration
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-15 13:18:47 +08:00
SataQiu
22f0f2e210 kubeadm: add 'kubeadm config print reset-defaults' command for ResetConfiguration 2023-07-15 11:14:28 +08:00
Kubernetes Prow Robot
cab65e2008
Merge pull request #118816 from PiotrProkop/topo-opts-to-beta
topologymanager: Promote support for improved multi-numa alignment in Topology Manager to beta
2023-07-14 16:55:08 -07:00
Kubernetes Prow Robot
24fe6f38f1
Merge pull request #119057 from vadasambar/feat/scheduler/expose-load-config-func
refactor: export `loadConfigFile` as a public function `LoadConfigFile`
2023-07-14 06:25:48 -07:00
Kubernetes Prow Robot
95c8d61918
Merge pull request #113583 from chendave/POC_resetCfg
kubeadm: implementation of `ResetConfiguration` API types
2023-07-14 04:05:48 -07:00
Dave Chen
2a907e6004 kubeadm: fix fuzzing for ResetConfiguration
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-14 17:03:37 +08:00
Dave Chen
2e6715bc77 kubeadm: implementation of ResetConfiguration API types
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-14 17:03:31 +08:00
Kubernetes Prow Robot
bea27f82d3
Merge pull request #118209 from pohly/dra-pre-scheduled-pods
dra: pre-scheduled pods
2023-07-13 14:43:37 -07:00
Jiahui Feng
049614f884
ValidatingAdmissionPolicy controller for Type Checking (#117377)
* [API REVIEW] ValidatingAdmissionPolicyStatucController config.

worker count.

* ValidatingAdmissionPolicyStatus controller.

* remove CEL typechecking from API server.

* fix initializer tests.

* remove type checking integration tests

from API server integration tests.

* validatingadmissionpolicy-status options.

* grant access to VAP controller.

* add defaulting unit test.

* generated: ./hack/update-codegen.sh

* add OWNERS for VAP status controller.

* type checking test case.
2023-07-13 13:41:50 -07:00
Patrick Ohly
80ab8f0542 dra: handle scheduled pods in kube-controller-manager
When someone decides that a Pod should definitely run on a specific node, they
can create the Pod with spec.nodeName already set. Some custom scheduler might
do that. Then kubelet starts to check the pod and (if DRA is enabled) will
refuse to run it, either because the claims are still waiting for the first
consumer or the pod wasn't added to reservedFor. Both are things the scheduler
normally does.

Also, if a pod got scheduled while the DRA feature was off in the
kube-scheduler, a pod can reach the same state.

The resource claim controller can handle these two cases by taking over for the
kube-scheduler when nodeName is set. Triggering an allocation is simpler than
in the scheduler because all it takes is creating the right
PodSchedulingContext with spec.selectedNode set. There's no need to list nodes
because that choice was already made, permanently. Adding the pod to
reservedFor also isn't hard.

What's currently missing is triggering de-allocation of claims to re-allocate
them for the desired node. This is not important for claims that get created
for the pod from a template and then only get used once, but it might be
worthwhile to add de-allocation in the future.
2023-07-13 21:27:11 +02:00
Kubernetes Prow Robot
20e60a03df
Merge pull request #110863 from claudiubelu/path-filepath-update-2
Replaces path.Operation with filepath.Operation (part 2)
2023-07-13 09:56:37 -07:00
Kubernetes Prow Robot
d37c62dcbf
Merge pull request #117800 from cyclinder/loggin_format
Add '--logging-format' flag to kube-proxy
2023-07-13 08:40:37 -07:00
cyclinder
71ef0dafa7 add flag 'logging-format' to kube-proxy 2023-07-13 14:33:33 +08:00
vadasambar
c52911e59a docs: add comment describing LoadConfigFromFile 2023-07-13 09:59:39 +05:30
vadasambar
5c18810f35 chore: update license date for configfile tests 2023-07-13 09:59:39 +05:30
vadasambar
72aeb96132 test: add tests for LoadConfigFromFile 2023-07-13 09:59:39 +05:30
vadasambar
b3373ae273 refactor: make only LoadConfigFromFile public
- `loadConfig` can be made public again when needed (not required now)
2023-07-13 09:59:39 +05:30
vadasambar
8e284389a5 feat: make loadConfig and loadConfigFile public functions
- so that users who import kube-scheduler libraries can use these functions to read kube scheduler config
2023-07-13 09:59:39 +05:30
Patrick Ohly
7d064812bb kube-controller-manager: finish conversion to contextual logging
This removes all exceptions and fixes the remaining unconverted log calls.
2023-07-12 14:57:29 +02:00
Kubernetes Prow Robot
745cfa35bd
Merge pull request #119147 from mengjiao-liu/contextual-logging-controller-disruption
Migrate /pkg/controller/disruption to structured and contextual logging
2023-07-12 03:35:25 -07:00
Kubernetes Prow Robot
5130dad2cf
Merge pull request #118408 from danwinship/local-detector
kube-proxy local traffic detector single-vs-dual-stack cleanup
2023-07-11 21:19:11 -07:00
Mengjiao Liu
19869478c1 Migrate /pkg/controller/disruption to structured and contextual logging 2023-07-12 11:30:45 +08:00
PiotrProkop
f855a23b45 topologymanager: promote TopologyManagerPolicyOptions feature to beta
* Promote TopologyManagerPolicyOptions feature to beta
* Promote PreferClosestNUMANodes TopologyManagerPolicyOption to beta

Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2023-07-11 15:06:57 +02:00
Kubernetes Prow Robot
50782ce5ab
Merge pull request #119198 from jadhaj/fix-115385
Document address family of listening INET sockets
2023-07-11 03:19:23 -07:00
Kubernetes Prow Robot
8f1852bb44
Merge pull request #115295 from Namanl2001/pkg/controller/endpointslice
Migrated `pkg/controller/endpointslice` and `pkg/controller/endpointslicemirroring` to contextual logging
2023-07-11 03:19:12 -07:00
Kubernetes Prow Robot
42e1e72105
Merge pull request #119130 from SataQiu/clean-sheduler-20230706
Remove deprecated scheduler CLI flags
2023-07-10 14:03:11 -07:00
Naman
645cb90732 migrated pkg/controller/endpointslicemirroring to contextual logging
Signed-off-by: Naman <namanlakhwani@gmail.com>
2023-07-11 01:43:30 +05:30
Naman
09849b09cf migrated pkg/controller/endpointslice to contextual logging
Signed-off-by: Naman <namanlakhwani@gmail.com>
2023-07-11 01:28:22 +05:30
Jad Haj Yahya
de07643095 Document address family of listening INET sockets 2023-07-10 15:01:13 +03:00
Alexander Constantinescu
9b1c4c7b57 Implement KEP-3836
TL;DR: we want to start failing the LB HC if a node is tainted with ToBeDeletedByClusterAutoscaler.
This field might need refinement, but currently is deemed our best way of understanding if
a node is about to get deleted. We want to do this only for eTP:Cluster services.

The goal is to connection draining terminating nodes
2023-07-10 10:30:54 +02:00
SataQiu
3a5268502f Remove deprecated scheduler CLI flags 2023-07-07 23:33:33 +08:00
Kubernetes Prow Robot
6f9d1d38d8
Merge pull request #118817 from pohly/dra-delete-claims
DRA: improve handling of completed pods
2023-07-06 10:15:15 -07:00
Kubernetes Prow Robot
8c1bf4f461
Merge pull request #116930 from fatsheep9146/contextual-logging-cleanup
contextual logging cleanup
2023-07-06 07:39:03 -07:00
Kubernetes Prow Robot
e5efa0a5ee
Merge pull request #117108 from pohly/test-integration-race-detection-component-base-logs
component-base/logs: improve handling of re-applying a configuration
2023-07-05 21:29:08 -07:00
Ziqi Zhao
dfc1838379 Migrated pkg/controller/volume|util|replicaset|nodeipam to contextual logging
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
2023-07-06 07:39:52 +08:00
Patrick Ohly
02efe09abe component-base/logs: improve handling of re-applying a configuration
Normal binaries should never have to do this. It's not safe when there are
already some goroutines running which might do logging. Therefore the new
default is to return an error when a binary accidentally re-applies.

A few unit ensure that there are no goroutines and have to call the functions
more then once. The new ResetForTest API gets used by those to enable changing the
logging settings more than once in the same process.

Integration tests use the same code as the normal binaries. To make reuse of
that code safe, component-base/logs can be configured to silently ignore any
additional calls. This addresses data races that were found when enabling -race
for integration tests. To catch cases where the integration test does want
to modify the config, the old and new config get compared and an error is
raised when it's not the same.

To avoid having to modify all integration tests which start test servers,
reconfiguring component-base/logs is done by the test server packages.
2023-07-05 19:08:54 +02:00
Patrick Ohly
7f5a02fc7e dra resourceclaim controller: enhance logging
Adding logging to event handlers makes it more obvious why (or why not) claims
and pods need to be processed.
2023-07-05 16:10:20 +02:00
Dan Winship
e2900da46a Remove unnecessary utiliptables.Interface arg from local detectors
getLocalDetector() used to pass a utiliptables.Interface to
NewDetectLocalByCIDR() so that NewDetectLocalByCIDR() could verify
that the passed-in CIDR was of the same family as the iptables
interface. It would make more sense for getLocalDetector() to verify
this itself and just *not call NewDetectLocalByCIDR* if the families
don't match, and that's what the code does now. So there's no longer
any need to pass the utiliptables.Interface to the local detector.
2023-07-05 09:11:23 -04:00
Dan Winship
7690c6e812 Simplify getDualStackLocalDetectorTuple
Since the single-stack and dual-stack local-detector-getters now have
the same behavior in terms of error-checking and dual-stack config, we
can just replace the contents of getDualStackLocalDetectorTuple() with
a pair of calls to getLocalDetector().
2023-07-05 09:09:54 -04:00
Dan Winship
cefd50a753 Improve the single-stack LocalDetector behavior
1. When bringing up a single-stack kube-proxy in a dual-stack cluster,
allow using either the primary or secondary IP family.

2. Since the earlier config-checking code will already have bailed out
if the single-stack configuration is unusably broken, we don't need to
do that here. Instead, just return a no-op local detector if there are
no usable CIDRs of the expected IP family.
2023-07-05 09:06:25 -04:00
Dan Winship
bfccfa7016 Add names to the getLocalDetector unit tests, use t.Run 2023-07-05 09:06:25 -04:00
Kubernetes Prow Robot
4c18d40af1
Merge pull request #119075 from chendave/test_gv
kubeadm: check the GV after the config migration
2023-07-04 22:00:54 -07:00
Kubernetes Prow Robot
76227fdb3d
Merge pull request #118874 from my-git9/dns-ut
kubeadm: increase ut coverage kubeadm/app/phases/dns
2023-07-04 19:30:54 -07:00
Dave Chen
31943cc3f4 kubeadm: check the GV after the config migration
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-05 10:04:12 +08:00
Kubernetes Prow Robot
68b7685b2a
Merge pull request #119081 from sttts/sttts-public-ip-validation-move
kube-apiserver: move "public IP matches IP family" check to option validation
2023-07-04 14:28:54 -07:00
Dr. Stefan Schimanski
4149933ed2
kube-apiserver: move "public IP matches IP family" check to option validation 2023-07-04 22:28:27 +02:00
Kubernetes Prow Robot
8d0e46a5ec
Merge pull request #119041 from sttts/sttts-move-back-master-count
cmd/kube-apiserver: move back master count variable from generic controlplane
2023-07-04 13:22:54 -07:00
Kubernetes Prow Robot
0235a5a206
Merge pull request #118707 from pacoxu/unwanted-status-order
update the unwanted-dependencies order
2023-07-04 12:20:54 -07:00
xin.li
c26e1ba10c [UT] increase coverage kubeadm/app/phases/dns
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-07-04 22:11:32 +08:00
Kubernetes Prow Robot
3149875175
Merge pull request #119059 from pacoxu/migrate-experimental-v1beta4
kubeadm: fix "migrate config --allow-experimental-api" to print v1beta4 kubeadm configurations instead of v1beta3
2023-07-04 06:28:53 -07:00