Commit Graph

698 Commits

Author SHA1 Message Date
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Kubernetes Prow Robot
9e88546f30
Merge pull request #91065 from SataQiu/fix-kubeadm-20200513
kubeadm: log more information when missing the necessary config element
2020-05-15 02:49:17 -07:00
SataQiu
281f44628f kubeadm: log more information when missing the necessary config element
Signed-off-by: SataQiu <1527062125@qq.com>
2020-05-14 10:07:03 +08:00
Kubernetes Prow Robot
3b024339bd
Merge pull request #90645 from neolit123/1.19-fix-retry-etcd-member-add
kubeadm: fix flakes when performing etcd MemberAdd on slower setups
2020-05-13 06:04:26 -07:00
Lubomir I. Ivanov
1c430ff30f kubeadm: fix flakes when performing etcd MemberAdd on slower setups
In slower setups it can take more time for the existing cluster
to be in a healthy state, so the existing backoff of ~50 seconds
is apparently not sufficient.

The client dial can also fail for similar reasons.

Improve kubeadm's join toleration of adding new etcd members.
Wrap both the client dial and member add in a longer backoff
(up to ~200 seconds).

This particular change should be backported to the support skew.
In a future change for master, all etcd client operations should be
make consistent so that the etcd logic is in a sane state.
2020-04-30 18:53:29 +03:00
SataQiu
afb1ea44b9 kubeadm: do not set deprecated '--cgroup-driver' flag in kubeadm-flags.env, this value will be set in config.yaml 2020-04-27 15:32:10 +08:00
Jie Shen
363bb39142
Use utils.net to parse ports instead of atoi (#89120) 2020-04-21 20:55:52 -07:00
tangcong
90481a9596 fix kubeadm staticcheck err 2020-04-21 06:54:42 +08:00
SataQiu
004a61a46c kubeadm: fix some mistakes about log output 2020-04-15 14:32:46 +08:00
Kubernetes Prow Robot
2624a4ad46
Merge pull request #80943 from obitech/yaml_meta
Add a YAML MetaFactory
2020-04-13 02:05:47 -07:00
Lubomir I. Ivanov
83a59c02f9 kubeadm: switch control-plane static Pods to "system-node-critical"
Use the priority class "system-node-critical" to ensure
the control-plane static Pods have the highest possible priority.
2020-04-10 23:05:33 +03:00
Kubernetes Prow Robot
2da163bcf5
Merge pull request #89588 from rosti/kubeadm-etcd-upgrade
kubeadm: Use image tag as version of stacked etcd
2020-04-09 18:08:03 -07:00
SataQiu
871b90ba23 kube-proxy: add '--bind-address-hard-fail' flag to treat failure to bind to a port as fatal
Signed-off-by: SataQiu <1527062125@qq.com>
2020-04-02 13:13:10 +08:00
Rostislav M. Georgiev
c8b7e5739c kubeadm: Use image tag as version of stacked etcd
kubeadm uses image tags (such as `v3.4.3-0`) to specify the version of
etcd. However, the upgrade code in kubeadm uses the etcd client API to
fetch the currently deployed version. The result contains only the etcd
version without the additional information (such as image revision) that
is normally found in the tag. As a result it would refuse an upgrade
where the etcd versions match and the only difference is the image
revision number (`v3.4.3-0` to `v3.4.3-1`).

To fix the above issue, the following changes are done:
- Replace the existing etcd version querying code, that uses the etcd
  client library, with code that returns the etcd image tag from the
  local static pod manifest file.
- If an etcd `imageTag` is specified in the ClusterConfiguration during
  upgrade, use that tag instead. This is done regardless if the tag was
  specified in the configuration stored in the cluster or with a new
  configuration supplied by the `--config` command line parameter.
  If no custom tag is specified, kubeadm will select one depending on
  the desired Kubernetes version.
- `kubeadm upgrade plan` no longer prints upgrade information about
  external etcd. It's the user's responsibility to manage it in that
  case.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2020-03-30 16:28:45 +03:00
Jordan Liggitt
b7c2faf26c client-go dynamic client: add context to callers 2020-03-06 10:56:23 -05:00
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -08:00
Dmitry Rozhkov
109f5db5a3 kubeadm: allow creating a cluster with ECDSA keys
The selected key type is defined by kubeadm's --feature-gates option:
if it contains PublicKeysECDSA=true then ECDSA keys will be generated
and used.

By default RSA keys are used still.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2020-02-24 11:20:07 +02:00
Kubernetes Prow Robot
b513f359a0
Merge pull request #88429 from taesunny/master
Fix: cmd/kubeadm Typos in some error messages, comments
2020-02-23 11:14:47 -08:00
Kubernetes Prow Robot
31b8c0d23d
Merge pull request #87656 from ereslibre/do-not-depend-on-cluster-status
kubeadm: deprecate the `ClusterStatus` dependency
2020-02-22 22:30:47 -08:00
Taesun Lee
d10e3da92d Fix typos in some error messages, comments
- cmd/kubeadm
- RemoveContnainers -> RemoveContainers
- iterface -> interface
- stategicMergeSlice -> strategicMergeSlice
2020-02-23 00:44:47 +09:00
Rafael Fernández López
3e59a0651f
kubeadm: optimize the upgrade path from ClusterStatus to annotations
When doing the very first upgrade from a cluster that contains the
source of truth in the ClusterStatus struct, the new kubeadm logic
will try to retrieve this information from annotations.

This changeset adds to both etcd and apiserver endpoint retrieval the
special case in which they won't retry if we are in such cases. The
logic will retry if we find any unknown error, but will not retry in
the following cases:

- etcd annotations do not contain etcd endpoints, but the overall list
  of etcd pods is greater than 0. This means that we listed at least
  one etcd pod, but they are missing the annotation.

- API server annotation is not found on the api server pod for a given
  node name, but no errors aside from that one were found. This means
  that the API server pod is present, but is missing the annotation.

In both cases there is no point in retrying, and so, this speeds up the
upgrade path when coming from a previous existing cluster.
2020-02-20 12:19:05 +01:00
Rafael Fernández López
b140c5d64b
kubeadm: remove ClusterStatus dependency
While `ClusterStatus` will be maintained and uploaded, it won't be
used by the internal `kubeadm` logic in order to determine the etcd
endpoints anymore.

The only exception is during the first upgrade cycle (`kubeadm upgrade
apply`, `kubeadm upgrade node`), in which we will fallback to the
ClusterStatus to let the upgrade path add the required annotations to
the newly created static pods.
2020-02-20 12:18:56 +01:00
Taesun Lee
97fc3e6139
Fix typos in apiclient util
fix initalTimeout to initialTimeout
2020-02-20 15:20:04 +09:00
Benjamin Elder
a00a1e39ef bump pause to 3.2 in kubeadm 2020-02-14 11:40:15 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Kubernetes Prow Robot
334d788f08 Merge pull request #87299 from mikedanese/ctx
context in client-go
2020-02-08 06:43:52 -08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
RA489
ad9d2d71c0 remove bash examples/comments from the v1beta1 and v1beta2 APIs 2020-02-07 11:27:02 +05:30
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
Lubomir I. Ivanov
a027c379f7 kubeadm: increase timeouts in the etcd client
- Extend the exponential backoff for add/remove/... retry to
11 steps ~=106 seconds. From experiments for 3 and more members
the race can take more that ~=26 seconds.
- Increase the dialTimeout for client creation to 40 seconds.
20 seconds seems racy for 3 and more members.
2020-01-25 00:48:05 +02:00
Lubomir I. Ivanov
5e0c0779a1 kubeadm: handle multiple members without names during concurrent join
For the etcd client, amend AddMember() to handle a very
rare bug when multiple members can end up with the same
name. Match the member peer address and assign it the name of
the member we are adding. For the rest of the members with missing
names use their member IDs as name. The etcd node is not disrupted
by the unknown names.

The important aspects are:
- The number of members of the initial cluster must match
the members in the cluster.
- The member we are current adding is present in the initial cluster.
2020-01-25 00:48:05 +02:00
Kubernetes Prow Robot
916edd922e
Merge pull request #86861 from SataQiu/fix-kubeadm-20200106
kubeadm upgrades always persist the etcd backup for stacked
2020-01-16 21:38:56 -08:00
Kubernetes Prow Robot
3e8155ead3
Merge pull request #86899 from SataQiu/enable-pull-retry-20200107
kubeadm: support automatic retry after failing to pull image
2020-01-13 13:58:41 -08:00
SataQiu
c7234aa177 kubeadm: support automatic retry after failing to pull image 2020-01-11 15:10:56 +08:00
Rostislav M. Georgiev
7f2d675ad0 kubeadm: Fix a false positive in a warning
The warning message

```
[config] WARNING: Ignored YAML document with GroupVersionKind ...
```

is printed for all GVKs that are not part of the kubeadm core types.
This is wrong as the component config types are supported and successfully
parsed and used despite the fact that the warning is printed for them too.

Hence this simple fix first checks if the group of the GVK is a supported
component config group and the warning is printed only if it's not.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2020-01-07 17:55:50 +02:00
SataQiu
72559ec693 kubeadm upgrades always persist the etcd backup for stacked 2020-01-06 12:34:28 +08:00
Kubernetes Prow Robot
3760d24674
Merge pull request #86493 from aojea/kubeadmAddress
kubeadm: use bind-address instead of address to configure the http probes
2020-01-03 19:13:40 -08:00
Antonio Ojea
c0bc36c12e kubeadm: probe address for unspecified ips
kubeadm deploys the apiserver, controller-manager and the scheduler
using liveness probes.
The bind-address option is used to configure the probe address, in
case this is configured with an unspecified address, the probe
will fail. When using an unspecified address the probe host field is
left empty, otherwise the bind-address is used.
2020-01-04 00:42:15 +01:00
Kubernetes Prow Robot
f772c9017c
Merge pull request #86609 from Pensu/kubeadm-ci-master
Fixing regex for kubernetes version in kubeadm
2019-12-30 14:29:39 -08:00
Peeyush Gupta
49884bca30 Fixing regex for kubernetes version in kubeadm 2019-12-30 21:12:24 +05:30
tanjunchen
b1e03256d7 alias kubeadmutil for k8s.io/kubernetes/cmd/kubeadm/app/util 2019-12-27 17:57:04 +08:00
Kubernetes Prow Robot
1ca0f89aa1
Merge pull request #86508 from kvaster/master
On OpenRC ServiceIsActive should not report true if no such service exists
2019-12-24 01:05:29 -08:00
SataQiu
2497a1209b bump k8s.io/utils version 2019-12-21 14:54:44 +08:00
Antonio Ojea
7dc6c94395 kubeadm: use bind-address instead of address
kubeadm removed the deprecated "--address" flag for controller-manager
and scheduler in favor of "--bind-address"

We should use bind-address to configure the manifest probe addresses.
2019-12-20 22:03:49 +01:00
Viktor Kuzmin
947d696021 On OpenRC ServiceIsActive should not report true if no such service exists 2019-12-20 23:12:16 +03:00
Lubomir I. Ivanov
effe299082 kubeadm: add basic validation around kubelet.conf parsing
If the user has modified the kubelet.conf post TLS bootstrap
to become invalid, the function getNodeNameFromKubeletConfig() can
panic. This was observed to trigger in "kubeadm reset" use cases.

Add basic validation and unit tests around parsing the kubelet.conf
with the aforementioned function.
2019-12-12 17:30:53 +02:00
Kubernetes Prow Robot
674695c544
Merge pull request #85639 from rosti/kubeadm-cc-kind-to-group
kubeadm: Group centric component configs
2019-12-03 17:01:23 -08:00
Kubernetes Prow Robot
3769de9401
Merge pull request #85745 from aojea/kubeadm_etcd_ipv6
kubeadm: default etcd address based on the IP family
2019-12-02 15:02:58 -08:00
Rafael Fernández López
14fe7225c1
kubeadm: Improve resiliency in CreateOrMutateConfigMap
CreateOrMutateConfigMap was not resilient when it was trying to Create
the ConfigMap. If this operation returned an unknown error the whole
operation would fail, because it was strict in what error it was
expecting right afterwards: if the error returned by the Create call
was a IsAlreadyExists error, it would work fine. However, if an
unexpected error (such as an EOF) happened, this call would fail.

We are seeing this error specially when running control plane node
joins in an automated fashion, where things happen at a relatively
high speed pace.

It was specially easy to reproduce with kind, with several control
plane instances. E.g.:

```
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
I1130 11:43:42.788952     887 round_trippers.go:443] POST https://172.17.0.2:6443/api/v1/namespaces/kube-system/configmaps?timeout=10s  in 1013 milliseconds
Post https://172.17.0.2:6443/api/v1/namespaces/kube-system/configmaps?timeout=10s: unexpected EOF
unable to create ConfigMap
k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient.CreateOrMutateConfigMap
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient/idempotency.go:65
```

This change makes this logic more resilient to unknown errors. It will
retry on the light of unknown errors until some of the expected error
happens: either `IsAlreadyExists`, in which case we will mutate the
ConfigMap, or no error, in which case the ConfigMap has been created.
2019-11-30 22:48:16 +01:00