Commit Graph

75 Commits

Author SHA1 Message Date
Paco Xu
b1ee8c8b82 kubeadm: no need to check if target coredns version is not changed 2023-02-25 21:53:28 +08:00
SataQiu
d4cafe4738 kubeadm: optimize and make the usage consistent about apierrors.IsNotFound 2022-10-13 23:23:53 +08:00
Paco Xu
4daf5f903b kubeadm: cleanup master related taint and tolerations 2022-08-25 22:22:20 +08:00
wangyysde
e863ebb6b5 add print-manifest flag to print addon manifests to STDOUT
Signed-off-by: wangyysde <net_use@bzhy.com>
2022-06-08 13:45:37 +08:00
Paco Xu
a0cc3f1c9a cleanup: DualStack GA for kubeadm 2021-09-04 22:38:14 +08:00
XinYang
72fd01095d
re-order imports for kubeadm
Signed-off-by: XinYang <xinydev@gmail.com>
2021-08-17 22:40:46 +08:00
XinYang
c2a8cd359f
re-order the imports in kubeadm
Signed-off-by: XinYang <xinydev@gmail.com>

Update cmd/kubeadm/app/cmd/join.go

Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
2021-07-04 16:41:27 +08:00
Lubomir I. Ivanov
0bdfe05cf2 kubeadm: remove ClusterConfiguration.DNS.Type from v1beta3
Kubeadm no longer supports kube-dns and CoreDNS is the only
supported DNS server. Remove ClusterConfiguration.DNS.Type
from v1beta3 that is used to set the DNS server type.
2021-05-11 01:31:01 +03:00
Sandeep Rajan
b8a1bd6a6c remove the deprecated kube-dns as an option in kubeadm 2021-03-04 12:12:54 -05:00
Lubomir I. Ivanov
3b5e698cb2 kubeadm: trim leading "v" when running CoreDNS migration preflight
During upgrade the coredns migration library seems to require
that the input version doesn't have the "v" prefix".

Fixes a bug where the user cannot run commands such as
"kubeadm upgrade plan" if they have `v1.8.0` installed.

Assuming this is caused by the fact that previously the image didn't
have a "v" prefix.
2021-01-11 18:21:19 +02:00
Kubernetes Prow Robot
80be1d6c72
Merge pull request #96429 from rajansandeep/coredns180-kubeadm
[kubeadm]: Bump CoreDNS version to 1.8.0
2020-12-29 13:19:48 -08:00
Sandeep Rajan
2eabd9d832 fix migration logic
modify addon test to cover the entire migration logic
2020-12-02 12:53:07 -05:00
Paco Xu
4525f3fef8 coredns dep.Severity is newdefault, not newDefault
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2020-11-27 18:17:02 +08:00
Sandeep Rajan
40862c3b60 bump coredns to 1.8.0 2020-11-16 15:22:05 -05:00
Lubomir I. Ivanov
fb7ddf88e9 kubeadm: mark the "master" label/taint as deprecated
- Mark the "node-role.kubernetes.io/master" key for labels
and taints as deprecated.
- During "kubeadm init/join" apply the label
"node-role.kubernetes.io/control-plane" to new control-plane nodes,
next to the existing "node-role.kubernetes.io/master" label.
- During "kubeadm upgrade apply", find all Nodes with the "master"
label and also apply the "control-plane" label to them
(if they don't have it).
- During upgrade health-checks collect Nodes labeled both "master"
and "control-plane".
- Rename the constants.ControlPlane{Taint|Toleraton} to
constants.OldControlPlane{Taint|Toleraton} to manage the transition.
- Mark constants.OldControlPlane{{Taint|Toleraton} as deprecated.
- Use constants.OldControlPlane{{Taint|Toleraton} instead of
constants.ControlPlane{Taint|Toleraton} everywhere.
- Introduce constants.ControlPlane{Taint|Toleraton}.
- Add constants.ControlPlaneToleraton to the kube-dns / CoreDNS
Deployments to make them anticipate the introduction
of the "node-role.kubernetes.io/control-plane:NoSchedule"
taint (constants.ControlPlaneTaint) on kubeadm control-plane Nodes.
2020-11-10 22:10:13 +02:00
Lubomir I. Ivanov
4bb75a462f kubeadm: remove the CoreDNS check for supported image digests
The isCoreDNSVersionSupported() check assumes that
there is a running kubelet, that manages the CoreDNS containers.

If the containers are being created it is not possible to fetch
their image digest. To workaround that, a poll can be used in
isCoreDNSVersionSupported() and wait for the CoreDNS Pods
are expected to be running. Depending on timing and CNI
yet to be installed this can cause problems related to
addon idempotency of "kubeadm init", because if the CoreDNS
Pods are waiting for another step they will never get running.

Remove the function isCoreDNSVersionSupported() and assume that
the version is always supported. Rely on the Corefile migration
library to error out if it must.
2020-09-04 05:27:04 +03:00
zounengren
fc0bda5a3c fix kubeadm update coredns with skip pending pod 2020-09-03 10:42:59 +08:00
Sandeep Rajan
4dc635d542 remove kube-dns translation for federation 2020-07-01 14:34:23 -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
Rostislav M. Georgiev
fbfd44f337 kubeadm: Fix panic in isCoreDNSVersionSupported
A narrow assumption of what is contained in the `imageID` fields for the
CoreDNS pods causes a panic upon upgrade.
Fix this by using a proper regex to match a trailing SHA256 image digest
in `imageID` or return an error if it cannot find it.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2020-03-26 20:26:32 +02:00
Sandeep Rajan
fcd229e4bd ensure coredns running when migration fails
add an additional check for coredns image sha

add a check to see if migration is required
2020-03-11 11:32:32 -04:00
Sandeep Rajan
ca5d394f6a fix the coredns preflight check for unsupported plugins 2020-02-26 15:08:05 -05:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
SataQiu
803161d621 kubeadm: kube-dns is deprecated and will not be supported in a future version 2019-12-24 10:11:24 +08:00
Peter Grant
0e4469cddd persist deployed DNS configuration during kubeadm upgrade
Signed-off-by: Peter Grant <9246508+pickledrick@users.noreply.github.com>
2019-12-12 08:55:15 +11:00
Sandeep Rajan
16191db353 skip deployment update if migration fails 2019-11-06 10:55:54 -05:00
Sandeep Rajan
7074f28dd2 retain corefile when migration fails 2019-10-29 12:11:59 -04:00
Arvinderpal Wander
bacc06d8fc kubeadm --service-cluster-ip-range supports a comma seperated list
of service subnets.

Update DNS, Cert, dry-run logic to support list of Service CIDRs.
Added unit tests for GetKubernetesServiceCIDR and updated
GetDNSIP() unit test to inclue dual-sack cases.
2019-09-16 09:33:43 -07:00
Sandeep Rajan
6bb9eeeb1c move the corefile backup into a single configmap with a corefile-backup data key 2019-08-20 13:20:18 -04:00
Sandeep Rajan
6821d21260 add the ability to migrate coredns configmap 2019-08-15 10:09:32 -04:00
SataQiu
9657240197 update caddy vendor dependency to v1.0.1 2019-07-09 12:03:25 +08:00
Benjamin Elder
13813bc560 cleanup bespoke ipv6 checking in kubeadm 2019-07-03 16:26:08 -07:00
Manjunath A Kumatagi
23153e3f04 loop through next entry in stubDomainData if proxyIP == 0 2019-04-14 20:14:01 -05:00
Kubernetes Prow Robot
c3cc31797a
Merge pull request #75969 from rajansandeep/translationcheck
Fix translation from kube-dns to CoreDNS Config to skip invalid values
2019-04-01 22:44:35 -07:00
Sandeep Rajan
deadefd385 Fix translation to skip invalid values 2019-04-01 15:15:39 -04:00
aaa
112da093ed Define common sentences as constants
update pull request

update pull request

update pull request

update pull request

update pull request

update pull request
2019-03-21 18:56:42 -04:00
ducnv
e11916da8e kubeadm cleanup: master -> control-plane (cont.4) 2019-02-25 08:29:19 +07:00
Kubernetes Prow Robot
b8b689aae0
Merge pull request #72111 from rosti/reduce-initcfg
kubeadm: Reduce the usage of InitConfiguration
2019-01-29 14:01:07 -08: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
Sandeep Rajan
c346ae1e49 Use forward plugin instead of proxy in the default configuration 2019-01-24 17:28:55 +05:30
fabriziopandini
c9302caf6c error-imports-cleanups 2019-01-03 13:25:18 +01:00
fabriziopandini
6759334f6e add DNS struct to kubeadm config 2018-11-10 17:27:39 +01: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
Rostislav M. Georgiev
68ed2bdd35 kubeadm: Use GetGenericImage for kube-dns
As kube-dns transitioned to fat manifests, it's no longer required to use arch
suffixed images. This change makes use of fat manifests for kube-dns and
removes the last few calls to the GetGenericArchImage function, thus removing
GetGenericArchImage too.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-09-19 17:23:15 +03:00
Sandeep Rajan
989f6667d2 prep for 1.12 2018-08-30 11:43:36 -04:00
Lucas Käldström
52f0591ad9
Automated rename from MasterConfiguration to InitConfiguration 2018-07-09 04:55:02 +03:00
Lucas Käldström
f2dec305ad
Fix kubeadm init/upgrade --dry-run mode 2018-06-15 23:03:24 +03:00
Rostislav M. Georgiev
19d2bbbc98 kubeadm: Don't match DNS versions to K8s versions
Some code in kubeadm was designed with the intent, that in the future CoreDNS
and kube-dns versions will match to specific K8s versions. This code is not
functional, since it does not perform any version matching. As of this moment,
no version matching is planned and a lot of boilerplate code is left useless.
The solution is simple - remove the unneeded parts to simplify the flow.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-06-06 12:12:50 +03:00
Sandeep Rajan
fce42e0bf6 coredns to use gcr.io repo 2018-06-05 11:08:11 -04:00