Commit Graph

66 Commits

Author SHA1 Message Date
tanjunchen
b1e03256d7 alias kubeadmutil for k8s.io/kubernetes/cmd/kubeadm/app/util 2019-12-27 17:57:04 +08:00
hwdef
eae3e3ce8c cmd/kubeadm/app: fix staticcheck warning 2019-11-01 10:39:56 +08:00
Ted Yu
2167321adb Remove Client#ClusterAvailable from interface 2019-08-29 07:40:34 -07:00
Kubernetes Prow Robot
d54c5163e0
Merge pull request #81458 from fabriziopandini/kubeadm-kustomize-ux
kubeadm: kustomize-ux
2019-08-22 05:46:32 -07:00
Ted Yu
4f9d20e0f9 Remove boolean waitForComponentRestart which is always true in upgradeComponent 2019-08-17 18:50:55 -07:00
fabriziopandini
a92e7975d2 kubeadm-kustomize-ux 2019-08-15 09:14:31 +02:00
fabriziopandini
5eca049557 placeholders for follow-up PR on kustomize UX 2019-08-12 14:17:19 +02:00
fabriziopandini
c2faa3bfd1 kubeadm upgrade node 2019-05-29 22:06:42 +02:00
fabriziopandini
6db533dd5b refactor certs renewal 2019-05-15 10:25:50 +02:00
SataQiu
d46bd0dc7a make KubernetesDir a true constant 2019-05-09 17:16:59 +08:00
fabriziopandini
cf7f8acae2 renew-embedded-certs 2019-05-06 16:48:24 +02:00
fabriziopandini
137137cbaa fix-upgrade-certs-renew 2019-04-27 09:58:17 +02:00
Kubernetes Prow Robot
a73730147c
Merge pull request #76564 from tedyu/adm-clean-all
Cleanup as many dirs as possible in CleanupDirs
2019-04-15 08:14:05 -07:00
Ted Yu
185f02dd1a Cleanup as many dirs as possible in CleanupDirs
Signed-off-by: Ted Yu <yute@vmware.com>
2019-04-15 06:10:33 -07:00
Ted Yu
3e0423926a Return aggregate error from rollbackOldManifests 2019-04-14 10:06:07 -07:00
SataQiu
8b7b2349c7 capitalize the first letter of the prompt for consistency 2019-04-14 19:10:51 +08:00
vanduc95
ae1ec8826a kubeadm cleanup: master -> control-plane (cont.2) 2019-02-21 10:02:24 +07:00
Rostislav M. Georgiev
80e2a3cf07 kubeadm: reduce the usage of InitConfiguration
For historical reasons InitConfiguration is used almost everywhere in kubeadm
as a carrier of various configuration components such as ClusterConfiguration,
local API server endpoint, node registration settings, etc.

Since v1alpha2, InitConfiguration is meant to be used solely as a way to supply
the kubeadm init configuration from a config file. Its usage outside of this
context is caused by technical dept, it's clunky and requires hacks to fetch a
working InitConfiguration from the cluster (as it's not stored in the config
map in its entirety).

This change is a small step towards removing all unnecessary usages of
InitConfiguration. It reduces its usage by replacing it in some places with
some of the following:

- ClusterConfiguration only.
- APIEndpoint (as local API server endpoint).
- NodeRegistrationOptions only.
- Some combinations of the above types, or if single fields from them are used,
  only those field.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-01-28 12:21:01 +02:00
yuexiao-wang
39f71245b3 kubeadm: fixed cleanup upgrade from no-TLS etcd to TLS etcd
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-12-08 08:38:03 +08:00
yuexiao-wang
5610ac3c9c cleanup upgrade from non-TLS etcd to TLS etcd
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-12-05 23:10:13 +08:00
Rostislav M. Georgiev
0110b6e8bf kubeadm: Remove forgotten debug Println
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-11-22 17:05:23 +02:00
Dane LeBlanc
99887716c5 Fix kubeadm etcd manifests to use brackets around IPv6 addrs
When 'kubeadm init ...' is used with an IPv6 kubeadm configuration,
kubeadm currently generates an etcd.yaml manifest that uses IP:port
combinatins where the IP is an IPv6 address, but it is not enclosed
in square brackets, e.g.:
    - --advertise-client-urls=https://fd00:20::2:2379
For IPv6 advertise addresses, this should be of the form:
    - --advertise-client-urls=https://[fd00:20::2]:2379

The lack of brackets around IPv6 addresses in cases like this is
causing failures to bring up IPv6-only clusters with Kubeadm as
described in kubernetes/kubeadm Issues #1212.

This format error is fixed by using net.JoinHostPort() to generate
URLs as shown above.

Fixes kubernetes/kubeadm Issue #1212
2018-11-16 15:12:29 -05:00
Lucas Käldström
731bcdc864
kubeadm: InitConfiguration.APIEndpoint -> LocalAPIEndpoint 2018-11-09 14:47:21 +02:00
Yago Nobre
cc670e29a1
Fix typos on cmd/kubeadm/app/cmd 2018-10-31 16:32:02 -03:00
yuexiao-wang
cc303c8774 [kubeadm/app/]switch to github.com/pkg/errors
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-10-30 16:23:24 +08:00
fabriziopandini
d30492ee8f kubeadm graduate kubelet-start phase 2018-10-27 18:04:33 +02:00
yuexiao-wang
f15410692e [kubeadm/app/util]switch to github.com/pkg/errors
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-10-26 15:17:21 +08:00
Ed Bartosh
1ada4b23b7 kubeadm: fix typo: missing round bracket 2018-10-21 00:42:08 +03:00
Ed Bartosh
ad0179897d kubeadm: skip upgrade if manifest is not changed
When doing upgrades kubeadm generates new manifest and
waits until kubelet restarts correspondent pod.

However, kubelet won't restart pod if there are no changes
in the manifest. That makes kubeadm stuck waiting for
restarted pod.

Skipping upgrade if new component manifest is the same as
current manifest should solve this.

Fixes: kubernetes/kubeadm#1054
2018-10-17 11:07:51 +03:00
fabriziopandini
66e846fa26 Add etcd ports constant 2018-10-12 09:33:07 +02:00
k8s-ci-robot
3fe21e5433
Merge pull request #68922 from BenTheElder/version-staging
move pkg/util/version to staging
2018-09-26 22:59:42 -07:00
k8s-ci-robot
893e87bf30
Merge pull request #68079 from huangqg/fix_kubeadm_typo
fix typos in some files
2018-09-25 05:02:04 -07:00
Benjamin Elder
8b56eb8588 hack/update-gofmt.sh 2018-09-24 12:21:29 -07:00
Benjamin Elder
088cf3c37b find & replace version import 2018-09-24 12:03:24 -07:00
liz
c2a93cbe06
Renew certificates as part of upgrade rather than recreating them 2018-09-17 13:24:34 -04:00
Jerry Huang
d21c6fb381 fix typos 2018-08-31 10:10:38 +08:00
fabriziopandini
202e67c4a7 kubeadm-ha-upgrade 2018-08-22 23:09:16 +02:00
liz
394e6b554a
Yank out a bunch of manual tests and prose
`phase certs` and upgrade commands now all use certslist infra
2018-08-20 15:21:08 -04:00
Lucas Käldström
52f0591ad9
Automated rename from MasterConfiguration to InitConfiguration 2018-07-09 04:55:02 +03:00
Xianglin Gao
b309ace793 kubeadm-upgrade: notify the user of manifest upgrade timeouts
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-06-26 00:03:00 +08:00
liz
6ed91fc07c
Save kubeadm manifest backup directories
When kubeadm upgrades a static pod cluster, the old manifests were previously
deleted. This patch alters this behaviour so they are now stored in a
timestamped temporary directory.
2018-05-31 14:41:47 -04:00
Lucas Käldström
b48f23b786
kubeadm: Move .NodeName and .CRISocket to a common sub-struct 2018-05-29 17:51:39 +03:00
Lucas Käldström
099e60b1db
kubeadm: Refactor the .Etcd substruct in the v1alpha2 API 2018-05-23 21:13:32 +03:00
Jason DeTiberus
f40b7f389e
kubeadm - fix external etcd upgrades
- Update upgrade plan output when configured for external etcd
  - Move etcd to a separate section and show available upgrades
2018-05-14 20:51:20 -04:00
Craig Tracey
ac1e940c75
Support kubeadm upgrade with remote etcd cluster
Currently kubeadm only performs an upgrade if the etcd cluster is
colocated with the control plane node. As this is only one possible
configuration, kubeadm should support upgrades with etcd clusters
that are not local to the node.

Signed-off-by: Craig Tracey <craigtracey@gmail.com>
2018-05-14 20:40:57 -04:00
leigh schrandt
dac4fe84bb [kubeadm] Fix Etcd Rollback
Fix `rollbackEtcdData()` to return error=nil on success
`rollbackEtcdData()` used to always return an error making the rest of the
upgrade code completely unreachable.

Ignore errors from `rollbackOldManifests()` during the rollback since it
always returns an error.
Success of the rollback is gated with etcd L7 healthchecks.

Remove logic implying the etcd manifest should be rolled back when
`upgradeComponent()` fails
2018-04-24 09:56:42 -06:00
Jason DeTiberus
4c768bb2ca [kubeadm] Add etcd L7 check on upgrade
- Adds L7 check for kubeadm etcd static pod upgrade
2018-04-24 09:56:35 -06:00
leigh schrandt
8129480d44 [kubeadm] Modify the kubeadm upgrade DAG for the TLS Upgrade
- Calculate `beforePodHashMap` before the etcd upgrade in anticipation of KubeAPIServer downtime
- Detect if pre-upgrade etcd static pod cluster `HasTLS()==false` to switch on the Etcd TLS Upgrade
if TLS Upgrade:
  - Skip L7 Etcd check (could implement a waiter for this)
  - Skip data rollback on etcd upgrade failure due to lack of L7 check (APIServer is already down unable to serve new requests)
  - On APIServer upgrade failure, also rollback the etcd manifest to maintain protocol compatibility

- Add logging
2018-04-24 09:55:56 -06:00
leigh schrandt
4a37e05665 [kubeadm] Update test-case, fix nil-pointer bug, and improve error message 2018-04-24 09:55:56 -06:00
leigh schrandt
99a1143676 [kubeadm] Implement etcdutils with Cluster.HasTLS()
- Test HasTLS()
- Instrument throughout upgrade plan and apply
- Update plan_test and apply_test to use new fake Cluster interfaces
- Add descriptions to upgrade range test
- Support KubernetesDir and EtcdDataDir in upgrade tests
- Cover etcdUpgrade in upgrade tests
- Cover upcoming TLSUpgrade in upgrade tests
2018-04-24 09:55:51 -06:00