Commit Graph

720 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
19f0a54d6b
Merge pull request #92183 from wallrj/2163-csr-only-external-ca-mode-2
kubeadm alpha certs generate-csr
2020-07-13 07:18:32 -07:00
Kubernetes Prow Robot
82baa26905
Merge pull request #92753 from QianChenglong/fix/kubeadm-altnames
kubeadm: remove duplicate DNS names and IP addresses from generated certificates
2020-07-09 09:10:20 -07:00
Richard Wall
57712220a1 Add new helper functions for creating keys, kubeconfig and CSR files
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-07-09 06:16:22 +01:00
Rostislav M. Georgiev
d023f3d25d kubeadm: Cleanup and refactor the LoadJoinConfigurationFromFile test
Back in the v1alpha2 days the fuzzer test needed to be disabled. To ensure that
there were no config breaks and everything worked correctly extensive replacement
tests were put in place that functioned as unit tests for the kubeadm config utils
as well.

The fuzzer test has been reenabled for a long time now and there's no need for
these replacements. Hence, over time most of these were disabled, deleted and
refactored. The last remnants are part of the LoadJoinConfigurationFromFile test.

The test data for those old tests remains largely unused today, but it still receives
updates as it contains kubelet's and kube-proxy's component configs. Updates to these
configs are usually done because the maintainers of those need to add a new field.

Hence, to cleanup old code and reduce maintenance burden, the last test that depends
on this test data is finally refactored and cleaned up to represent a simple unit test
of `LoadJoinConfigurationFromFile`.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2020-07-03 20:00:49 +03:00
QianChenglong
883f318df4 Fix duplicate altnames in cert 2020-07-03 12:14:36 +08:00
Kubernetes Prow Robot
d71a09271c
Merge pull request #92017 from neolit123/1.19-patches
kubeadm: introduce --experimental-patches and deprecate --experimental-kustomize
2020-07-02 04:17:01 -07:00
Kubernetes Prow Robot
4c523b1981
Merge pull request #92131 from SataQiu/fix-etcd-opt-20200615
kubeadm: increase robustness for kubeadm etcd operations
2020-07-01 00:06:21 -07:00
Lubomir I. Ivanov
ceb768ccbd kubeadm: apply patches to static Pods
Add PatchStaticPod() in staticpod/utils.go

Apply patches to static Pods in:
- phases/controlplane/CreateStaticPodFiles()
- phases/etcd/CreateLocalEtcdStaticPodManifestFile() and
CreateStackedEtcdStaticPodManifestFile()

Add unit tests and update Bazel.
2020-06-26 02:14:47 +03:00
Lubomir I. Ivanov
5506049b87 kubeadm: add logic for patching components in util/patches 2020-06-26 02:14:47 +03:00
Kubernetes Prow Robot
a463b25c9d
Merge pull request #91980 from rosti/kubeadm-cc-manual-upgrade
kubeadm upgrade: Allow supplying hand migrated component configs
2020-06-23 09:35:42 -07:00
SataQiu
800dd19fc2 increase robustness for kubeadm etcd operations
Signed-off-by: SataQiu <1527062125@qq.com>
2020-06-15 22:43:21 +08:00
Xianglin Gao
04ef3628e3 refact CreateOrMutateConfigMap and MutateConfigMap with PollImmediate
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2020-06-11 00:31:22 +08:00
Rostislav M. Georgiev
5d0127493c kubeadm upgrade plan: don't load component configs
Component configs are used by kubeadm upgrade plan at the moment. However, they
can prevent kubeadm upgrade plan from functioning if loading of an unsupported
version of a component config is attempted. For that matter it's best to just
stop loading component configs as part of the kubeadm config load process.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2020-06-10 14:23:53 +03:00
Xianglin Gao
6d572ea9b7 Add retries for CreateOrUpdateRoleBinding
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2020-06-10 00:23:46 +08:00
Xianglin Gao
052eb7d9a5 Add retries for CreateOrUpdateRole
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2020-06-10 00:12:25 +08:00
Kubernetes Prow Robot
40076c856e
Merge pull request #91179 from SataQiu/startup-probe-20200517
kubeadm: add startup probes for static Pods to protect slow starting containers
2020-06-02 18:10:31 -07:00
Kubernetes Prow Robot
02637bb250
Merge pull request #91145 from tnqn/kubeadm-reset-error
kubeadm: skip removing last etcd member in reset phase
2020-05-27 15:04:01 -07:00
SataQiu
e04a2b3b26 kubeadm: add startup probes for static Pods to protect slow starting containers
Signed-off-by: SataQiu <1527062125@qq.com>
2020-05-21 11:12:36 +08:00
Quan Tian
9cc416e7df kubeadm: do not remove the only remaining etcd member during reset
If this is the only remaining stacked etcd member in the cluster,
calling RemoveMember() is not needed.
2020-05-21 02:12:36 +08:00
Kubernetes Prow Robot
b170451caa
Merge pull request #90183 from dims/update-kubernetes-to-klog-v2
Update kubernetes to klog v2
2020-05-16 18:59:51 -07:00
Kubernetes Prow Robot
694a9c242e
Merge pull request #90970 from johscheuer/add-readiness-to-controlplane
kubeadm: use two separate checks on /livez and /readyz for the kube-apiserver
2020-05-16 07:36:49 -07:00
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
Johannes M. Scheuermann
9a1cbc2711 Use livez and readyz endpoint for API server probes 2020-05-14 17:41:05 +02: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