Commit Graph

1074 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
30b1fbc809 Merge pull request #79021 from rosti/kubeadm-nuke-rbachelpers
kubeadm: Don't use RBAC helpers
2019-06-15 12:56:08 -07:00
Kubernetes Prow Robot
54f7e5269c Merge pull request #78625 from Nordix/issue-1591-kubeadm-service-cidr
Fix kubeadm service-cidr mapping to service-cluster-ip-rage for kube-controller-manager.
2019-06-14 11:52:35 -07:00
Rostislav M. Georgiev
7ba7bdaa22 kubeadm: Don't use "//pkg/apis/core".Resource helper
This helper is used in tests and pulls in unnecessary dependency, which should
not be used if kubeadm is to move to staging.
Replace with direct use of the GroupResource type.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-06-14 16:14:43 +03:00
Kubernetes Prow Robot
fadb63c7eb Merge pull request #78556 from neolit123/kubeadm-certs-order
kubeadm: apply deterministic order to certificate phases
2019-06-14 05:32:24 -07:00
Rostislav M. Georgiev
c394d0fd80 kubeadm: Don't use RBAC helpers
RBAC construction helpers are part of the Kubernetes internal APIs. As such,
we cannot use them once we move to staging.
Hence, replace their use with manual RBAC rule construction.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-06-14 14:08:31 +03:00
Kubernetes Prow Robot
4f29960cb2 Merge pull request #78915 from ereslibre/retry-configmap-get-on-unauthorized
kubeadm: Add ability to retry ConfigMap get if certain errors happen
2019-06-12 13:00:19 -07:00
Rafael Fernández López
26c9965a97 kubeadm: Add ability to retry ConfigMap get if certain errors happen
During the control plane joins, sometimes the control plane returns an
expected error when trying to download the `kubeadm-config` ConfigMap.
This is a workaround for this issue until the root cause is completely
identified and fixed.

Ideally, this commit should be reverted in the near future.
2019-06-12 17:49:27 +02:00
Sandeep Rajan
77466d4a65 [kubeadm] Add the upstream option in CoreDNS configmap 2019-06-11 21:19:43 -04:00
Haosdent Huang
7ce6e71891 Fix typos. 2019-06-11 01:52:14 +08:00
Arvinderpal Wander
7634cc01c5 Fix kubeadm service-cidr mapping to service-cluster-ip-rage for
kube-controller-manager.

If a service CIDR that overlaps with the cluster CIDR is
specified to kube-controller-manager then kube-controller-
manager will incorrectly allocate node CIDRs that overlap
with the service CIDR. The fix ensure that kubeadm
maps the --service-cidr to --service-cluster-ip-range for use
by kube-controller-manager.

As per docs, --allocate-node-cidrs must be true for
--service-cluster-ip-range to be considered. It does not make
sense for --cluster-cidr to be unspecified but for
--service-cluster-ip-range and --allocate-node-cidrs to be
set, since the purpose of these options is to have the
controller-manager do the per node CIDR allocation. Also
note that --service-cluster-ip-range is passed to the
api-server, so the presence of *just*
--service-cluster-ip-range should not imply that
--allocate-node-cidrs should be true.

Resolves: kubernetes/kubeadm/issues/1591
2019-06-05 06:53:32 -07:00
Kubernetes Prow Robot
16aeec2485 Merge pull request #78545 from neolit123/kubeadm-revert-coredns-1.3.1
kubeadm: revert CoreDNS to 1.3.1
2019-06-03 14:51:29 -07:00
Ricardo Pchevuzinske Katz
82c42bb6ee Remove deprecated flag --conntrack-max from kube-proxy 2019-06-01 18:10:28 -03:00
Lubomir I. Ivanov
2413713c4e kubeadm: apply deterministic order on certificate phases
The existing logic already creates a proper "tree"
where a CA is always generated before the certs that are signed
by this CA, however the tree is not deterministic.

Always use the default list of certs when generating the
"kubeadm init phase certs" phases. Add a unit test that
makes sure that CA always precede signed certs in the default
lists.

This solves the problem where the help screen for "kubeadm
init" cert sub-phases can have a random order.
2019-05-31 04:04:13 +03:00
Lubomir I. Ivanov
a49bc480b9 kubeadm: revert CoreDNS to 1.3.1 2019-05-30 23:31:54 +03:00
fabriziopandini
c2faa3bfd1 kubeadm upgrade node 2019-05-29 22:06:42 +02:00
Rostislav M. Georgiev
5671ea9cf1 kubeadm: Remove ClusterConfiguration from InitConfiguration in v1beta2
Ever since v1alpha3, InitConfiguration is containing ClusterConfiguration
embedded in it. This was done to mimic the internal InitConfiguration, which in
turn is used throughout the kubeadm code base as if it is the old
MasterConfiguration of v1alpha2.

This, however, is confusing to users who vendor in kubeadm as the embedded
ClusterConfiguration inside InitConfiguration is not marshalled to YAML.
For this to happen, special care must be taken for the ClusterConfiguration
field to marshalled separately.

Thus, to make things smooth for users and to reduce third party exposure to
technical debt, this change removes ClusterConfiguration embedding from
InitConfiguration.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-05-29 12:13:37 +03:00
Kubernetes Prow Robot
81a61ae0e3 Merge pull request #77863 from fabriziopandini/certs-expiration
Kubeadm: Add check certificate expiration command
2019-05-19 12:47:10 -07:00
fabriziopandini
e4d87b0804 autogenerated 2019-05-18 16:28:44 +02:00
fabriziopandini
919826531c certs-expiration 2019-05-18 16:28:33 +02:00
Sandeep Rajan
0b28419412 bump coredns version to 1.5.0 and update manifest 2019-05-17 10:03:02 -04:00
Jordan Liggitt
739a75fc32 Interrupt WaitForCertificate if desired kubelet serving cert changes 2019-05-16 15:14:47 -04:00
Kubernetes Prow Robot
e1770e698e Merge pull request #77780 from fabriziopandini/refactor-renewal-package
Kubeadm: Refactor renewal package
2019-05-16 02:55:46 -07:00
fabriziopandini
1c897874bf autogenerated 2019-05-15 10:26:00 +02:00
fabriziopandini
6db533dd5b refactor certs renewal 2019-05-15 10:25:50 +02:00
Kubernetes Prow Robot
f5a1ceb1fc Merge pull request #77768 from yagonobre/upload-certs
Improve error message when user provide invalid certificate key
2019-05-12 19:24:08 -07:00
Yago Nobre
54a308bdd7 Improve error message when user provide invalid certificate key 2019-05-12 18:26:11 -03:00
SataQiu
d46bd0dc7a make KubernetesDir a true constant 2019-05-09 17:16:59 +08:00
Kubernetes Prow Robot
eda5a296a8 Merge pull request #77513 from ereslibre/upload-cluster-configuration-after-upgrade
kubeadm: upload the `ClusterConfiguration` during the upgrade
2019-05-08 17:15:13 -07:00
Daniel (Shijun) Qian
5268f69405 fix duplicated imports of k8s code (#77484)
* fix duplicated imports of api/core/v1

* fix duplicated imports of client-go/kubernetes

* fix duplicated imports of rest code

* change import name to more reasonable
2019-05-08 10:12:47 -07:00
Kubernetes Prow Robot
f9c9ecdbb6 Merge pull request #77180 from fabriziopandini/renew-embedded-certs
kubeadm: renew certificates embedded in kubeconfig files
2019-05-06 15:30:06 -07:00
Rafael Fernández López
b6f4bb349b kubeadm: upload the ClusterConfiguration during the upgrade
During the upgrade process, `kubeadm` will take the current
`ClusterConfiguration`, update the `KubernetesVersion` to the latest
version, and call to `UploadConfiguration`.

This change makes sure that when the mutation happens, not only the
`ClusterStatus` is mutated, but the `ClusterConfiguration` object
inside the `kubeadm-config` ConfigMap as well; it will contain the
new `KubernetesVersion`.
2019-05-06 18:21:55 +02:00
fabriziopandini
3076644f0b autogenerated 2019-05-06 16:48:35 +02:00
fabriziopandini
cf7f8acae2 renew-embedded-certs 2019-05-06 16:48:24 +02:00
Kubernetes Prow Robot
7defecbc2c Merge pull request #76327 from neolit123/kubeproxy-node-selector
kubeadm: disable the kube-proxy DaemonSet on non-Linux nodes
2019-05-03 04:08:18 -07:00
Dmitry Rozhkov
a6d7920f44 kubeadm: do unit testing of actual public function
Even though CreateServiceAccountKeyAndPublicKeyFiles() function is
an interface function it's not unittested. Instead it wraps a couple
of internal functions which are used only inside CreateServiceAccountKeyAndPublicKeyFiles()
and those internal functions are tested.

Rewrite the function to do only what it's intended to do and add unit
tests for it.
2019-05-02 10:23:51 +03:00
Àbéjídé Àyodélé
a2b0cb62a1 Clean up kubeadm.
These are based on recommendation from
[staticcheck](http://staticcheck.io/).

- Remove unused struct fields
- Remove unused function
- Remove unused variables
- Remove unused constants.
- Miscellaneous cleanups
2019-05-01 22:16:06 +00:00
stgleb
7bf9acd303 Change misleading log message
Secret instead of configmap for
upload certs phase
2019-04-29 03:06:11 +03:00
Kubernetes Prow Robot
c88b7cdd58 Merge pull request #76862 from fabriziopandini/fix-upgrade-certs-renew
kubeadm: fix certs renewal during upgrade
2019-04-27 12:30:20 -07:00
Chen Zhiwei
79c436f48f use new method to detect cgroup driver 2019-04-27 08:39:18 +00:00
fabriziopandini
137137cbaa fix-upgrade-certs-renew 2019-04-27 09:58:17 +02:00
Kubernetes Prow Robot
3148eb750d Merge pull request #76390 from rojkov/ecdsa-v2
kubeadm: add support for ECDSA keys
2019-04-26 19:56:23 -07:00
Rostislav M. Georgiev
9e1ac76c1a kubeadm: Introduce v1beta2 config
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-04-25 17:10:04 +03:00
Dmitry Rozhkov
d125f3bddc kubeadm: add support for ECDSA keys
kubeadm still generates RSA keys when deploying a node, but also
accepts ECDSA keys if they already exist pregenerated in the
directory specified in --cert-dir.
2019-04-25 12:52:42 +03:00
Rafael Fernández López
bc8bafd825 kubeadm: improve resiliency when conflicts arise when updating the kubeadm-config ConfigMap
Add the functionality to support `CreateOrMutateConfigMap` and `MutateConfigMap`.

* `CreateOrMutateConfigMap` will try to create a given ConfigMap object; if this ConfigMap
  already exists, a new version of the resource will be retrieved from the server and a
  mutator callback will be called on it. Then, an `Update` of the mutated object will be
  performed. If there's a conflict during this `Update` operation, retry until no conflict
  happens. On every retry the object is refreshed from the server to the latest version.

* `MutateConfigMap` will try to get the latest version of the ConfigMap from the server,
  call the mutator callback and then try to `Update` the mutated object. If there's a
  conflict during this `Update` operation, retry until no conflict happens. On every retry
  the object is refreshed from the server to the latest version.

Add unit tests for `MutateConfigMap`

* One test checks that in case of no conflicts, the update of the
  given ConfigMap happens without any issues.

* Another test mimics 5 consecutive CONFLICT responses when updating
  the given ConfigMap, whereas the sixth try it will work.
2019-04-23 15:40:37 +02:00
Kubernetes Prow Robot
888b81b638 Merge pull request #76238 from Dieken/30s-ttl-for-coredns
change default 5s ttl to 30s for coredns to be same with kube-dns/dnsmasq
2019-04-23 06:20:09 -07:00
Kubernetes Prow Robot
f9a3a22e35 Merge pull request #76769 from rojkov/kubeadm-drop-NewCACertAndKey
kubeadm: drop duplicate function NewCACertAndKey
2019-04-22 03:21:43 -07:00
fabriziopandini
d94c5bac47 kubeadm-cleanup-unused-func 2019-04-19 22:30:44 +02:00
Dmitry Rozhkov
580513ed66 kubeadm: drop duplicate function NewCACertAndKey
The function certs.NewCACertAndKey() is just a wrapper around
pkiutil.NewCertificateAuthority() which doesn't add any
additional functionality.

Instead use pkiutil.NewCertificateAuthority() directly.
2019-04-19 19:17:34 +03:00
Kubernetes Prow Robot
cee320a809 Merge pull request #76534 from ping035627/k8s-190413
Expect directory permissions to be 0700
2019-04-18 06:22:09 -07:00
PingWang
e3dcd3c0a9 Expect directory permissions to be 0700 or less
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update the permissions to 0660

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

revert to 0750

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update 0750 to 0700

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2019-04-18 17:31:31 +08:00