Commit Graph

503 Commits (750881c0ab62a9f59d53582bc33826caa167aa83)

Author SHA1 Message Date
Erik Wilson 765fd253f6 Update vendor 2019-08-19 09:17:28 -07:00
Darren Shepherd a3bf0b9338 Delete additional commands 2019-08-19 08:33:25 -07:00
fabriziopandini 3b26c28dc0 feedback 1 2019-07-30 02:00:15 +03:00
fabriziopandini 911f6ea43e fix-file-discovery 2019-07-30 01:52:11 +03:00
fabriziopandini 56e0f22f1a autogenerated 2019-07-30 01:49:50 +03:00
Rostislav M. Georgiev 8921f03347 kubeadm: Don't error out on join with --cri-socket override
In the case where newControlPlane is true we don't go through
getNodeRegistration() and initcfg.NodeRegistration.CRISocket is empty.
This forces DetectCRISocket() to be called later on, and if there is more than
one CRI installed on the system, it will error out, while asking for the user
to provide an override for the CRI socket. Even if the user provides an
override, the call to DetectCRISocket() can happen too early and thus ignore it
(while still erroring out).
However, if newControlPlane == true, initcfg.NodeRegistration is not used at
all and it's overwritten later on.
Thus it's necessary to supply some default value, that will avoid the call to
DetectCRISocket() and as initcfg.NodeRegistration is discarded, setting
whatever value here is harmless.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-04-12 19:46:19 +03:00
fabriziopandini 211bc613a0 fix-kubeadm-upgrade-12-13-14 2019-04-02 21:27:21 +02:00
Jordan Liggitt f2a0c0342c Revert "Revert kubelet to default to ttl cache secret/configmap behavior"
This reverts commit cd1c9f9018.
2019-03-13 15:12:26 -07:00
Marek Counts a9eea0a353 kubeadm-reset: add means to clear the ClusterStatus
Add ResetClusterStatusForNode() that clears a certain
control-plane node's APIEndpoint from the ClusterStatus
key in the kubeadm ConfigMap on "kubeadm reset".
2019-03-07 04:03:19 +02:00
Lubomir I. Ivanov 6f6b364b9c kubeadm: update output of init, join reset commands
- move most unrelated to phases output to klog.V(1)
- rename some prefixes for consistency - e.g.
[kubelet] -> [kubelet-start]
- control-plane-prepare: print details for each generated CP
component manifest.
- uppercase the info text for all "[reset].." lines
- modify the text for one line in reset
2019-03-06 03:17:35 +02:00
Kubernetes Prow Robot d8d260a09d
Merge pull request #74755 from liggitt/kubelet-watch
Revert kubelet to default to ttl cache secret/configmap behavior
2019-03-01 19:14:14 -08:00
fabriziopandini d0d843c588 fix-go-vet-1.12 2019-03-01 15:13:17 +01:00
Jordan Liggitt cd1c9f9018 Revert kubelet to default to ttl cache secret/configmap behavior 2019-02-28 17:54:22 -05:00
Kubernetes Prow Robot e64336e94b
Merge pull request #74590 from vanduc95/cleanup-kubeadm-cont.6-20190226
kubeadm cleanup: master -> control-plane (cont.6)
2019-02-26 15:30:03 -08:00
Jordan Liggitt d1e865ee34 Update client callers to use explicit versions 2019-02-26 08:36:30 -05:00
vanduc95 3759fcd4c8 kubeadm cleanup: master -> control-plane (cont.6) 2019-02-26 18:42:27 +07:00
vanduc95 0296cfb2b8 kubeadm cleanup: master -> control-plane (cont.5) 2019-02-26 09:04:54 +07:00
RA489 a0ee4b471d Refactor etcd client function have same signatures in etcd.go 2019-02-25 12:54:12 +05:30
Lubomir I. Ivanov b2cc473388 kubeadm: fix issue with missing kubeproxy fields in test data 2019-02-23 19:13:16 +02:00
Kubernetes Prow Robot 8993fbc543
Merge pull request #74328 from daixiang0/delete-blank
delete all duplicate empty blanks
2019-02-23 01:43:58 -08:00
Kubernetes Prow Robot b5566c7818
Merge pull request #71896 from awly/client-go-keyutil
client-go: extract new keyutil package from util/cert
2019-02-23 01:43:16 -08:00
Kubernetes Prow Robot 1d2d2d0ab2
Merge pull request #74390 from vanduc95/cleanup-kubeadm-cont.3-20190222
kubeadm cleanup: master -> control-plane (cont.3)
2019-02-22 23:27:40 -08:00
vanduc95 57d04cafee kubeadm cleanup: master -> control-plane (cont.3) 2019-02-23 10:19:26 +07:00
Xiang Dai 36065c6dd7 delete all duplicate empty blanks
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-23 10:28:04 +08:00
Ed Bartosh 39871f565d kubeadm: remove dead code
Removed unused functions and variables from
the kubeadm codebase.
2019-02-22 23:01:14 +01:00
Kubernetes Prow Robot 9e53b85d28
Merge pull request #74112 from pytimer/kubeadm-reset
kubeadm: Remove etcd members from the etcd cluster when reset the nodes
2019-02-22 00:19:40 -08:00
Kubernetes Prow Robot 9dbc8912d9
Merge pull request #74355 from brb/kubeadm-support-kernel-5
kubeadm: Support >= 5.0 Linux kernel
2019-02-21 17:47:40 -08:00
pytimer 83f5296a14 kubeadm: Remove etcd member from the etcd cluster when reset the control plane node 2019-02-22 09:13:01 +08:00
Martynas Pumputis 148b222d97 kubeadm: Support >= 5.0 Linux Kernel
Signed-off-by: Martynas Pumputis <m@lambda.lt>
2019-02-21 17:31:15 +01:00
vanduc95 ae1ec8826a kubeadm cleanup: master -> control-plane (cont.2) 2019-02-21 10:02:24 +07:00
Kubernetes Prow Robot c06ca11b5d
Merge pull request #70896 from ksubrmnn/overlay_dsr
Adding Windows Overlay support to Kube Proxy
2019-02-20 12:53:13 -08:00
Kubernetes Prow Robot b4a2b63561
Merge pull request #73907 from yagonobre/init-upload-certs
Add kubeadm init upload encrypted certs phase
2019-02-20 11:33:44 -08:00
Andrew Lytvynov 18458392ca Extract new keyutil package from client-go/util/cert
This package contains public/private key utilities copied directly from
client-go/util/cert. All imports were updated.

Future PRs will actually refactor the libraries.

Updates #71004
2019-02-19 09:48:59 -08:00
Rostislav M. Georgiev f64baf755e kubeadm: Don't load deprecated configs
Currently kubeadm supports a couple of configuration versions - v1alpha3 and
v1beta1. The former is deprecated, but still supported.

To discourage users from using it and to speedup conversion to newer versions,
we disable the loading of deprecated configurations by all kubeadm
sub-commands, but "kubeadm config migrate".

v1alpha3 is still present and supported at source level, but cannot be used
directly with kubeadm and some of its internal APIs.

The added benefit to this is, that users won't need to lookup for an old
kubeadm binary after upgrade, just because they were stuck with a deprecated
config version for too long.

To achieve this, the following was done:

- ValidateSupportedVersion now has an allowDeprecated boolean parameter, that
  controls if the function should return an error upon detecting deprecated
  config version. Currently the only deprecated version is v1alpha3.

- ValidateSupportedVersion is made package private, because it's not used
  outside of the package anyway.

- BytesToInitConfiguration and LoadJoinConfigurationFromFile are modified to
  disallow loading of deprecated kubeadm config versions. An error message,
  that points users to kubeadm config migrate is returned.

- MigrateOldConfig is still allowed to load deprecated kubeadm config versions.

- A bunch of tests were fixed to not expect success if v1alpha3 config is
  supplied.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-02-19 12:27:39 +02:00
Yago Nobre 79fd5f25a7 Add kubeadm init upload encrypted certs phase 2019-02-19 02:52:21 -03:00
Kubernetes Prow Robot c923a68470
Merge pull request #74024 from rosti/optimize-config-migrate
kubeadm: Replace MigrateOldConfigFromFile
2019-02-18 10:37:32 -08:00
Rostislav M. Georgiev f73ac0da3e kubeadm: Replace MigrateOldConfigFromFile
MigrateOldConfigFromFile is a function, whose purpose is to migrate one config
into another. It is working OK for now, but it has some issues:

- It is incredibly inefficient. It can reload and re-parse a single config file
  for up to 3 times.

- Because of the reloads, it has to take a file containing the configuration
  (not a byte slice as most of the rest config functions). However, it returns
  the migrated config in a byte slice (rather asymmetric from the input
  method).

- Due to the above points it's difficult to implement a proper interface for
  deprecated kubeadm config versions.

To fix the issues of MigrateOldConfigFromFile, the following is done:

- Re-implement the function by removing the calls to file loading package
  public APIs and replacing them with newly extracted package private APIs that
  do the job with pre-provided input data in the form of
  map[GroupVersionKind][]byte.

- Take a byte slice of the input configuration as an argument. This makes the
  function input symmetric to its output. Also, it's now renamed to
  MigrateOldConfig to represent the change from config file path as an input
  to byte slice.

- As a bonus (actually forgotten from a previous change) BytesToInternalConfig
  is renamed to the more descriptive BytesToInitConfiguration.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-02-14 11:52:33 +02:00
SataQiu 19c7f4cb0b fix golint failures on cmd/kubeadm/app/util/config 2019-02-14 12:11:24 +08:00
Kubernetes Prow Robot 51f5164f89
Merge pull request #73945 from neolit123/kubeadm-tests-non-linux
kubeadm: remove nodefs.inodesFree test defaulting on non-Linux
2019-02-12 12:40:01 -08:00
Rafael Fernández López 30dc43ff86
kubeadm: set priority class name to `system-cluster-critical` for all master components
Remove the deprecated `scheduler.alpha.kubernetes.io/critical-pod` pod annotation and use
the `priorityClassName` first class attribute instead, setting all master components to
`system-cluster-critical`.
2019-02-12 17:50:36 +01:00
Lubomir I. Ivanov 19e89c32f5 kubeadm: remove nodefs.inodesFree test defaulting on non-Linux
Add test files that exclude the field in question
under KubeletConfiguration -> evictionHard for non-Linux.

Add runtime abstraction for the test files in initconfiguration_tests.go
2019-02-12 14:19:47 +02:00
Rostislav M. Georgiev 51197e4393 kubeadm: Refactor InitConfiguration init APIs
Currently ConfigFileAndDefaultsToInternalConfig and
FetchConfigFromFileOrCluster are used to default and load InitConfiguration
from file or cluster. These two APIs do a couple of completely separate things
depending on how they were invoked. In the case of

ConfigFileAndDefaultsToInternalConfig, an InitConfiguration could be either
defaulted with external override parameters, or loaded from file.
With FetchConfigFromFileOrCluster an InitConfiguration is either loaded from
file or from the config map in the cluster.

The two share both some functionality, but not enough code. They are also quite
difficult to use and sometimes even error prone.

To solve the issues, the following steps were taken:

- Introduce DefaultedInitConfiguration which returns defaulted version agnostic
  InitConfiguration. The function takes InitConfiguration for overriding the
  defaults.

- Introduce LoadInitConfigurationFromFile, which loads, converts, validates and
  defaults an InitConfiguration from file.

- Introduce FetchInitConfigurationFromCluster that fetches InitConfiguration
  from the config map.

- Reduce, when possible, the usage of ConfigFileAndDefaultsToInternalConfig by
  replacing it with DefaultedInitConfiguration or LoadInitConfigurationFromFile
  invocations.

- Replace all usages of FetchConfigFromFileOrCluster with calls to
  LoadInitConfigurationFromFile or FetchInitConfigurationFromCluster.

- Delete FetchConfigFromFileOrCluster as it's no longer used.

- Rename ConfigFileAndDefaultsToInternalConfig to
  LoadOrDefaultInitConfiguration in order to better describe what the function
  is actually doing.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-02-11 14:45:34 +02:00
Lubomir I. Ivanov 1d032c40d3 kubeadm: add a preflight check for Docker and cgroup driver
systemd is the recommended driver as per the setup of running
the kubelet using systemd as the init system. Add a preflight
check that throws a warning if this isn't the case.
2019-02-08 19:31:22 +02:00
Kubernetes Prow Robot 395e4c05ba
Merge pull request #73745 from rosti/refactor-JoinConfigFileAndDefaultsToInternalConfig
kubeadm: refactor JoinConfigFileAndDefaultsToInternalConfig
2019-02-08 06:54:16 -08:00
Rostislav M. Georgiev 09f753a94c kubeadm: refactor JoinConfigFileAndDefaultsToInternalConfig
Currently JoinConfigFileAndDefaultsToInternalConfig is doing a couple of
different things depending on its parameters. It:

- loads a versioned JoinConfiguration from an YAML file.
- returns defaulted JoinConfiguration allowing for some overrides.

In order to make code more manageable, the following steps are taken:

- Introduce LoadJoinConfigurationFromFile, which loads a versioned
  JoinConfiguration from an YAML file, defaults it (both dynamically and
  statically), converts it to internal JoinConfiguration and validates it.

- Introduce DefaultedJoinConfiguration, which returns defaulted (both
  dynamically and statically) and verified internal JoinConfiguration.
  The possibility of overwriting defaults via versioned JoinConfiguration is
  retained.

- Re-implement JoinConfigFileAndDefaultsToInternalConfig to use
  LoadJoinConfigurationFromFile and DefaultedJoinConfiguration.

- Replace some calls to JoinConfigFileAndDefaultsToInternalConfig with calls to
  either LoadJoinConfigurationFromFile or DefaultedJoinConfiguration where
  appropriate.

- Rename JoinConfigFileAndDefaultsToInternalConfig to the more appropriate name
  LoadOrDefaultJoinConfiguration.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-02-08 14:00:02 +02:00
ksubrmnn 164f79e2d4 Update config tests 2019-02-05 10:39:23 -08:00
Davanum Srinivas b975573385
move pkg/kubelet/apis/well_known_labels.go to staging/src/k8s.io/api/core/v1/
Co-Authored-By: Weibin Lin <linweibin1@huawei.com>

Change-Id: I163b2f2833e6b8767f72e2c815dcacd0f4e504ea
2019-02-05 13:39:07 -05:00
Kubernetes Prow Robot 0c2613c71a
Merge pull request #73474 from rosti/IsSupportedVersion
kubeadm: Introduce ValidateSupportedVersion
2019-02-02 01:59:37 -08:00
Rostislav M. Georgiev e10dcf07d7 kubeadm: Introduce ValidateSupportedVersion in place of DetectUnsupportedVersion
DetectUnsupportedVersion is somewhat uncomfortable, complex and inefficient
function to use. It takes an entire YAML document as bytes, splits it up to
byte slices of the different YAML sub-documents and group-version-kinds and
searches through those to detect an unsupported kubeadm config. If such config
is detected, the function returns an error, if it is not (i.e. the normal
function operation) everything done so far is discarded.

This could have been acceptable, if not the fact, that in all cases that this
function is called, the YAML document bytes are split up and an iteration on
GVK map is performed yet again. Hence, we don't need DetectUnsupportedVersion
in its current form as it's inefficient, complex and takes only YAML document
bytes.

This change replaces DetectUnsupportedVersion with ValidateSupportedVersion,
which takes a GroupVersion argument and checks if it is on the list of
unsupported config versions. In that case an error is returned.
ValidateSupportedVersion relies on the caller to read and split the YAML
document and then iterate on its GVK map checking if the particular
GroupVersion is supported or not.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-02-01 19:35:39 +02:00
Kubernetes Prow Robot 0f93328c7a
Merge pull request #73457 from xichengliudui/updatedockerversion
Update docker support for k8s
2019-01-30 16:39:01 -08:00