Commit Graph

207 Commits

Author SHA1 Message Date
Dave Chen
8c7609fbe2 kubeadm: bump to use golang generic
Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-12-14 10:31:18 +08:00
Paco Xu
241445759e add go:build no windows for some control-plane related UT for kubeadm 2022-09-26 17:17:41 +08:00
Kubernetes Prow Robot
297a986738
Merge pull request #110941 from runzhliu/patch-1
improve the comments
2022-09-19 14:21:34 -07:00
Claudiu Belu
d192029e6a unittests: Fixes cmd unit tests for Windows
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- filepath.IsAbs does not consider "/" or "\" as absolute paths, even
  though files can be addressed as such.
- paths not properly joined (filepath.Join should be used).
- files not closed, which means that they cannot be removed / renamed.
- some assertions fail due to slashes / backslashes not matching.
- backslashes need to be escaped in yaml files, or put between ''
instead of "".
2022-08-26 16:03:13 +03:00
runzhliu
37f66cb9d8 improve the comments 2022-07-05 01:59:11 +00:00
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
SataQiu
aed6f56257 kubeadm: make the phase prefix and capitalization consistent 2022-01-16 00:01:35 +08:00
Kubernetes Prow Robot
bf000e8770
Merge pull request #104770 from pacoxu/dual-stack-ga-kubeadm
cleanup: DualStack GA for kubeadm
2021-09-28 03:42:42 -07:00
Paco Xu
751ad37a05 kubeadm: cleanup remove some empty feature gate for dual-stack 2021-09-28 15:34:26 +08:00
Paco Xu
0b8433a3f5 kubeadm: remove --port from kube-scheduler manifest 2021-09-15 12:58:35 +08:00
Paco Xu
1385bd3a06 kubeadm: fix ut failures of dualstack GA 2021-09-14 13:16:40 +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
Jian Zeng
c486b229d2 refactor(kubeadm): remove the flag --port from KCM manifest
Signed-off-by: Jian Zeng <zengjian.zj@bytedance.com>
2021-08-05 19:51:02 +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
Vinayak Goyal
59b4b124df Update kubeadm control-plane to run as non-root. 2021-06-14 12:04:50 -07:00
Vinayak Goyal
e6bf19bcf6 Update CreateInitStaticPodManifestFiles, CreateStaticPodFiles and CreateLocalEtcdStaticPodManifestFile to take into account if the command was run as dry-run. 2021-06-09 15:01:42 -07:00
pacoxu
a074ccfe36 remove --insecure-port in kubeadm 2021-05-19 11:48:07 +08:00
Kubernetes Prow Robot
15213128e1
Merge pull request #99687 from pacoxu/dual-stack/follow-up-1
cleanup: disable dual stack for some manifest UT
2021-03-04 00:29:23 -08:00
Kubernetes Prow Robot
b0ba6c0b76
Merge pull request #98984 from SataQiu/fix-kubeadm-20210211
kubeadm: skip validating pod subnet against node-cidr-mask when allocate-node-cidrs is set to be false
2021-03-03 01:53:20 -08:00
pacoxu
496deb6df9 cleanup: disable dual stack for some manifest UT 2021-03-03 16:00:20 +08:00
SataQiu
2ba178c92c kubeadm: skip validating pod subnet against node-cidr-mask when allocate-node-cidrs is set to be false 2021-03-01 11:19:47 +08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Jordan Liggitt
8761972f68 Use private key fixtures for kubeadm unit tests 2021-02-01 10:06:10 -05:00
Shihang Zhang
ff641f6eb2 mv TokenRequest and TokenRequestProjection to GA 2020-10-29 20:47:01 -07:00
Antonio Ojea
8b52995d32 kubeadm: validate podSubnet against node-cidr-mask
the controller manager should validate the podSubnet against the node-mask
because if they are incorrect can cause the controller-manager to fail.

We don't need to calculate the node-cidr-masks, because those should
be provided by the user, if they are wrong we fail in validation.
2020-10-22 16:24:13 +02:00
Lubomir I. Ivanov
8ece27bf4b kubeadm: remove the --experimental-kustomize feature
The feature was replaced by --experimental-patches and deprecated in
1.19.
2020-09-18 03:49:53 +03:00
Kubernetes Prow Robot
046ac5100e
Merge pull request #92720 from neolit123/1.19-add-kcm-port
kubeadm: add --port=0 for kube-controller-manager and kube-scheduler
2020-07-03 05:03:25 -07:00
Lubomir I. Ivanov
f66513d98a kubeadm: add --port=0 for kube-controller-manager and kube-scheduler
Kubeadm setup of kube-controller-manager and kube-scheduler is
lacking the --port=0 option which caused the component to enable
the insecure port by default and serve insecurely on the default
node interface.

Add --port=0 by default to both components. Users are still allowed
the explicitly set the flag (via extraArgs), which allows them
to override this default kubeadm behavior and enable the insecure port.

NOTE: the flag is deprecated and should be removed from kubeadm manifests
once it's removed from core.
2020-07-01 22:23:21 +03: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
144778db83 kubeadm: plumb the patches option trough init/join/upgrade
This changes adds the "patches" option in all places where
the "kustomize" option is already present.
2020-06-26 02:14:47 +03: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
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
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
Johannes M. Scheuermann
9a1cbc2711 Use livez and readyz endpoint for API server probes 2020-05-14 17:41:05 +02:00
Kubernetes Prow Robot
613cd04d8c
Merge pull request #90064 from neolit123/1.19-fix-authz-warning
kubeadm: fix misleading warning for authz modes
2020-04-23 12:32:06 -07:00
SataQiu
35f3f82029 kubeadm: remove the dependence on /pkg/features
Signed-off-by: SataQiu <1527062125@qq.com>
2020-04-12 15:05:44 +08:00
Lubomir I. Ivanov
6cfd772401 kubeadm: fix misleading warning for authz modes
kubeadm init prints:
  W0410 23:02:10.119723   13040 manifests.go:225] the default kube-apiserver
  authorization-mode is "Node,RBAC"; using "Node,RBAC"

Add a new function compareAuthzModes() and a unit test for it.
Make sure the warning is printed only if the user modes don't match
the defaults.
2020-04-10 23:45:40 +03:00
Lubomir I. Ivanov
1b710a4c56 kubeadm: modify how component volumes are printed
After the shift for init phases, GetStaticPodSpecs() from
app/phases/controlplane/manifests.go gets called on each control-plane
component sub-phase. This ends up calling the Printf from
AddExtraHostPathMounts() in app/phases/controlplane/volumes.go
multiple times printing the same volumes for different components.

- Remove the Printf call from AddExtraHostPathMounts().
- Print all volumes for a component in CreateStaticPodFiles() using klog
V(2).

Perhaps in the future a bigger refactor is needed here were a
single control-plane component spec can be requested instead of a
map[string]v1.Pod.
2020-02-24 16:41:03 +02: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
kangsub song
237da6250b
change print log for unity when during kubeadm init
change print log for unity when during kubeadm init
2019-12-24 10:13:48 +09: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
f0ea7bcf9e
kubeadm: set cluster name on the controller manager
On kubeadm's configuration it's possible to set up the cluster
name. Forward this information to the controller manager's
`--cluster-name` argument.
2019-12-02 18:32:50 +01:00
Antonio Ojea
335a3e9efb kubeadm: use correct IP family for etcd localhost
kubeadm always use the IPv4 localhost address by defaultA for etcd

The probe hostname is obtained before the generation of the etcd
parameters, so it can't detect the right IP familiy for the
host of the probe.
This causes that with IPv6 clusters doesn't work because the probe
uses the IPv4 localhost address.

This patchs configures the right localhost address based on the used
AdvertiseAddress IP family.
2019-11-30 17:25:30 +01:00
Antonio Ojea
798d2fb75a
Fix comment typo 2019-11-29 13:38:47 +01:00
Arvinderpal Wander
e8ee8622b8 Add support for new dual-stack flags for kubernetes-controller-
manager in kubeadm:
 - node-cidr-mask-size-ipv4
 - node-cidr-mask-size-ipv6
2019-11-25 09:11:16 -08:00
Ted Yu
5be960c34d Fill in default node cidr mask size when dual stack is not enabled 2019-11-20 19:50:33 -08:00
Lubomir I. Ivanov
23ba857b50 kubeadm: use the secure ports for kube-scheduler and kcm health checks
The insecure ports were deprecated in 1.12 and 1.13.
2019-11-09 23:21:39 +02:00
Yassine TIJANI
3993c42431 propagate proxy env var to kube-proxy
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-10-30 16:18:43 +01:00