Commit Graph

4399 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
d399535b01
Merge pull request #122762 from yxxhero/check-initData-and-joinData-safely
Fix type assertion error in init and join commands for kubeadm
2024-01-17 04:37:05 +01:00
yxxhero
d21fc96db3 Fix type assertion error in init and join commands for kubeadm
Signed-off-by: yxxhero <aiopsclub@163.com>
2024-01-17 07:50:29 +08:00
Lubomir I. Ivanov
54a6e6a772 kubeadm: keep a function with short timeout in idempotency.go
- Name the function GetConfigMapWithShortRetry to be
easier to understand that the function is with a very short timeout.
Add note that this function should be used in cases there is a
fallback to local config.
- Apply custom hardcoded interval of 50ms and timeout of 350ms to it.
Previously the fucntion used exp backoff with 5 steps up to ~340ms.
2024-01-16 17:53:21 +02:00
Kubernetes Prow Robot
8ba29970e6
Merge pull request #122529 from neolit123/1.30-v1beta4-timeouts
kubeadm: add a Timeouts struct to v1beta4
2024-01-15 19:33:58 +01:00
HirazawaUi
46c4249e3e Remove code to be removed in 1.30 2024-01-15 19:40:04 +08:00
Lubomir I. Ivanov
5f876b9d0a kubeadm: switch from ExponentialBackoff() to PollUntilContextTimeout()
Switch to PollUntilContextTimeout() everywhere to allow
usage of the exposed timeouts in the kubeadm API. Exponential backoff
options are more difficult to expose in this regard and a bit too
detailed for the common user - i.e. have "steps", "factor" and so on.
2024-01-14 15:07:56 +02:00
Lubomir I. Ivanov
caf5311413 kubeadm: start using the Timeouts struct values
Propagate usage of the Timeout struct values.
Apply sanitazation to timeout constants in contants.go.
2024-01-14 15:07:56 +02:00
Lubomir I. Ivanov
374e41cf66 kubeadm: replace deprecated wait.Poll() and wait.PollImmediate()
Replace the usage of the deprecated wait.Poll() and
wait.PollImmediate() functions with wait.PollUntilContextTimeout().
Since we don't have piping of context around kubeadm,
use context.Background() everywhere.

Some wait.Poll() functions were converted to "immediate" as there
is no point for them to not be. This is done for consistency.

Replace the only instance of wait.JitterUntil with
wait.PollUntilContextTimeout. JitterUntil is not deprecated
but this is also done for consistency.
2024-01-14 15:07:55 +02:00
Mario Valderrama
dcdfd71450
Fix kubeadm init regression
Don't create admin rolebindings when --kubeconfig is set to a
non-default value.

Fixes: https://github.com/kubernetes/kubeadm/issues/2992

Signed-off-by: Mario Valderrama <mario.valderrama@ionos.com>
2024-01-12 16:58:40 +01:00
Kubernetes Prow Robot
331e5561ab
Merge pull request #122642 from my-git9/componentconfigs-ut-q
kubeadm: increase ut coverage app/componentconfigs
2024-01-10 02:47:06 +01:00
xin.li
1a69fd4cb0 kubeadm: increase ut coverage app/componentconfigs
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-01-09 21:52:11 +08:00
Kubernetes Prow Robot
18608cc56b
Merge pull request #122619 from neolit123/1.30-v1beta4-control-reset-unmount
kubeadm: skip unmount on missing /var/lib/kubelet
2024-01-08 08:47:41 +01:00
Lubomir I. Ivanov
073cfdfac9 kubeadm: skip unmount on missing /var/lib/kubelet
If the user deletes the /var/lib/kubelet manually, "reset" will throw
an error that the dir is missing. Instead of handling this error,
print it as a warning and skip unmount of directories inside it.

This allows "reset" to continue to be reentrant and can be called
even even if "init/join" are not called yet and some of the
k8s directories on a node do not exist.

Continue to error on individual unmount errors.

Remove the function absoluteKubeletRunDirectory() and
call filepath.EvalSymlinks() directly.
2024-01-08 08:40:32 +02:00
Lubomir I. Ivanov
d9e48705ff kubeadm: make the active timeouts structure accessible from anywhere
Currently, timeouts are only accessible if a kubeadm runtime.Object{}
like InitConfiguration is passed around.

Any time a config is loaded or defaulted, store the Timeouts
structure in a thread-safe way in the main kubeadm API package
with SetActiveTimeouts(). Optionally, a deep-copy can be
performed before calling SetActiveTimeouts(). Make this struct
accessible with GetActiveTimeouts(). Ensure these functions
are thread safe.

On init() make sure the struct is defaulted, so that unit
tests can work with these values.
2024-01-05 14:41:16 +02:00
Lubomir I. Ivanov
ea0fa41445 kubeadm: implement mutators for "config migrate"
When upconverting from v1beta3 to v1beta4, it appears there is no
easy way to migrate some of the timeout values such as:
  ClusterConfiguration.APIServer.TimeoutForControlPlane
to a new location:
  InitConfiguration.Timeouts.<some-timeout-field>

Yes, the internal InitConfiguratio does embed a ClusterConfiguration,
but during conversion the ClusterConfiguration is converted from an
empty source.

K8s' API machinery has ways to register custom conversion functions,
such as v1beta3.ClusterConfiguration -> internal.InitConfiguration,
but these must be triggered explicitly with a decoder.
The overall migration of fields seems very awkward.

There might be hacks around that, such as storing intermediate state,
while trying to make the fuzzer rountrip happy, but instead
mutation functions can be implemented for the internal types when
calling kubeadm's migrate code. This seems much cleaner.
2024-01-05 14:41:16 +02:00
Lubomir I. Ivanov
492c0619dc kubeadm: add a Timeouts struct to v1beta4
The struct is included in InitConfiguration, JoinConfiguration
and ResetConfiguration.

Add conversion and update defaulters and fuzzers.
Include a timeoututils.go that contains a function
to default the internal Timeouts struct.
2024-01-05 14:41:16 +02:00
Kubernetes Prow Robot
0598cec06a
Merge pull request #122530 from neolit123/1.30-v1beta4-control-reset-unmount
kubeadm: more verbose unmount logic on "reset"
2024-01-05 13:22:58 +01:00
Lubomir I. Ivanov
2f5121671f kubeadm: add ResetConfiguration.UnmountFlags
Add new a v1beta4.ResetConfiguration.UnmountFlags field that
can be used to pass in Linux unmount2() flags such as MNT_FORCE.
Default value continues to be 0 - i.e. no flags.
2024-01-05 12:58:44 +02:00
Lubomir I. Ivanov
d6bfd7daeb kubeadm: throw errors on unmount instead of warnings
Instead of warnings when syscall.Unmount() causes errors,
store all the errors in an aggregate. Abort the reset operation if
at least one unmount error was encountered.
2024-01-04 18:30:40 +02:00
Kubernetes Prow Robot
6cf77098aa
Merge pull request #122545 from my-git9/cert-fake-fix
kubeadm: fix flaky test TestRunRenewCommands
2024-01-01 17:42:13 +01:00
xin.li
a2f397a4b8 kubeadm: increase ut coverage fo phases/kubeconfig
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-01-01 20:54:33 +08:00
xin.li
97db0caf6b kubeadm: fix flaky test TestRunRenewCommands
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-01-01 20:47:03 +08:00
Kubernetes Prow Robot
735804dc81
Merge pull request #122477 from SataQiu/fix-20231225
kubeadm: print supported shell types in error message for 'kubeadm completion'
2023-12-25 17:21:58 +01:00
Kubernetes Prow Robot
a56093db9f
Merge pull request #121958 from neolit123/1.30-remove-kubelet-and-func
kubeadm: drop concurrency when waiting for kubelet /healthz
2023-12-25 15:52:25 +01:00
SataQiu
41a508f538 kubeadm: print supported shell types in error message for 'kubeadm completion' 2023-12-25 17:28:34 +08:00
Kubernetes Prow Robot
b9e0714722
Merge pull request #122356 from my-git9/ut-etcd-32
kubeadm: increase ut coverage for util/etcd
2023-12-25 06:25:07 +01:00
xin.li
430fd83454 kubeadm: increase ut coverage for util/etcd
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-12-25 11:14:05 +08:00
Kubernetes Prow Robot
0d530551bc
Merge pull request #122393 from mzaian/etcd-3511
etcd: Update to version 3.5.11
2023-12-21 06:41:55 +01:00
Kubernetes Prow Robot
c6f4ff6df8
Merge pull request #122385 from SataQiu/fix-global-flag-20231219
kubeadm: hide unwanted global klog flags
2023-12-21 05:30:53 +01:00
Mohamed Omar Zaian
c8a2d5684d etcd: Update to version 3.5.11 2023-12-20 11:18:35 +01:00
Lubomir I. Ivanov
32fbb23f3b kubeadm: remove usage of the TryRunCommand() function
The function TryRunCommand() uses an exponential backoff,
which is good, but it's inconsistent and only used in a couple
of places.

Remove its usage in the token.go#UpdateOrCreateTokens()
and switch to using the standard function used in other places -
PollUntilContextTimeout().

Remove wait.go#TryRunCommand(), as there are no other usages.
2023-12-20 08:51:00 +02:00
Lubomir I. Ivanov
557118897d kubeadm: drop concurrency when waiting for kubelet /healthz
The function wait.go#WaitForKubeletAndFunc() has been used in
a number of places in kubeadm. It starts a go routine to wait for
the kubelet /healthz and in parallel starts another go routine
to wait for an custom function.

This logic is problematic. If kubeadm is waiting for the kubelet
in parallel with something that requires the kubelet, the right
solution would be to first wait for the kubelet in serial and only
then proceed with the other action. The parallelism here particularly
during "init" required a unwanted "initial timeout" of 40s, before
the kubelet waiting even starts. In most cases, this makes the kubelet
waiter to not even start, while the main point of waiting becomes
the "other action".

- Remove the function WaitForKubeletAndFunc() from the Waiter interface.
- Rename the function WaitForHealthyKubelet() to just WaitForKubelet()
to be consistent with the naming WaitForAPI().
- Update WaitForKubelet() to not use TryRunCommand() and instead
use PollUntilContextTimeout().
- Remove the "initial timeout" of 40s in WaitForKubelet().
- Make both WaitForKubelet() and WaitForAPI() use similar error
handling and output.
- Update all usage of WaitForKubelet() to be a serial call before
any other action, such as another wait* call.
- Make the default wait timeout for the kubelet
/healthz to be 1 minute (kubeadmconstants.DefaultKubeletTimeout).
- Apply updates to all implementations of the Waiter interface.
2023-12-20 08:51:00 +02:00
Kubernetes Prow Robot
27c127403c
Merge pull request #122265 from SataQiu/kubeadm-etcd-1.30
kubeadm: add supported etcd version for v1.30
2023-12-20 06:19:30 +01:00
SataQiu
64da434523 kubeadm: hide unwanted global klog flags 2023-12-19 18:49:01 +08:00
SataQiu
2edb334993 kubeadm: hide unwanted global klog flags 2023-12-19 16:32:30 +08:00
James Blair
b6c1f8ef08
Fix etcd repository path to prevent redirects.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-12-16 19:50:02 +13:00
Kubernetes Prow Robot
1a1941eebb
Merge pull request #122079 from carlory/kubeadm-upgrade-health
refactor healthCheck's CreateJob with TTLSecondsAfterFinished
2023-12-15 08:15:04 +01:00
carlory
c62155a770 refactor healthCheck's CreateJob with TTLSecondsAfterFinished
Co-authored-by: Shida Qiu <shidaqiu2018@gmail.com>
2023-12-15 11:32:30 +08:00
Kubernetes Prow Robot
6383b50ed9
Merge pull request #122213 from chendave/plan_control_node
kubeadm: update the help msg for `kubeadm upgrade plan`
2023-12-14 07:26:36 +01:00
Kubernetes Prow Robot
36d95c33b1
Merge pull request #122181 from SataQiu/clean-certs-20231205
kubeadm: cleanup unused CreateCSR and associated functions
2023-12-14 07:26:27 +01:00
Kubernetes Prow Robot
6e7f503e1a
Merge pull request #122144 from Jerry-yz/master
kubeadm: update func CreateJoinControlPlaneKubeConfigFiles variable name
2023-12-14 06:18:52 +01:00
Kubernetes Prow Robot
e4c8005fdf
Merge pull request #122128 from my-git9/configut
kubeadm: increase ut coverage of util/config
2023-12-14 06:18:07 +01:00
Kubernetes Prow Robot
d96dc5361f
Merge pull request #122061 from neolit123/1.30-fix-upgrade-plan-message-about-cm
kubeadm: remove outdated notes during upgrade
2023-12-14 05:10:28 +01:00
Kubernetes Prow Robot
6fa0fe53a9
Merge pull request #121965 from my-git9/fixflaketoken
kubeadm: fix flaky test TestRetrieveValidatedConfigInfo
2023-12-14 05:08:58 +01:00
Kubernetes Prow Robot
5852244b89
Merge pull request #121727 from my-git9/versiongetterut
kubeadm: increase ut coverage app/upgrade/versiongetter
2023-12-13 22:35:27 +01:00
SataQiu
477176a467 kubeadm: add supported etcd version for v1.30 2023-12-11 20:24:02 +08:00
Dave Chen
39417e9d44 kubeadm: update the help msg for kubeadm upgrade plan
Explictly show the help msg that `kubeadm upgrade plan` can only run
on the node where "admin.conf" exists, normally, this is the control
plane node.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-12-08 16:22:17 +08:00
xin.li
20b67a4d1a kubeadm: increase ut coverage of util/config
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-12-06 21:21:52 +08:00
SataQiu
56262ca56a kubeadm: cleanup unused CreateCSR and associated functions 2023-12-05 18:17:14 +08:00
Jerry-yz
0c33ada850 update func CreateJoinControlPlaneKubeConfigFiles variable name 2023-12-01 17:08:36 +08:00
Lubomir I. Ivanov
f86249c68e kubeadm: remove outdated notes during upgrade
The notes printed to the user from common.go when
loadConfig fails are outdated and incorrect.
If the config cannot be loaded the user should not be instructed
to re-upload the config with kubeadm commands. Instead they
should do it manually with kubectl.

On loadConfig() error just wrap the error in a simple message
and show it to the user.

The current setup stomps missing IsNotFound errors for Node objects.
The underlying fetching of init configuration uses
the node object to construct an initconfiguration for this
upgrade process, so if the Node is missing the kube-config CM
will be reported as missing, which is incorrect.
2023-11-27 16:11:45 +02:00
xin.li
1dcb31aebb kubeadm: fix flaky test TestRetrieveValidatedConfigInfo
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-11-20 23:42:54 +08:00
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
xin.li
29335763fe kubeadm: increase ut coverage app/upgrade/versiongetter
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-11-08 09:45:42 +08: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
Mohamed Omar Zaian
3c268b7524 etcd: Update to version 3.5.10 2023-11-02 10:30:41 +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
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
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
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
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
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
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
SataQiu
16b3acc27a cleanup UnknownCRISocket for unit tests 2023-10-24 16:46:51 +08:00
SataQiu
71bedf5cb2 kubeadm: skip CRI detection for 'kubeadm upgrade diff' 2023-10-24 16:43:46 +08:00
Paco Xu
fb0ffb07a7 kubeadm coredns use drop ALL instead of all 2023-10-20 17:59:39 +08:00
SataQiu
a4efb6fc13 kubeadm: add debug log for kubeProxyConfigFromCluster 2023-10-20 11:01:30 +08:00
Kubernetes Prow Robot
c3809672aa
Merge pull request #121352 from SataQiu/fix-kubeadm-2023101902
kubeadm: remove unused DNSAddOnType from v1beta4 API
2023-10-19 14:05:59 +02:00
SataQiu
8ae3277152 kubeadm: remove unused DNSAddOnType from v1beta4 API 2023-10-19 17:44:41 +08:00
SataQiu
259dd93e71 kubeadm: skip CRI detection for 'kubeadm config validate' 2023-10-19 15:08:47 +08:00
SataQiu
3da7802b7c kubeadm: cleanup UnknownCRISocket from staticpods test 2023-10-19 14:44:02 +08:00
Kubernetes Prow Robot
1cb6793776
Merge pull request #121262 from my-git9/ut-tlsbootstrap
kubeadm: increase ut coverage for bootstraptoken/node
2023-10-18 08:38:15 +02:00
xin.li
e312d93a66 kubeadm: increase ut coverage for bootstraptoken/node
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-10-18 12:16:31 +08:00
Kubernetes Prow Robot
478c934c1a
Merge pull request #121295 from SataQiu/clean-kubeadm-20231017
kubeadm: remove reference to UnknownCRISocket from getInitConfigurationFromCluster
2023-10-18 06:06:59 +02:00
Kubernetes Prow Robot
ba7feccfa3
Merge pull request #121290 from pacoxu/revert-119946-ignore_preflight_error
Revert "kubeadm: FeatureGate MergeCLIArgumentsWithConfig is added for ignorePreflightErrors"
2023-10-17 17:21:36 +02:00
Kubernetes Prow Robot
760599db27
Merge pull request #121282 from neolit123/1.29-fix-typos-in-elliptic-kubeadm-api
kubeadm: fix "eliptic" typo in API package
2023-10-17 16:14:36 +02:00
SataQiu
c281c70bac kubeadm: remove reference to UnknownCRISocket from getInitConfigurationFromCluster 2023-10-17 21:50:05 +08:00
Paco Xu
e3c58378bc
Revert "kubeadm: FeatureGate MergeCLIArgumentsWithConfig is added for ignorePreflightErrors" 2023-10-17 20:26:58 +08:00
Lubomir I. Ivanov
a45a813d5e kubeadm: fix "eliptic" typo in API package
Should be "elliptic".
2023-10-17 12:16:03 +03:00
Dave Chen
defda81bf8 kubeadm: remove ClusterConfiguration parameter from preflight check
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-10-17 15:17:46 +08:00
Kubernetes Prow Robot
3548ef0092
Merge pull request #119946 from chendave/ignore_preflight_error
kubeadm: FeatureGate MergeCLIArgumentsWithConfig is added for ignorePreflightErrors
2023-10-16 14:41:19 +02:00
Kubernetes Prow Robot
4254a77c21
Merge pull request #121249 from pohly/klog-call-fixes
fix invalid log calls
2023-10-16 13:14:01 +02:00
Patrick Ohly
957adfac49 fix invalid log calls
These were found with a modified klog that enables "go vet" to check klog call
parameters:

    cmd/kubeadm/app/features/features.go:149:4: printf: k8s.io/klog/v2.Warningf format %t has arg v of wrong type string (govet)
    			klog.Warningf("Setting deprecated feature gate %s=%t. It will be removed in a future release.", k, v)
    test/images/sample-device-plugin/sampledeviceplugin.go:147:5: printf: k8s.io/klog/v2.Errorf does not support error-wrapping directive %w (govet)
    				klog.Errorf("error: %w", err)
    test/images/sample-device-plugin/sampledeviceplugin.go:155:3: printf: k8s.io/klog/v2.Errorf does not support error-wrapping directive %w (govet)
    		klog.Errorf("Failed to add watch to %q: %w", triggerPath, err)
    staging/src/k8s.io/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go:207:5: printf: k8s.io/klog/v2.Fatalf does not support error-wrapping directive %w (govet)
    				klog.Fatalf("Package %v: unsupported %s value: %q :%w", i, tagEnabledName, ptag.value, err)
    staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:286:3: printf: (k8s.io/klog/v2.Verbose).Infof format %s reads arg #1, but call has 0 args (govet)
    		klog.V(4).Infof("Node %s missing in vSphere cloud provider cache, trying node informer")
    staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:302:3: printf: (k8s.io/klog/v2.Verbose).Infof format %s reads arg #1, but call has 0 args (govet)
    		klog.V(4).Infof("Node %s missing in vSphere cloud provider caches, trying the API server")
2023-10-16 10:21:07 +02:00
Dave Chen
8009530d77 kubeadm: FeatureGate MergeCLIArgumentsWithConfig is added for ignorePreflightErrors
Turn on FeatureGate MergeCLIArgumentsWithConfig to keep the legacy way of management of
ignorePreflightErrors, which means the value defined by the flag `ignore-preflight-errors`
will be merged with the value `ignorePreflightErrors` defined in the config file.

Otherwise, the value defined by the flag will replace the value from the config file if set.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-10-16 14:37:10 +08:00
Kubernetes Prow Robot
afc302c2d2
Merge pull request #121230 from SataQiu/fix-kubeadm-20231014
kubeadm: fill with the DefaultCRISocket when CRI socket detection is not required
2023-10-16 06:45:18 +02:00
xin.li
6732c4110f kubeadm: fix uninvalid namespace field for clusterrole
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-10-15 18:49:52 +08:00
SataQiu
32d2afe42b kubeadm: fill with the DefaultCRISocket when CRI socket detection is not required 2023-10-14 16:21:38 +08:00
Kubernetes Prow Robot
c2db4d03dc
Merge pull request #121136 from carlory/fix-kubeadm-2941
kubeadm: using struct option rather than a long list of parameters
2023-10-13 12:31:21 +02:00
carlory
db8e106e3f Code Refactor: using struct option rather than a long list of parameters
Co-authored-by: Shida Qiu <shidaqiu2018@gmail.com>
2023-10-13 17:17:03 +08:00
Kubernetes Prow Robot
801932c012
Merge pull request #120825 from pacoxu/kubeadm-skew-match
kubeadm: adjust kubeadm skew policy for upgrades
2023-10-12 16:00:02 +02:00
SataQiu
adae1e33ea kubeadm: remove AlphaDisclaimer for certs phases 2023-10-12 15:11:12 +08:00
Paco Xu
7b1d87383e add kubelet policy skew test for kubeadm 2023-10-12 11:17:05 +08:00
Kubernetes Prow Robot
12458285b9
Merge pull request #120788 from chendave/componentCfg
kubeadm: Remove the support of configurable component configs
2023-10-11 04:42:53 +02:00
SataQiu
c3bf541ede kubeadm: clean up unnecessary references to UnknownCRISocket 2023-10-08 16:57:45 +08:00