Commit Graph

11906 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
930022cf26
Merge pull request #121841 from SataQiu/fix-renew-20231110
kubeadm: support updating certificate organization during 'kubeadm certs renew'
2023-11-11 09:49:36 +01:00
SataQiu
bda722bb68 kubeadm: support updating certificate organization during 'kubeadm certs renew' 2023-11-11 14:57:50 +08:00
Lubomir I. Ivanov
2780060a78 kubeadm: change SystemPrivilegedGroup in apiserve-kubelet-client.crt
The component connection between kube-apiserver and kubelet does not
require the "O" field on the Subject to be set to the
"system:masters" privileged group. It can be a less
privileged group like "kubeadm:cluster-admins".

Change the group in the apiserve-kubelet-client
certificate specification. This cert is passed to
--kubelet-client-certificate.
2023-11-10 15:05:14 +02:00
Lubomir I. Ivanov
6dc11c1f21 kubeadm: ensure the kubelet and kube-apiserver wait checks go first
The addition of the "super-admin.conf" functionality required
init.go's Client() to create RBAC rules on its first creation.

However this created a problem with the "wait-control-plane" phase
of "kubeadm init" where a client is needed to connect to the
API server Discovery API's "/healthz" endpoint. The logic that ensures
the RBAC became the step where the API server wait was polled for.

To avoid this, introduce a new InitData function ClientWithoutBootstrap.
In "wait-control-plane" use this client, which has no permissions
(anonymous), but is sufficient to connect to the "/healthz".

Pending changes here would be:
- Stop using the "/healthz", instead a regular REST client from
the kubelet cert/key can be constructed.
- Make the wait for kubelet / API server linear (not in go routines).
2023-11-06 12:43:20 +02:00
Kubernetes Prow Robot
953afbb328
Merge pull request #121193 from sohankunkerkar/kubelet-config-dir
Retarget drop-in kubelet configuration dir feature to Alpha
2023-11-03 23:59:29 +01:00
Sohan Kunkerkar
ee5578be52 cmd/kubelet: fix overriding default KubeletConfig fields in drop-in configs if not set
This commit resolves an issue where certain KubeletConfig fields, specifically:
- FileCheckFrequency
- VolumeStatsAggPeriod
- EvictionPressureTransitionPeriod
- Authorization.Mode
- EvictionHard
were inadvertently overridden when not explicitly set in drop-in configs. To retain the
original values if they were absent in the drop-in configs, mergeKubeletConfigurations
uses a JSON patch merge strategy to selectively merge configurations. It prevents essential
configuration settings from being overridden, ensuring a more predictable behavior for users.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
Co-authored-by: Peter Hunt <pehunt@redhat.com>
2023-11-03 17:48:29 -04:00
Mohamed Omar Zaian
3c268b7524 etcd: Update to version 3.5.10 2023-11-02 10:30:41 +01:00
Kubernetes Prow Robot
6abff7457e
Merge pull request #116516 from aojea/servicecidr
KEP-1880 Multiple ServiceCIDR ( and IPAddress allocation)
2023-11-01 03:52:24 +01:00
Kubernetes Prow Robot
bfd67c4454
Merge pull request #121648 from neolit123/1.29-super-admin-conf
kubeadm: do not poll in TestEnsureAdminClusterRoleBindingImpl
2023-11-01 01:51:26 +01:00
Dan Winship
93860a5217 Distinguish iptables-based and nftables-based backends, do startup cleanup
When switching from iptables or ipvs to nftables, clean up old
iptables/ipvs rules. When switching the other way, clean up old
nftables rules.
2023-10-31 17:38:32 -04:00
Dan Winship
abb1a458a9 Create an nftables.Interface in nftables proxier
And update most of the comments to refer to "nftables" rather than
"iptables" (even though it doesn't actually do any nftables updating
at this point).

For now the proxy also internally creates a
utiliptablestesting.FakeIPTables to keep the existing sync code
compiling.
2023-10-31 17:38:29 -04:00
Dan Winship
1a6b9b811e Simplify nftables/proxier.go by removing localhost nodeport support
and related route_localnet setting / anti-martian-packet rule
2023-10-31 17:33:53 -04:00
Dan Winship
a70653143e Add a dummy nftables kube-proxy backend which is just a copy of iptables 2023-10-31 17:31:42 -04:00
Antonio Ojea
3edcce52e3 service cidr controller manager: use new ServiceCIDR API 2023-10-31 21:05:50 +00:00
Antonio Ojea
e3a0df26a8 remove flag cidr max size validation if gate enable 2023-10-31 21:05:06 +00:00
Antonio Ojea
4ff80864e1 service cidr controller manager
Controls the lifecycle of the ServiceCIDRs adding finalizers and
setting the Ready condition in status when they are created, and
removing the finalizers once it is safe to remove (no orphan IPAddresses)

An IPAddress is orphan if there are no ServiceCIDR containing it.

Change-Id: Icbe31e1ed8525fa04df3b741c8a817e5f2a49e80
2023-10-31 21:05:05 +00:00
Kubernetes Prow Robot
0c93f40374
Merge pull request #120995 from aroradaman/move-get-kernel-version
move GetKernelVersion out of pkg/proxy/ipvs
2023-10-31 20:23:41 +01:00
Kubernetes Prow Robot
5d03ce7ae4
Merge pull request #120354 from aroradaman/proxy-conntrack-api
Add support for `nf_conntrack_tcp_be_liberal` sysctl to kube-proxy
2023-10-31 19:15:44 +01:00
Kubernetes Prow Robot
ef658637fd
Merge pull request #121611 from atiratree/test-gated-controllers
controller descriptors should not be feature gated
2023-10-31 18:10:07 +01:00
Lubomir I. Ivanov
c2a365c6a7 kubeadm: do not poll in TestEnsureAdminClusterRoleBindingImpl
In EnsureAdminClusterRoleBindingImpl() there are a couple of
polls around CRB create calls. When testing the function
a short retry and a timeout are used. These introduce around
2x20 fake client "connections" / poll iterations under a couple
of test cases with 2 seconds overall test increase.

Given the polls in EnsureAdminClusterRoleBindingImpl()
are of type PollUntilContextTimeout() with "immediate" set to "true",
the short retry / time out can be removed when testing,
because one poll iteration is guaranteed and the tested function
is at 100% coverage with reactors and test cases.
2023-10-31 17:37:10 +02:00
Kubernetes Prow Robot
f5a5d83d7c
Merge pull request #121089 from tkashem/apf-v1
Promote APF API to v1
2023-10-31 02:39:30 +01:00
Filip Křepinský
1daf1b0705 test that controller descriptors should not be feature gated
controllers enabled by default should define feature gates in
ControllerDescriptor.requiredFeatureGates and not during a descriptor
registration in NewControllerDescriptors
2023-10-31 00:00:34 +01:00
Filip Křepinský
fed11c0793 remove unnecessary gating of taint-eviction-controller descriptor 2023-10-31 00:00:14 +01:00
Kubernetes Prow Robot
5cb83d1cd2
Merge pull request #121609 from neolit123/1.29-super-admin-conf
kubeadm: poll additional CRB create calls for kubeadm:cluster-admins
2023-10-30 21:12:00 +01:00
Kubernetes Prow Robot
e4212878dd
Merge pull request #119208 from atosatto/separate-taint-manager
Decouple TaintManager from NodeLifeCycleController (KEP-3902)
2023-10-30 21:11:33 +01:00
Kubernetes Prow Robot
ceea5fd0cb
Merge pull request #119109 from jiahuif-forks/feature/validating-admission-policy/crd-typechecking
ValidatingAdmissionPolicy - Type Checking for API Expensions types
2023-10-30 21:11:19 +01:00
Andrea Tosatto
ccda2d6fd4 kube-controller-manager: Decouple TaintManager from NodeLifeCycleController (KEP-3902) 2023-10-30 12:23:56 +00:00
Abu Kashem
b24dd44904
apiserver: enable apf v1 API 2023-10-30 07:48:22 -04:00
Lubomir I. Ivanov
05076de57f kubeadm: poll additional CRB create calls for kubeadm:cluster-admins
Poll CRB create calls for kubeadm:cluster-admins when using the
super-admin.conf credential. The prior create call that uses the
credential admin.conf was already polled. Polling this subsequent
call seems advisable to ensure that momentary errors in between
cannot trip EnsureAdminClusterRoleBindingImpl().
2023-10-30 12:51:13 +02:00
Kubernetes Prow Robot
f3560758d2
Merge pull request #114534 from ruquanzhao/skipaddons
kubeadm: Support skipping addons image pull
2023-10-30 04:20:44 +01:00
Kubernetes Prow Robot
74098ab5ad
Merge pull request #119500 from JackTroy/fix-threshold-arg
Add explanation for large-cluster-size-threshold arg
2023-10-30 02:50:10 +01:00
Kubernetes Prow Robot
e1f948f065
Merge pull request #118355 from carlory/patch-102
remove unused cloudprovider param from the ProbeControllerVolumePlugins func
2023-10-29 02:51:40 +02:00
Daman Arora
9ae77364e9 pkg/proxy: configure tcp-be-liberal
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-10-28 01:11:24 +05:30
Daman Arora
a375aa28ee pkg/proxy: move get kernel version out of ipvs proxier
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-10-28 00:54:34 +05:30
Filip Křepinský
1591a0e132 add unit tests for NewControllerDescriptors
- controller descriptors should not be feature gated
- aliases should not be defined for new controllers and have only a
  canonical name
2023-10-27 13:28:02 +02:00
Filip Křepinský
44cac26667 move start controller pre- and post- checks/actions out of StartControllers
into StartController function

the function is reused by ServiceAccountTokenController
2023-10-27 13:28:02 +02:00
Filip Křepinský
b768967280 move aliases into each registrable controller 2023-10-27 13:28:02 +02:00
Filip Křepinský
a85779b4df include ServiceAccountTokenController in the NewControllerDescriptors to make it more generic
- pass a map of controllerDescriptors instead of a function
2023-10-27 13:28:02 +02:00
Filip Křepinský
27a77e0ef3 Encapsulate KCM controllers with their metadata
- These metadata can be used to handle controllers in a generic way.
- This enables showing feature gated controllers in kube-controller-manager's help.
- It is possible to obtain a controllerName in the InitFunc so it can be passed down to and used by the controller.

metadata about a controller:
- name
- requiredFeatureGates
- isDisabledByDefault
- isCloudProviderController
2023-10-27 13:28:01 +02:00
Kubernetes Prow Robot
c8125c4029
Merge pull request #121305 from neolit123/1.29-super-admin-conf
kubeadm: add support for separate super-admin.conf kubeconfig file
2023-10-27 08:51:31 +02:00
RuquanZhao
b0491d71bd Support skipping pulling addons image.
Add field DNS.Disabled and Proxy.Disabled in ClusterConfiguration to save status for `join` to read.
Signed-off-by: Ruquan Zhao <ruquan.zhao@arm.com>
2023-10-27 14:33:37 +08:00
Jiahui Feng
fd132665a8 extend VAP status controller for extensions type checking. 2023-10-26 10:26:03 -07:00
Lubomir I. Ivanov
837090135f kubeadm: make super-admin.conf changes to app/cmd
- Update unit tests in certs_test.go related to the "renew" CLI command.
- In /init, (d *initData) Client(), make sure that the new logic
for bootstrapping an "admin.conf" user is performed, by calling
EnsureAdminClusterRoleBinding() from the phases backend. Add a
"adminKubeConfigBootstrapped" flag that helps call this logic only
once per "kubeadm init" binary execution.
- In /phases/init include a new subphase for generating
the "super-admin.conf" file.
- In /phases/reset make sure the file "super-admin.conf" is
cleaned if present. Update unit tests.
2023-10-26 07:36:03 +03:00
Lubomir I. Ivanov
30ed50d32e kubeadm: make super-admin.conf changes in app/phases
- Register the new file in /certs/renewal, so that the
file is renewed if present. If not present the common message "MISSING"
is shown. Same for other certs/kubeconfig files.
- In /kubeconfig, update the spec for admin.conf to use
the "kubeadm:cluster-admins" Group. A new spec is added for
the "super-admin.conf" file that uses the "system:masters" Group.
- Add a new function EnsureAdminClusterRoleBinding() that includes
logic to ensure that admin.conf contains a User that is properly
bound on the "cluster-admin" built-in ClusterRole. This requires
bootstrapping using the "system:masters" containing "super-admin.conf".
Add detailed unit tests for this new logic.
- In /upgrade#PerformPostUpgradeTasks() add logic to create the
"admin.conf" and "super-admin.conf" with the new, updated specs.
Add detailed unit tests for this new logic.
- In /upgrade#StaticPodControlPlane() ensure that renewal of
"super-admin.conf" is performed if the file exists.
Update unit tests.
2023-10-26 07:36:03 +03:00
Kubernetes Prow Robot
0501933e56
Merge pull request #121291 from bzsuni/ga/CSIMigrationvSphere
Remove GA featuregate about CSIMigrationvSphere in 1.29
2023-10-26 01:08:06 +02:00
Kubernetes Prow Robot
af52a7052b
Merge pull request #121511 from neolit123/1.29-fix-lint-export-comments
kubeadm: fix export comments to make golangci-lint happy
2023-10-25 21:29:19 +02:00
Kubernetes Prow Robot
06a7febe00
Merge pull request #120864 from uablrek/kube-proxy-init
kube-proxy: Optionally do privileged configs only
2023-10-25 21:28:47 +02:00
Lubomir I. Ivanov
c2a04fa1cf kubeadm: fix export comments to make golangci-lint happy 2023-10-25 19:35:10 +03:00
Lubomir I. Ivanov
98bed52fdd kubeadm: make super-admin.conf changes in app/constants
- Add the new file name: super-admin.conf and a function
to return its default path GetSuperAdminKubeConfigPath()
- Add the ClusterAdminsGroupAndClusterRoleBinding object name.
2023-10-25 11:46:49 +03:00
Kubernetes Prow Robot
6e04b7d051
Merge pull request #121470 from SataQiu/clean-kubeadm-20231024
kubeadm: cleanup UnknownCRISocket
2023-10-25 05:46:30 +02:00