Commit Graph

6273 Commits (5f5e3a59c01258bb6fe7ef1deddbbe0643153bba)

Author SHA1 Message Date
lalyos 5308957dbc Sort arguments before joining them, for reproducible return string 2018-05-14 20:24:39 +02:00
Kubernetes Submit Queue f5a91f4173
Merge pull request #62807 from rpothier/kubeadm-cidr
Automatic merge from submit-queue (batch tested with PRs 63735, 62807). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubeadm: Update comments and UT to remove /66 restriction

**What this PR does / why we need it**:
The comments in cmd/kubeadm/app/phases/controlplane/manifests.go mention the
IPv6 /66 restriction, and the UT also refers to this.
This restriction was removed in PR#60089
This removes those comments and updates the UT

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62806 

**Special notes for your reviewer**:

**Release note**:

```release-note-none

```
2018-05-14 10:19:21 -07:00
Kubernetes Submit Queue f18e4d8b12
Merge pull request #63735 from neolit123/kubeadm-init-stdout-update
Automatic merge from submit-queue (batch tested with PRs 63735, 62807). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm-init: update note about failing containers

**What this PR does / why we need it**:

This PR was merged before all requested changes
were applied:
kubernetes/pull/59731

Update the note about failing containers as requested here:
https://github.com/kubernetes/kubernetes/pull/59731#pullrequestreview-119517427

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
NONE

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2018-05-14 10:19:18 -07:00
Lucas Käldström 8074a1987e
autogenerated bazel 2018-05-14 18:12:31 +01:00
Lucas Käldström 80a31d7a5a
Stop installing kubeadm types in the generic, legacy scheme 2018-05-14 18:11:30 +01:00
Lucas Käldström 04a7ca557c
kubeadm: Use the API machinery for marshalling 2018-05-14 17:56:22 +01:00
Kubernetes Submit Queue c9591ee6cb
Merge pull request #63734 from liztio/kubeadm-marshal-tests
Automatic merge from submit-queue (batch tested with PRs 63783, 63734). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubeadm marshal tests

**What this PR does / why we need it**:

Adds tests for the marshalling utilities in kubeadm.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes: kubernetes/kubeadm#802

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-14 09:12:12 -07:00
Kubernetes Submit Queue f3c84d71d8
Merge pull request #63783 from luxas/kubeadm_explicit_v1alpha1
Automatic merge from submit-queue (batch tested with PRs 63783, 63734). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Rename `kubeadmapiext` to the more explicit `kubeadmapiv1alpha1`

**What this PR does / why we need it**:

`kubeadmext` is somewhat confusing to those who read the code (although it means "the external API of kubeadm", which to some degree makes sense), so I'm swapping all references to it to the more explicit `kubeadmapiv1alpha1`. This change is needed given that we will support multiple external APIs.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Part of https://github.com/kubernetes/community/pull/2131

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-14 09:12:09 -07:00
Jason DeTiberus 187ef17ed8
kubeadm - do not generate etcd ca/certs for external etcd
Only generate the etcd CA and certificates if not configured for external
etcd.
2018-05-14 11:56:29 -04:00
Lucas Käldström 68c68dfadc
Rename kubeadmapiext to the more explicit kubeadmapiv1alpha1 2018-05-14 12:31:48 +03:00
Kubernetes Submit Queue 0989967374
Merge pull request #62833 from charrywanganthony/log_rotation
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add necessary explanation for container log rotation.

**What this PR does / why we need it**:
#59898
> Container log manager only starts when the container runtime is remote (not docker), because we can't implement ReopenContainerLog for docker.

**Release note**:
```release-note
NONE
```
2018-05-14 00:07:15 -07:00
Kubernetes Submit Queue 2fd9d8654e
Merge pull request #63740 from dims/control-exactly-what-we-use-in-kubeadm
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Control exactly what we use in kubeadm

**What this PR does / why we need it**:

we recently got rid of extra arg validation for preflight check:
9f21f5dd1e

the import-boss configuration will help us control exactly what
gets added/used in kubeadm. In this PR, we add a white-list of
the exact packages we use currently.

We will need to review these, make new PR(s) to  eliminate things
we don't want to be depending on (just like the cloud provider related code).

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-05-13 11:29:36 -07:00
Davanum Srinivas 00aeecd712 Control exactly what we use in kubeadm
we recently got rid of extra arg validation for preflight check:
9f21f5dd1e

the import-boss configuration will help us control exactly what
gets added/used in kubeadm. In this PR, we add a white-list of
the exact packages we use currently.

We will need to review these, make new PR(s) to  eliminate things
we don't want to be depending on (just like the cloud provider related code).
2018-05-12 21:55:56 -04:00
Kubernetes Submit Queue feeee50363
Merge pull request #63551 from luxas/revisit_kubeadm_owners
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Revisit the OWNERS file for kubeadm

**What this PR does / why we need it**:

The OWNERS file for kubeadm is getting a little bit stale. As discussed in today's SIG Cluster Lifecycle meeting, we're gonna update it with the currently active contributors.

**Special notes for your reviewer**:

Every person that is involved here, please ACK and LGTM the change.

@jbeda removed from approvers
@krousey removed from approvers/reviewers
@fabriziopandini graduated to an approver
@dmmcquay removed from reviewers
@jamiehannaford removed from reviewers
@kargakis removed from reviewers
@liztio added to reviewers
@chuckha added to reviewers
@detiber added to reviewers
@stealthybox added to reviewers
@dixudx added to reviewers

Thank you everyone for your contributions 👏 (no one can't maintain something forever), and congratulations and welcome everyone with a new role, happy to have you here 👍!

**Release note**:

```release-note
NONE
```
cc @kubernetes/sig-cluster-lifecycle-pr-reviews
2018-05-12 00:58:12 -07:00
ravisantoshgudimetla 1db5990013 Move scheduling api to beta 2018-05-12 02:01:04 -04:00
Kubernetes Submit Queue 4c09441a5d
Merge pull request #60931 from neolit123/test-completion
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 kubeadm: add test coverage to completion.go

**What this PR does / why we need it**:
Add `completion_test.go` with the following tests:
- TestNewCmdCompletion
- TestRunCompletion

A separate commit exports the function GetSupportedShells() to obtain the list of supported shells.

Test coverage is at 96%. The only untested bit is an `io.Writer.Write()` call in `RunCompletion()`. in the case of `bytes.Buffer` it would panic and/or always return `nil` for `error`.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

NONE

**Special notes for your reviewer**:

NONE

**Release note**:

```release-note
NONE
```
2018-05-11 16:33:43 -07:00
Lubomir I. Ivanov af44aa1491 kubeadm-init: update note about failing containers
This PR was merged before all requested changes
were applied:
kubernetes/pull/59731

Update the note about failing containers as requested here:
https://github.com/kubernetes/kubernetes/pull/59731#pullrequestreview-119517427
2018-05-12 02:26:10 +03:00
liz bed8658542
Tests for kubeadm marshal utilities 2018-05-11 17:50:41 -04:00
liz 43241992fc
Generated artefacts 2018-05-11 17:50:41 -04:00
Kubernetes Submit Queue 83c05ea1b4
Merge pull request #63723 from liztio/version-configs
Automatic merge from submit-queue (batch tested with PRs 63367, 63718, 63446, 63723, 63720). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add kind and version to Kubeadm MasterConfiguration configmaps

**What this PR does / why we need it**:
Right now Kubeadm serializes its configuration objects with just `yaml.Marshal`. By switching to `runtime.Encode`, we guarantee that version information will be added.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

**Special notes for your reviewer**:
First part of KEP0008

**Release note**:

```release-note
None
```
2018-05-11 14:49:19 -07:00
Kubernetes Submit Queue 92ba95c39c
Merge pull request #63446 from deads2k/client-08-remove-old
Automatic merge from submit-queue (batch tested with PRs 63367, 63718, 63446, 63723, 63720). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

finish new dynamic client and deprecate old dynamic client

Builds on a couple other pulls.  This completes the transition to the new dynamic client.

@kubernetes/sig-api-machinery-pr-reviews 
@caesarxuchao @sttts 

```release-note
The old dynamic client has been replaced by a new one.  The previous dynamic client will exist for one release in `client-go/deprecated-dynamic`.  Switch as soon as possible.
```
2018-05-11 14:49:16 -07:00
liz 6560ba7bed
Use apimachinery for serialising kubeadm MasterConfiguration
this ensures configmaps have kind and versions in them
2018-05-11 14:35:19 -04:00
liz 859add6603
Update generated artefacts 2018-05-11 14:35:10 -04:00
Kubernetes Submit Queue 1592f59c5f
Merge pull request #59731 from achew22/patch-1
Automatic merge from submit-queue (batch tested with PRs 63049, 59731). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add instructions on how to debug a crashed pod

When I was using `kubeadm init`, I ran into an issue where I had passed an
invalid flag through the kubeadm config file. The flag was being passed into
apiserver and preventing it from launching with a "unknown flag" error.

The flag in question is (other flags elided for clarity):

```
admission-control: ...,GenericAdmissionWebhook,...
```

Since this prevented the apiserver from coming up, the setup timed out
and gave me the error message I just modified.

It would be better if the config was vetted more thoroughly, but I think
documenting the backup strategy for viewing logs in case of failure is
also valuable.



**What this PR does / why we need it**:
This PR extends an error message in kubeadm to make it clear a potential step forward for new cluster users.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #59731 

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-05-11 11:07:16 -07:00
Kubernetes Submit Queue 5a54555f59
Merge pull request #63049 from andrewsykim/kcm-nodeipam
Automatic merge from submit-queue (batch tested with PRs 63049, 59731). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

re-enable nodeipam in kube-controller-manager

**What this PR does / why we need it**:
Re-enables nodeipam controller for external clouds. Also does a small refactor so that we don't need to pass in `allocateNodeCidr` into the controller. 

In v1.10 we made a change (9187b343e1 (diff-f11913dc67d80d36b3d06a93f61c49cf) in https://github.com/kubernetes/kubernetes/pull/57492) where nodeipam would be disabled for any cluster that sets `--cloud-provider=external`. The original intention behind this was that the nodeipam controller is cloud specific for some clouds (only GCE at the moment) so it should be moved to the CCM (cloud controller manager). After some discussions with wg-cloud-provider it makes sense to re-enable nodeipam controller in KCM and have GCE CCM enable its own cloud-specific IPAM controller as part of [Initialize()](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/cloud.go#L33-L35). This would allow for GCE to run nodeipam in both KCM (by setting --cloud-provider=gce and --allocate-node-cidr) and in the CCM (once implemented in `Initialize()`) without disabling nodeipam in the KCM for all external clouds and avoids having to implement nodeipam in CCM. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes # 

**Special notes for your reviewer**:


**Release note**:
```release-note
Re-enable nodeipam controller for external clouds. 
```
2018-05-11 11:07:12 -07:00
Lucas Käldström 69cb1a5fda
Revisit the OWNERS file for kubeadm 2018-05-11 20:12:11 +03:00
David Eads fd044d152e fix dynamic client name 2018-05-11 13:12:09 -04:00
Kubernetes Submit Queue 5133d19fb0
Merge pull request #63684 from timothysc/priority
Automatic merge from submit-queue (batch tested with PRs 63673, 63712, 63691, 63684). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add 'system-cluster-critical' to kubeadm control plane pods.

**What this PR does / why we need it**:
Add 'system-cluster-critical' to kubeadm control plane pods.

**Which issue(s) this PR fixes**:
Fixes https://github.com/kubernetes/kubeadm/issues/395

**Special notes for your reviewer**:

**Release note**:

```
NONE
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
2018-05-11 09:49:13 -07:00
Kubernetes Submit Queue fc28923e71
Merge pull request #63691 from detiber/warn_systemd-resolved
Automatic merge from submit-queue (batch tested with PRs 63673, 63712, 63691, 63684). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm - add preflight warning when using systemd-resolved

**What this PR does / why we need it**:

This PR adds a preflight warning when the host is running systemd-resolved.

Newer Ubuntu releases (artful and bionic in particular) run systemd-resolved by default and in the dfeault configuration have an /etc/resolv.conf file that references 127.0.0.53 which is not accessible from containers running on the host. We will now provide a warning to the user to tell them that the kubelet args should include `--resolv-conf=/run/systemd/resolve/resolv.conf`. `/run/systemd/resolve/resolv.conf`. 

**Which issue(s) this PR fixes**:
This does not resolve the following issues, but it does provide better output to the users affected by the issues: https://github.com/kubernetes/kubeadm/issues/273 https://github.com/kubernetes/kubeadm/issues/787

**Release note**:
```release-note
NONE
```
2018-05-11 09:49:10 -07:00
Kubernetes Submit Queue 6f182a1ccc
Merge pull request #63673 from chuckha/remove-extra-args-check
Automatic merge from submit-queue (batch tested with PRs 63673, 63712). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove ExtraArgs kubeadm preflight check

This check pulled in a number of dependencies that bloated the dep graph.

The feature itself was not worth an extra 500 dependencies so we decided
to remove the feature.

Closes kubernetes/kubeadm#497

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>

**What this PR does / why we need it**:
This PR removes a check that was pulling in a lot of external dependencies. We decided the check was not worth the extra dependencies.

**Special notes for your reviewer**:
We might want to keep the first part of the check and only delete the second part, but it was easier to delete the whole thing.

**Release note**:

```release-note
Removes a preflight check for kubeadm that validated custom kube-apiserver, kube-controller-manager and kube-scheduler arguments.
```
2018-05-11 09:00:09 -07:00
Kubernetes Submit Queue 27803825e3
Merge pull request #63669 from deads2k/cli-55-restmappersnip
Automatic merge from submit-queue (batch tested with PRs 63669, 63511, 63561, 63289). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 move resource builder to generic options

This pull snips the last kube/kube links from the resource builder and moves it to the genericclioptions to be built out into flags from there.

@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-05-10 14:25:10 -07:00
Jason DeTiberus 7d7ffdb602
kubeadm - add preflight warning when using systemd-resolved 2018-05-10 17:01:58 -04:00
Robert Pothier 8bfe7f8dae Update comments and UT to remove /66 restriction
The comments in cmd/kubeadm/app/phases/controlplane/manifests.go mention the
IPv6 /66 restriction, and the UT also refers to this.
This restriction was removed in PR#60089
2018-05-10 16:15:52 -04:00
Kubernetes Submit Queue 828ffd5a4e
Merge pull request #63450 from chuckha/images
Automatic merge from submit-queue (batch tested with PRs 62665, 62194, 63616, 63672, 63450). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adds kubeadm images command

Closes kubernetes/kubeadm#388

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>

**What this PR does / why we need it**:
This PR adds a `list-images` subcommand to `kubeadm config`. We need this to make installing kubernetes on air-gapped environments a little easier. This command will print out a list of images it expects to use for the master node.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#388

**Special notes for your reviewer**:

**Release note**:
```release-note
Adds a list-images subcommand to kubeadm that lists required images for a kubeadm install.
```
2018-05-10 12:56:26 -07:00
Timothy St. Clair 465094f32b Add 'system-cluster-critical" to kubeadm control plane pods. 2018-05-10 13:58:12 -05:00
David Eads da6c6b72d8 fix message output for import verifier 2018-05-10 12:50:28 -04:00
Chuck Ha f5e68814bf
Adds kubeadm images command
Closes kubernetes/kubeadm#388

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-05-10 12:15:55 -04:00
Kubernetes Submit Queue c20a09dc97
Merge pull request #63623 from neolit123/init-token-info
Automatic merge from submit-queue (batch tested with PRs 60200, 63623, 63406). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm-init: add details about --token

**What this PR does / why we need it**:
Add details about the required format when passing
a bootstrap token using 'kubeadm init --token'.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#768

**Special notes for your reviewer**:

NONE

**Release note**:

```release-note
NONE
```
2018-05-10 08:33:07 -07:00
Kubernetes Submit Queue a64e692133
Merge pull request #63606 from liggitt/dynamic-discovery-tuning
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Optimize admission plugin API requests

xref https://github.com/kubernetes/kubernetes/issues/63030#issuecomment-387774934

* resource changes are typically slow-moving, and full discovery can be slightly expensive, so this reduces the refresh to a 30 second interval and bumps QPS on the admission client (which wasn't done when the client started getting used for discovery in #62659)
* a large consumer of API requests in scale tests was the node restriction plugin pod lookups during pod deletion. this switches to use the same informer that is feeding the node authorizer graph to avoid those lookups entirely.

```release-note
NONE
```
2018-05-10 07:21:04 -07:00
Jordan Liggitt 1245601659
Make discovery refresh period less aggressive 2018-05-10 07:53:46 -04:00
Shyam Jeedigunta 302af9bfe4 Remove 20x factor in garbage-collector qps 2018-05-10 12:21:57 +02:00
Kubernetes Submit Queue 9d6ea5b4a3
Merge pull request #63442 from mtaufen/fix-allowprivileged-default
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

change deprecated Kubelet --allow-privileged flag default to true

This enables a smooth transition to PSP. Today, users would have to
manually set --allow-privileged to true before transitioning to PSP,
which isn't a smooth deprecation path for the flag (we want people
to *stop* setting it). This PR makes the default behavior isomorphic
with what will happen after the flag is removed.

Defaulting --allow-privileged to true should be safe, because it simply
allows a superset of Pods to run (all workloads continue to work).

WRT https://github.com/kubernetes/kubernetes/issues/58010#issuecomment-383264473
the --allow-privileged flag is effectively useless for security, so this
shouldn't be a concern from that perspective.

I also bumped the deprecation timeline in the comment to 1.13.0, so that
we give people the full period of time to stop setting
--allow-privileged, now that the behavior makes it possible to do so.

```release-note
The Kubelet's deprecated --allow-privileged flag now defaults to true. This enables users to stop setting --allow-privileged in order to transition to PodSecurityPolicy. Previously, users had to continue setting --allow-privileged, because the default was false.
```
2018-05-09 20:05:50 -07:00
Kubernetes Submit Queue b2fe2a0a6d
Merge pull request #59847 from mtaufen/dkcfg-explicit-keys
Automatic merge from submit-queue (batch tested with PRs 63624, 59847). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

explicit kubelet config key in Node.Spec.ConfigSource.ConfigMap

This makes the Kubelet config key in the ConfigMap an explicit part of
the API, so we can stop using magic key names.
    
As part of this change, we are retiring ConfigMapRef for ConfigMap.


```release-note
You must now specify Node.Spec.ConfigSource.ConfigMap.KubeletConfigKey when using dynamic Kubelet config to tell the Kubelet which key of the ConfigMap identifies its config file.
```
2018-05-09 17:55:13 -07:00
Kubernetes Submit Queue 556f01e703
Merge pull request #63452 from xlgao-zju/add-path-type
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[kubeadm] Support `HostPathType` of ExtraVolumes in the kubeadm configuration file.

**What this PR does / why we need it**:

Now we use `DirectoryOrCreate ` as a default `HostPathType` in the kubeadm configuration file, when we create user's extra volumes(like `apiServerExtraVolumes`). So, user can't use other `HostPathType`. In order to let users use other types of `HostPath`(like `File`), I think we should support `HostPathType` of ExtraVolumes in the kubeadm configuration file. 

**Which issue(s) this PR fixes**

ref [kubernetes/kubeadm#788](https://github.com/kubernetes/kubeadm/issues/788)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-09 16:54:26 -07:00
Lubomir I. Ivanov 9bb0fdc7b2 kubeadm-init: add details about --token
Add details about the required format when passing
a bootstrap token using 'kubeadm init --token'.

Fixes kubernetes/kubeadm#768
2018-05-10 02:27:46 +03:00
Lubomir I. Ivanov 5510b4c94a kubeadm: add test coverage to completion.go
Included tests:
- TestNewCmdCompletion
- TestRunCompletion
2018-05-09 23:15:45 +03:00
Lubomir I. Ivanov 8303f8ecc8 kubeadm: add GetSupportedShells() to completion.go
Add the function GetSupportedShells() in completion.go
and export it. It will be re-used in tests to obtain
the valid list of supported shells.
2018-05-09 22:35:12 +03:00
Kubernetes Submit Queue c94efcea1d
Merge pull request #63504 from dims/improve-where-we-load-build-versions-for-kubeadm-upgrade-jobs
Automatic merge from submit-queue (batch tested with PRs 62850, 63504). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve where we load builds from for kubeadm upgrade jobs

**What this PR does / why we need it**:

For 1.8,1.9,1.10 branches, we need to load the latest
version from ci/latest*.txt.

For master, we need to load the version number from
ci-cross/latest.txt

try these to verify:
```
gsutil cat gs://kubernetes-release-dev/ci/latest-1.9.txt
gsutil cat gs://kubernetes-release-dev/ci-cross/latest.txt
```


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubernetes/issues/61483

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixed where we get latest builds for stable branches
```
2018-05-09 12:27:18 -07:00
Kubernetes Submit Queue 24e5265dbc
Merge pull request #62850 from neolit123/token-config
Automatic merge from submit-queue (batch tested with PRs 62850, 63504). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm-token: search for existing kubeconfig files

**What this PR does / why we need it**:

Add means to search the current user home path and
the environment variable KUBECONFIG for existing files if the
user does not provide a --kubeconfig flag.

If the user provides a --kubeconfig flag respect it.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/198

**Special notes for your reviewer**:

i'm not 100% sure if that's the correct approach and if that's what's requested. so let's discuss it.

**Release note**:

```release-note
Search standard KubeConfig file locations when using `kubeadm token` without `--kubeconfig`.
```
2018-05-09 12:27:14 -07:00
Chuck Ha 9f21f5dd1e
Remove ExtraArgs kubeadm preflight check
This check pulled in a number of dpendencies that bloated the dep graph.

The feature itself was not worth an extra 500 dependencies so we decided
to remove the feature.

Closes kubernetes/kubeadm#497

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-05-09 14:09:57 -04:00
Sandeep Rajan 379c8e83da Improve coredns upgrade path 2018-05-09 12:37:22 -04:00
Davanum Srinivas ff26e57ba6 Improve where we load builds from for kubeadm upgrade jobs
We should stop special casing "ci-cross" and just use the
configuration in test-infra to dictate where we pick up
the builds from.

For 1.8,1.9,1.10 branches, we need to load the latest
version from ci/latest*.txt.

For master, 1.11 etc, we need to load from ci-cross/latest*.txt.

We need to update test-infra configs if things fail.

try these to verify:
```
gsutil cat gs://kubernetes-release-dev/ci/latest-1.9.txt
gsutil cat gs://kubernetes-release-dev/ci-cross/latest.txt
```
2018-05-09 12:11:41 -04:00
Kubernetes Submit Queue bc6e5255a4
Merge pull request #63297 from bart0sh/PR0012-kubeadm-fix-exec.Command
Automatic merge from submit-queue (batch tested with PRs 63297, 61883). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix commands running crictl

**What this PR does / why we need it**:

Running "kubeadm reset --cri-socket unix:///var/run/crio/crio.sock"
fails with this error:
[reset] Cleaning up running containers using crictl with socket unix:///var/run/crio/crio.sock
[reset] Failed to list running pods using crictl. Trying using docker instead.

The actual error returned by underlying API os/exec is:
fork/exec /usr/bin/crictl -r /var/run/crio/crio.sock info: no such file or directory

This is caused by passing full command line instead of executable
path as a first parameter to the Command API.

Fixed by passing correct parameters to the Command API.
Improved error output.

**Special notes for your reviewer**:
This issue was caused by breaking crictl command execution in [PR 58802](https://github.com/kubernetes/kubernetes/pull/58802)

**Release note**:
```release-note
NONE
```
2018-05-08 20:38:08 -07:00
Xianglin Gao 6c953a04fd Add test about host path type
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-05-09 10:46:39 +08:00
Michael Taufen c41cf55a2c explicit kubelet config key in Node.Spec.ConfigSource.ConfigMap
This makes the Kubelet config key in the ConfigMap an explicit part of
the API, so we can stop using magic key names.

As part of this change, we are retiring ConfigMapRef for ConfigMap.
2018-05-08 15:37:26 -07:00
David Eads c5445d3c56 simplify api registration 2018-05-08 18:33:50 -04:00
David Eads 7b4f97aca3 generated 2018-05-08 18:32:44 -04:00
Kubernetes Submit Queue 51d75a7b1e
Merge pull request #63444 from deads2k/client-07-gc-dynamic
Automatic merge from submit-queue (batch tested with PRs 63526, 60371, 63444). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update garbage collection to use the new dynamic client

Update GC to use the new and easy to use dynamic client.  This is one of two remaining stragglers.

@kubernetes/sig-api-machinery-pr-reviews 
@caesarxuchao @ironcladlou 

```release-note
NONE
```
2018-05-08 15:24:11 -07:00
David Eads dd97a7bc59 move client based restmappers to client-go 2018-05-08 08:11:56 -04:00
Kubernetes Submit Queue 81b96b822e
Merge pull request #63373 from juanvallejo/jvallejo/begin-wiring-config-flags-struct
Automatic merge from submit-queue (batch tested with PRs 63373, 63338). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Wire ConfigFlags struct through cmdutil.Factory

**Release note**:
```release-note
NONE
```

Continues the Flags struct pattern established with PrintFlags.
Wires ConfigFlags through the client_access_factory

cc @deads2k @soltysh
2018-05-07 12:22:07 -07:00
Jordan Liggitt 814b065928
Close all kubelet->API connections on heartbeat failure 2018-05-07 15:06:31 -04:00
Jordan Liggitt 52876f77e9
Always track kubelet -> API connections 2018-05-07 15:06:30 -04:00
Kubernetes Submit Queue 858c861ac0
Merge pull request #63431 from deads2k/client-06-kubeadm
Automatic merge from submit-queue (batch tested with PRs 62914, 63431). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use new dynamic client

Updates kubeadm to use the new dynamic client that simplifies call patterns.

@kubernetes/sig-cluster-lifecycle-pr-reviews 

```release-note
NONE
```
2018-05-07 10:44:08 -07:00
David Eads cf4f7aab65 update garbage collection to use the new dynamic client 2018-05-07 09:01:39 -04:00
juanvallejo 3ca222b2d9 wire config flags through factory 2018-05-04 17:02:20 -04:00
Kubernetes Submit Queue bac31d698c
Merge pull request #62990 from hzxuzhonghu/dynamic-restMapper-namespace-controller
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add dynamic RESTMapper to ControllerContext and make it generic

Add RESTMapper to ControllerContext and make it generic.

**Release note**:

```release-note
NONE
```
2018-05-04 13:33:03 -07:00
Kubernetes Submit Queue 31511f9e24
Merge pull request #63383 from liggitt/lease-reconciler
Automatic merge from submit-queue (batch tested with PRs 63315, 63383, 63318, 63439). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Re-enable lease reconciler, fix shutdown race

Fixes #63378
Fixes #57617

* Fixes the openapi script to wait for the apiserver on shutdown (like all the other scripts do)
* Fixes the apiserver shutdown to not hang forever if the kubernetes service reconciler cannot persist to etcd
* Readds https://github.com/kubernetes/kubernetes/pull/58474 to make the default the lease reconciler

```release-note
kube-apiserver: the default `--endpoint-reconciler-type` is now `lease`. The `master-count` endpoint reconciler type is deprecated and will be removed in 1.13.
```
2018-05-04 12:41:09 -07:00
Xianglin Gao 5d55f28662 Add host path type in kubeadm config
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-05-05 01:25:47 +08:00
Michael Taufen 771b850039 change deprecated Kubelet --allow-privileged flag default to true
This enables a smooth transition to PSP. Today, users would have to
manually set --allow-privileged to true before transitioning to PSP,
which isn't a smooth deprecation path for the flag (we want people
to *stop* setting it). This PR makes the default behavior isomorphic
with what will happen after the flag is removed.

Defaulting --allow-privileged to true should be safe, because it simply
allows a superset of Pods to run (all workloads continue to work).

WRT https://github.com/kubernetes/kubernetes/issues/58010#issuecomment-383264473
the --allow-privileged flag is effectively useless for security, so this
shouldn't be a concern from that perspective.

I also bumped the deprecation timeline in the comment to 1.13.0, so that
we give people the full period of time to stop setting
--allow-privileged, now that the behavior makes it possible to do so.
2018-05-04 09:51:51 -07:00
David Eads 7588af992c use new dynamic client 2018-05-04 08:15:06 -04:00
Kubernetes Submit Queue 2f694e8fa1
Merge pull request #63404 from kubernetes/revert-60372-sttts-scheduler-option-config
Automatic merge from submit-queue (batch tested with PRs 61455, 63346, 63130, 63404). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Revert "scheduler: align with ctrl-managers and apiservers, add https+auth in options"

This PR completely broke scheduler performance:
https://k8s-testgrid.appspot.com/sig-scalability-kubemark#kubemark-5000

Pod startup time exploded to ~20s.

Ref: https://github.com/kubernetes/kubernetes/pull/60372
2018-05-03 14:24:13 -07:00
Kubernetes Submit Queue 4e3efbe364
Merge pull request #61455 from liggitt/uid-conflict
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deprecate repair-malformed-updates flag, move object meta mutation into BeforeCreate

closes #23297

```release-note
NONE
```
2018-05-03 13:41:07 -07:00
Wojciech Tyczynski 7b93d81a97
Revert "scheduler: align with ctrl-managers and apiservers, add https+auth in options" 2018-05-03 21:05:00 +02:00
Ryan Phillips e3e31ecd40
apiserver: change default reconciler to LeaseEndpoint
Fixes #57617
2018-05-02 22:16:23 -04:00
Jordan Liggitt 0cffc7eef5
Revert "apiserver: change default reconciler to LeaseEndpoint"
This reverts commit 0227534e99.
2018-05-02 18:46:18 -04:00
Chao Wang 90b3f46eae Add necessary explanation for container log rotation. 2018-05-02 15:37:13 +08:00
Kubernetes Submit Queue 7d57060d9e
Merge pull request #61833 from bart0sh/PR0008-kubelet-unknown-command
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

check for commands in kubelet command line

**What this PR does / why we need it**:

Kubelet doesn't support subcommands and silently ignores them.
This causes a lot of confusion among users, for example:

  Running 'kubelet logs' can produce this output:
```
    I0206 16:20:40.010949    5712 feature_gate.go:220] feature gates: &{{} map[]}
    I0206 16:20:40.011054    5712 controller.go:114] kubelet config controller: starting controller
    ...
    error: failed to run Kubelet: failed to create kubelet:
           misconfiguration: kubelet cgroup driver: "cgroupfs" is different from
           docker cgroup driver: "systemd"
```

The output in this case looks like a valid log output. The error is not
caused by incorrectly configured cgroup driver though. It's caused by
the fact that kubelet ignores 'logs' subcommand, so 'kubelet logs' is
essentially the same as 'kubelet': it runs kubelet with the default set
of parameters, including default cgroup driver.

**The fix**:
Added check to prevent kubelet from running if user specifies
subcommands in the command line.

**Which issue(s) this PR fixes**:
Fixes: kubeadm issue 639

**Release note**:
```release-note
NONE
```
2018-05-01 21:09:17 -07:00
Kubernetes Submit Queue 18b545f67c
Merge pull request #63201 from chuckha/offline-plan
Automatic merge from submit-queue (batch tested with PRs 63138, 63091, 63201, 63341). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Enable bypassing online checks in kubeadm upgrade plan

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>

**What this PR does / why we need it**:

This PR makes `kubeadm upgrade plan` a little nicer to use in an air gapped environment. `kubeadm upgrade plan` now accepts a version and returns that instead of checking the internet.

**Which issue(s) this PR fixes**:

Fixes kubernetes/kubeadm#698

**Special notes for your reviewer**:

I also cleaned up the tests for this section of code by adding formal names for table tests and using `t.Run`.

**Release note**:

```release-note
`kubeadm upgrade plan` now accepts a version which improves the UX nicer in air-gapped environments.
```
2018-05-01 16:00:15 -07:00
Kubernetes Submit Queue bd5ea57398
Merge pull request #63138 from chuckha/api-server-extra-args
Automatic merge from submit-queue (batch tested with PRs 63138, 63091, 63201, 63341). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Api server extra args

**What this PR does / why we need it**:

This PR will correctly override the APIServer command with the values found in APIServerExtraArgs. If none are passed in a default set of flags will be used.

This also includes cleaning up tests by using `t.Run` and naming test cases so we know what they are doing. `t.Run` also provides better testing output when coupled with a name.

At some point we stopped using the k8s version to generate this command. It is trivial to add back if we need it later, but since we don't use it now it's best for it to go. This also exposed several test that were identical. Those have been removed.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#760

**Special notes for your reviewer**:
I split this into two commits since it's a bit easier to think about like that, but would be fine squashing.

**Release note**:

```release-note
NONE
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
2018-05-01 16:00:09 -07:00
Ryan Phillips 0227534e99 apiserver: change default reconciler to LeaseEndpoint
Fixes #57617
2018-04-30 10:06:44 -05:00
Ed Bartosh 145cd635e2 fix commands running crictl
Running "kubeadm reset --cri-socket unix:///var/run/crio/crio.sock"
fails with this error:
[reset] Cleaning up running containers using crictl with socket unix:///var/run/crio/crio.sock
[reset] Failed to list running pods using crictl. Trying using docker instead.

The actual error returned by underlying API os/exec is:
fork/exec /usr/bin/crictl -r /var/run/crio/crio.sock info: no such file or directory

This is caused by passing full command line instead of executable
path as a first parameter to the Command API.

Fixed by passing correct parameters to the Command API.
Improved error output.
2018-04-30 17:33:27 +03:00
Dr. Stefan Schimanski 24bc981918 Update bazel 2018-04-28 22:36:13 +02:00
Dr. Stefan Schimanski 2af0bdb00f scheduler: add https+authn+authz to options, set to nil for now 2018-04-28 22:36:13 +02:00
Dr. Stefan Schimanski abc8c98e35 scheduler: align plumbing with controller-manager and apiservers 2018-04-28 22:36:13 +02:00
Dr. Stefan Schimanski 85099ba4c2 controller-manager: unify address flag description to listen on all interfaces 2018-04-28 22:36:13 +02:00
Dr. Stefan Schimanski 01881d3f0c controller-manager: make InsecureServingOptions/Config re-usable 2018-04-28 22:36:13 +02:00
hzxuzhonghu 7f93d11f9e Add RESTMapper to ControllerContext and make it generic for controllers 2018-04-28 09:58:43 +08:00
Kubernetes Submit Queue bbcd21e0ab
Merge pull request #60890 from rphillips/tests/lease_endpoint
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver: master count and lease endpoint test

**What this PR does / why we need it**: Adds a test to make sure master count and lease endpoint reconcilers work well together, so we can bump LeaseEndpoint to beta. Based on Jordan's comment https://github.com/kubernetes/kubernetes/pull/58474#issuecomment-369954890. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Issue: #57617
Followup PR: #58474

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
/cc @kubernetes/sig-cluster-lifecycle-api-reviews @kubernetes/sig-cluster-lifecycle-api-reviews
2018-04-27 16:54:16 -07:00
Jordan Liggitt 7f840f4441
Deprecate repair-malformed-updates flag, move object meta mutation into BeforeCreate 2018-04-27 17:26:39 -04:00
Ryan Phillips efe19e4acb master count and lease endpoint tests 2018-04-27 13:03:31 -05:00
Kubernetes Submit Queue 625bce3ff6
Merge pull request #63169 from smarterclayton/limit_dependencies
Automatic merge from submit-queue (batch tested with PRs 63251, 59166, 63250, 63180, 63169). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Break a generic package dependency to core/api/v1

It is not necessary for this package to depend on core/v1.
2018-04-27 10:45:21 -07:00
Kubernetes Submit Queue 95841fe5ea
Merge pull request #63251 from liggitt/namespace-controller-qps
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump QPS on namespace controller

https://github.com/kubernetes/kubernetes/pull/62913 switched from using a client pool, where each groupVersionResource got its own rest client, to a single client.

This increases the QPS to account for increased requests using a single rest client rate limiter.

Fixes #63240

```release-note
NONE
```
2018-04-27 10:06:56 -07:00
Jordan Liggitt 1bddcdcf44
Bump QPS on namespace controller
https://github.com/kubernetes/kubernetes/pull/62913 switched from using a client pool, where each groupVersionResource got its own rest client, to a single client.

This increases the QPS to account for increased requests using a single rest client rate limiter.
2018-04-27 10:11:14 -04:00
David Eads e2fc5cf259 remove versioning interface 2018-04-27 07:56:42 -04:00
Lubomir I. Ivanov d1f6e0bf3a kubeadm-token: search for existing kubeconfig files
Use clientcmd.NewDefaultClientConfigLoadingRules()
to search the standard locations for existing KubeConfig
files if the user did not provide a --kubeconfig flag.

If the user provides a --kubeconfig flag respect it.

Also do the following:
- Add a unit test in token_test.go for the
NewDefaultClientConfigLoadingRules() functionality.
- Rename the TestConfig and related constants to make
them unique to this file.

Fixes kubernetes/kubeadm#198
2018-04-26 20:11:27 +03:00
Kubernetes Submit Queue dd5f030b02
Merge pull request #63165 from deads2k/api-08-kubeapiversion
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove KUBE_API_VERSIONS

Fixes https://github.com/kubernetes/kubernetes/issues/63102

KUBE_API_VERSIONS is an attempt to control the available serialization of types. It pre-dates the idea that we'll have separate schemes, so it's not a thing that makes sense anymore.

Server-side we've had a very clear message about breaks in the logs for a year "KUBE_API_VERSIONS is only for testing. Things will break.".

Client-side it became progressively more broken as we moved to generic types for CRUD more than a year ago. What is registered doesn't matter when everything is unstructured.

We should remove this piece of legacy since it doesn't behave predictable server-side or client-side.

@smarterclayton @lavalamp
@kubernetes/sig-api-machinery-bugs 

```release-note
KUBE_API_VERSIONS is no longer respected.  It was used for testing, but runtime-config is the proper flag to set.
```
2018-04-26 08:22:36 -07:00
Chuck Ha fb5fe04a1e
Enable bypassing online checks in kubeadm upgrade plan
`kubeadm upgrade plan <version>` is now supported. If no
version is supplied then the original behavior remains.

If a version is supplied there will be no pause when figuring out
versions. Kubeadm will assume the version you pass in is the latest
stable version.

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-04-26 15:05:46 +01:00
David Eads a68c57155e remove KUBE_API_VERSIONS 2018-04-26 08:27:49 -04:00
Chuck Ha 6fecfe6ea6
Correctly override args with APIServerExtraArgs
Removes an unused parameter in getAPIServerCommand

Cleans up tests by:

       * Naming the tests
       * Using t.Run for better test output
       * Removing duplicates

Fixes kubernets/kubeadm#760

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-04-26 11:36:48 +01:00
Kubernetes Submit Queue 2a10c309aa
Merge pull request #63076 from chuckha/etcdprepull
Automatic merge from submit-queue (batch tested with PRs 59965, 59115, 63076, 63059). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Prepull etcd before an upgrade

If kubeadm ever has to upgrade etcd it should prepull the image so
there is less downtime during the upgrade when etcd versions change.

Fixes kubernetes/kubeadm#669

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>

**What this PR does / why we need it**:

This PR Prepulls the etcd image during a `kubeadm upgrade apply`.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

Fixes kubernetes/kubeadm#669

**Special notes for your reviewer**:

constants.MasterComponents was not changed because it is used in many places where etcd does not need to be nor should it be a part of this slice.

**Release note**:
```release-note
NONE
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
2018-04-25 17:07:14 -07:00
Kubernetes Submit Queue 163b848abe
Merge pull request #59115 from alexbrand/kubeadm-confirm-reset-2
Automatic merge from submit-queue (batch tested with PRs 59965, 59115, 63076, 63059). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: prompt for confirmation when resetting a master

Signed-off-by: Alexander Brand <alexbrand09@gmail.com>



**What this PR does / why we need it**:
This PR implements a confirmation prompt when running `kubeadm reset` on a master node. This is to prevent users from mistakenly resetting a master node.

**Which issue(s) this PR fixes**:
Fixes https://github.com/kubernetes/kubeadm/issues/673

**Special notes for your reviewer**:
I am somewhat torn on the approach on how to detect that kubeadm is running on a master node. I went with checking for the apiserver manfiest file on the local filesystem, as it seems like a simpler approach when compared to getting a k8s client, getting a list of nodes, finding the current node, and checking if it has the master taint. I am happy to rework if the latter is more desirable.

Sample runs:
```
# ./kubeadm reset
[Warning] Are you sure you want to reset this master node? Type the word "confirm" to continue: no
Aborted reset operation on master node

# ./kubeadm reset
[Warning] Are you sure you want to reset this master node? Type the word "confirm" to continue: confirm
[preflight] Running pre-flight checks.
[reset] Stopping the kubelet service.
[reset] WARNING: The kubelet service could not be stopped by kubeadm: [exit status 1]
[reset] WARNING: Please ensure kubelet is stopped manually.
[reset] Unmounting mounted directories in "/var/lib/kubelet"
........

# ./kubeadm reset
[Warning] Are you sure you want to reset this master node? Type the word "confirm" to continue:
Aborted reset operation on master node
# ./kubeadm reset --confirm
[preflight] Running pre-flight checks.
[reset] Stopping the kubelet service.
[reset] WARNING: The kubelet service could not be stopped by kubeadm: [exit status 1]
[reset] WARNING: Please ensure kubelet is stopped manually.
[reset] Unmounting mounted directories in "/var/lib/kubelet"
........
```

**Release note**:

```release-note
kubeadm: prompt the user for confirmation when resetting a master node
```
2018-04-25 17:07:12 -07:00
Kubernetes Submit Queue 37a798deea
Merge pull request #59965 from shun-miyoshi-com/fix-wrong-msg
Automatic merge from submit-queue (batch tested with PRs 59965, 59115, 63076, 63059). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix help message of kubeconfig-dir option(kubeadm alpha phase kubeconfig all)

**What this PR does / why we need it**:
This patch will fix wrong help message.

The command is kubeadm alpha phase kubeconfig [command]
The help message is for --kubeconfig-dir option.

kubeconfig-dir is not port.(It is directory)
So, I fixed the message.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

 `NONE`

/sig cluster-lifecycle
2018-04-25 17:07:08 -07:00
Clayton Coleman eaa739bd59
Limit access to core/api/v1 inside of client-go 2018-04-25 18:52:16 -04:00
Kubernetes Submit Queue 029c1d8b23
Merge pull request #63159 from ii/kubeadm--config+verbose
Automatic merge from submit-queue (batch tested with PRs 61601, 62881, 63159). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

support simultaneous kubeadm --v and --config

**What this PR does / why we need it**:

Providing -v and --config parameters to increase verbosity while providing a kubeadm.config results in an error rather than providing the requested verbosity.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

Fixes https://github.com/kubernetes/kubeadm/issues/765

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-25 14:03:24 -07:00
Kubernetes Submit Queue 30101be0dc
Merge pull request #61601 from neolit123/test-join
Automatic merge from submit-queue (batch tested with PRs 61601, 62881, 63159). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: add test coverage to join.go

**What this PR does / why we need it**:
Add test coverage to `join.go`.

A separate commit exports the function `ValidateJoinCommandLine()` from `join.go` so that testing this file is more flexible.

Test coverage is at 76%. One untested part is successfully running `Join.Run()` without errors, but that requires a valid HTTPS API server running and a valid config. i got this partially working but gave up because i faced some cert / config blockers. suggestions on how to get that to work easily are welcome.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

NONE

**Special notes for your reviewer**:

NONE

**Release note**:

```release-note
NONE
```
2018-04-25 14:03:18 -07:00
Alexander Brand 8ea5be8d89
kubeadm: accept 'Y' and 'y' as reset confirmation
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
2018-04-25 16:21:16 -04:00
Kubernetes Submit Queue 97287177ee
Merge pull request #63075 from deads2k/api-05-eliminate-indirection
Automatic merge from submit-queue (batch tested with PRs 62982, 63075, 63067, 62877, 63141). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

eliminate indirection from type registration

Some years back there was a partial attempt to revamp api type registration, but the effort was never completed and this was before we started splitting schemes. With separate schemes, the idea of partial registration no longer makes sense.  This pull starts removing cruft from the registration process and pulls out a layer of indirection that isn't needed.

@kubernetes/sig-api-machinery-pr-reviews 
@lavalamp @cheftako @sttts @smarterclayton 

Rebase cost is fairly high, so I'd like to avoid this lingering.

/assign @sttts 
/assign @cheftako 

```release-note
NONE
```
2018-04-25 11:53:14 -07:00
Kubernetes Submit Queue af5f9bc9bb
Merge pull request #62982 from dixudx/warning_kubelet_remote_sandbox
Automatic merge from submit-queue (batch tested with PRs 62982, 63075, 63067, 62877, 63141). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add warnings on using pod-infra-container-image for remote container runtime

**What this PR does / why we need it**:
We should warn on using `--pod-infra-container-image` to avoid confusions, when users are using remote container runtime.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55676,#62388,#62732

**Special notes for your reviewer**:
/cc @kubernetes/sig-node-pr-reviews 

**Release note**:

```release-note
add warnings on using pod-infra-container-image for remote container runtime
```
2018-04-25 11:53:11 -07:00
Chris McClimans b8128bda79 support simultaneous kubadm --v and --config 2018-04-26 05:53:43 +12:00
David Eads e7fbbe0e3c eliminate indirection from type registration 2018-04-25 09:02:31 -04:00
David Eads 3632037e60 add easy to use dynamic client 2018-04-25 08:55:26 -04:00
Lubomir I. Ivanov 9e3f4e21fd kubeadm: add test coverage to join.go
Included tests:
- TestNewValidJoin
2018-04-25 15:36:25 +03:00
Lubomir I. Ivanov 01377eeaf6 kubeadm: use the helper NewValidJoin() in join.go
Instead of using kubeadmutil.CheckErr() in every single
phase of cmd.Run(), use a new helper function
NewValidJoin() that returns a single error.

This would improve the unit testing options for this file.
Otherwise any error in cmd.Run() will trigger an os.Exit()
as kubeadmutil.CheckErr() does that.
2018-04-25 15:14:13 +03:00
Alexander Brand b25738b860
kubeadm: prompt for confirmation when resetting a master
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
2018-04-25 08:00:42 -04:00
Kubernetes Submit Queue aa1ec693c3
Merge pull request #62951 from dims/support-nsenter-better-in-non-systemd-envs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support nsenter in non-systemd environments

**What this PR does / why we need it**:

In our CI, we run kubekins image for most of the jobs. This is a
debian image with upstart and does not enable systemd. So we should

* Bailout if any binary is missing other than systemd-run.
* SupportsSystemd should check the binary path to correctly
  identify if the systemd-run is present or not
* Pass the errors back to the callers so kubelet is forced to
  fail early when there is a problem. We currently assume
  that all binaries are in the root directory by default which
  is wrong.


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-25 01:08:10 -07:00
Kubernetes Submit Queue 50dd920837
Merge pull request #62284 from DirectXMan12/bug/fix-use-rest-clients-help-line
Automatic merge from submit-queue (batch tested with PRs 59220, 62927, 63084, 63090, 62284). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix hpa-use-rest-clients help text

The help text erroneously says "WARNING: alpha feature" when it
shouldn't have.  When we moved to beta, this should have been removed.

**Release note**:
```release-note
NONE
```
2018-04-24 19:01:23 -07:00
Kubernetes Submit Queue 47ece3a2ca
Merge pull request #59220 from neolit123/test-token
Automatic merge from submit-queue (batch tested with PRs 59220, 62927, 63084, 63090, 62284). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: add better test coverage to token.go

**What this PR does / why we need it**:
a PR for adding some more tests in `kubeadm/cmd` for `token.go`.

some areas of the `token.go` like listing, creating and deleting tokens can present challenges.
coverage was increased to around 87%.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

please, link issue # if you know of such.

**Special notes for your reviewer**:
none

**Release note**:

```release-note
NONE
```
2018-04-24 19:01:10 -07:00
Kubernetes Submit Queue b2ab901230
Merge pull request #62390 from discordianfish/kube-proxy-tolerate-all
Automatic merge from submit-queue (batch tested with PRs 62655, 61711, 59122, 62853, 62390). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Make kube-proxy tolerate all taints

**What this PR does / why we need it**:
As a essential core component, kube-proxy should generally run on all
nodes even if the cluster operator taints nodes for special purposes.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#699

**Release note**:

```release-note
kubeadm creates kube-proxy with a toleration to run on all nodes, no matter the taint.
```
2018-04-24 13:28:31 -07:00
Kubernetes Submit Queue f388fcb229
Merge pull request #59122 from klausenbusk/kubeadm-ca
Automatic merge from submit-queue (batch tested with PRs 62655, 61711, 59122, 62853, 62390). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Mount additional paths inside apiserver/controller-manager for working CA root

This is required for a working CA root, as /etc/ssl/certs on a few
Linux distributions just contains a bunch of symlinks.
Container Linux and Debian have symlinks pointing to
/usr/share/ca-certificates, ArchLinux has symlinks pointing
to /etc/ca-certificates.
On Debian /etc/ssl/certs can also include symlinks pointing
to /usr/local/share/ca-certificates for local CA certificates.

Fix: kubeadm/#671

---

**What this PR does / why we need it**:

Without this PR, `controller-manager` and `apiserver` would lack a CA root on some Linux distro (ex: Container Linux) which for example break flexplugins which require a CA root [[1]](https://github.com/kubernetes-incubator/external-storage/issues/571#issuecomment-360155462).

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/671

**Special notes for your reviewer**:

**Release note**:
```release-note
Mount additional paths required for a working CA root, for setups where /etc/ssl/certs doesn't contains certificates but just symlink.
```

/sig sig-kubeadm
2018-04-24 13:28:21 -07:00
Kubernetes Submit Queue bf1974c83f
Merge pull request #61711 from crassirostris/audit-size-limiting
Automatic merge from submit-queue (batch tested with PRs 62655, 61711, 59122, 62853, 62390). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Implemented truncating audit backend

Fixes https://github.com/kubernetes/kubernetes/issues/60432

Introduces an optional truncating backend, disabled by default, that estimates the size of audit events and truncates events/split batches based on the configuration.

/cc @sttts @tallclair @CaoShuFeng @ericchiang 

```release-note
Introduce truncating audit backend that can be enabled for existing backend to limit the size of individual audit events and batches of events.
```
2018-04-24 13:28:17 -07:00
Kubernetes Submit Queue 67870dac16
Merge pull request #62655 from stealthybox/TLSUpgrade_+_detiber-kubeadm_hash
Automatic merge from submit-queue (batch tested with PRs 62655, 61711, 59122, 62853, 62390). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Modify the kubeadm upgrade DAG for the TLS Upgrade

**What this PR does / why we need it**:
This adds the necessary utilities to detect Etcd TLS on static pods from the file system and query Etcd.
It modifies the upgrade logic to make it support the APIServer downtime.
Tests are included and should be passing.

```bash 
bazel test //cmd/kubeadm/... \
  && bazel build //cmd/kubeadm --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \
  && issue=TLSUpgrade ~/Repos/vagrant-kubeadm-testing/copy_kubeadm_bin.sh
```
These cases are working consistently for me
```bash
kubeadm-1.9.6 reset \
  && kubeadm-1.9.6 init --kubernetes-version 1.9.1 \
  && kubectl apply -f https://git.io/weave-kube-1.6
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.9.6  # non-TLS to TLS
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.10.0 # TLS to TLS
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.10.1 # TLS to TLS
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.9.1  # TLS to TLS /w major version downgrade
```

This branch is based on top of #61942, as resolving the hash race condition is necessary for consistent behavior.
It looks to fit in pretty well with @craigtracey's PR: #62141
The interfaces are pretty similar

/assign @detiber @timothysc

**Which issue(s) this PR fixes**
Helps with https://github.com/kubernetes/kubeadm/issues/740

**Special notes for your reviewer**:

278b322a1c
   [kubeadm] Implement ReadStaticPodFromDisk

c74b56372d
   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

8d8e5fe33b
   Update test-case, fix nil-pointer bug, and improve error message

97117fa873
   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

**Release note**:
```release-note
kubeadm upgrade no longer races leading to unexpected upgrade behavior on pod restarts
kubeadm upgrade now successfully upgrades etcd and the controlplane to use TLS
kubeadm upgrade now supports external etcd setups
kubeadm upgrade can now rollback and restore etcd after an upgrade failure
```
2018-04-24 13:28:13 -07:00
Kubernetes Submit Queue c0d1ab8e99
Merge pull request #62083 from rramkumar1/ipvs-exclude-cidrs-flag
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add --ipvs-exclude-cidrs flag to kube-proxy. 

**What this PR does / why we need it**:
Add a flag to kube-proxy called --ipvs-exclude-cidrs. This flag allows a user to specify a list of CIDR ranges that should not be included in the cleanup of IPVS rules. 

Fixes: #59507

**Release note**:
```
Use --ipvs-exclude-cidrs to specify a list of CIDR's which the IPVS proxier should not touch when cleaning up IPVS rules.
```
/assign @m1093782566
2018-04-24 11:13:14 -07:00
Solly Ross a6c653d87f Fix hpa-use-rest-clients help text
The help text erroneously says "WARNING: alpha feature" when it
shouldn't have.  When we moved to beta, this should have been removed.
2018-04-24 13:29:08 -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
Chuck Ha 87fa644b33
Prepull etcd before an upgrade
If kubeadm ever has to upgrade etcd it should prepull the image so
there is less downtime during the upgrade when etcd versions change.

Fixes kubernetes/kubeadm#669

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-04-24 14:12:31 +01:00
Kubernetes Submit Queue b0fb272494
Merge pull request #63003 from bsalamat/fix_scheduler_informer
Automatic merge from submit-queue (batch tested with PRs 62495, 63003, 62829, 62151, 62002). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix scheduler informers to receive events for all the pods in the cluster

**What this PR does / why we need it**:
This PR has an important change to fix scheduler informers. More information in #63002.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #63002

**Special notes for your reviewer**:
This should be back-ported to 1.10 and 1.9.

**Release note**:

```release-note
Fix scheduler informers to receive events for all the pods in the cluster.
```
2018-04-23 22:45:17 -07:00
andrewsykim 0a164760dc renable nodeipam in kube-controller-manager 2018-04-23 22:28:37 -04:00
Kubernetes Submit Queue d23ad1f894
Merge pull request #62947 from fabriziopandini/kubeadm-ha-ControlPlaneEndpoint2
Automatic merge from submit-queue (batch tested with PRs 62464, 62947). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make API.ControlPlaneEndpoint accept IP

**What this PR does / why we need it**:
This PR implements one of the actions defined by https://github.com/kubernetes/kubeadm/issues/751 (checklist form implementing HA in kubeadm).

With this PR, the `API.ControlPlaneEndpoint` value in the kubeadm MasterConfiguration file now accepts both DNS and IP.

The `API.ControlPlaneEndpoint` should be used to set a stable IP address for the control plane; in an HA configuration, this should be the load balancer address (no matter if identified by a DNS name or by a stable IP).

**Special notes for your reviewer**:
/CC @timothysc 
This PR is the same of https://github.com/kubernetes/kubernetes/pull/62667, that I closed by error 😥

**Release note**:
```release-note
NONE
```
Nb. first https://github.com/kubernetes/kubernetes/pull/62667 already has the release note
2018-04-23 16:42:06 -07:00
Kubernetes Submit Queue a0f9412361
Merge pull request #62810 from liggitt/request-mapper
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove request context mapper

http.Request now allows setting/retrieving a per-request context, which removes the need for plumbing a request-context mapper throughout the stack

In addition to being way simpler, this has the benefit of removing a potentially contentious lock object from the handling path

This PR:
* removes RequestContextMapper
* converts context fetchers to use `req.Context()`
* converts context setters to use `req = req.WithContext(...)`
* updates filter plumbing in two places (audit and timeout) to properly return the request with modified context
* updates tests that used a fake context mapper to set the context in the request instead

Fixes https://github.com/kubernetes/kubernetes/issues/62796

```release-note
NONE
```
2018-04-23 13:01:14 -07:00
Bobby (Babak) Salamat a073dfdbd9 Fix scheduler Pod informers to receive events when pods are scheduled by other schedulers. 2018-04-23 11:07:53 -07:00
Chuck Ha 3cbb283306
Bump kube-dns version for kubeadm upgrade
Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-04-23 17:24:34 +01:00
Di Xu de6544b0fa add warnings on using pod-infra-container-image for remote container runtime 2018-04-23 11:29:18 +08:00
Davanum Srinivas 2f98d7a3ea Support nsenter in non-systemd environments
In our CI, we run kubekins image for most of the jobs. This is a
debian image with upstart and does not enable systemd. So we should:

* Bailout if any binary is missing other than systemd-run.
* SupportsSystemd should check the binary path to correctly
  identify if the systemd-run is present or not
* Pass the errors back to the callers so kubelet is forced to
  fail early when there is a problem. We currently assume
  that all binaries are in the root directory by default which
  is wrong.
2018-04-22 22:10:36 -04:00
fabriziopandini 8f838d9e42 autogenerated files 2018-04-23 00:16:30 +02:00
fabriziopandini 8abc54d257 make API.ControlPlaneEndpoint accept IP 2018-04-23 00:16:13 +02:00
leigh schrandt 3b45b021ee [kubeadm] Implement ReadStaticPodFromDisk 2018-04-20 18:32:04 -06:00
Jason DeTiberus d55d1b6fbe [kubeadm] fix mirror-pod hash race condition
- Update kubeadm static pod upgrades to use the
  kubetypes.ConfigHashAnnotationKey annotation on the mirror pod rather
  than generating a hash from the full object info. Previously, a status
  update for the pod would allow the upgrade to proceed before the
  new static pod manifest was actually deployed.

Signed-off-by: Jason DeTiberus <detiber@gmail.com>
2018-04-20 18:32:03 -06:00
Kubernetes Submit Queue 663c6edc46
Merge pull request #61324 from pospispa/60764-K8s-1.10-StorageObjectInUseProtection-downgrade-issue
Automatic merge from submit-queue (batch tested with PRs 61324, 62880, 62765). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Always Start pvc-protection-controller and pv-protection-controller

**What this PR does / why we need it**:
After K8s 1.10 is upgraded to K8s 1.11 finalizer `[kubernetes.io/pvc-protection]` is added to PVCs
because `StorageObjectInUseProtection` feature will be GA in K8s 1.11.
However, when K8s 1.11 is downgraded to K8s 1.10 and the `StorageObjectInUseProtection` feature is disabled the finalizers remain in the PVCs and as `pvc-protection-controller` is not started in K8s 1.10 finalizers are not removed automatically from deleted PVCs and that's why deleted PVC are not removed from the system but remain in `Terminating` phase.
The same applies to `pv-protection-controller` and `[kubernetes.io/pvc-protection]` finalizer in PVs.

That's why `pvc-protection-controller` is always started because the `pvc-protection-controller` removes finalizers from PVCs automatically when a PVC is not in active use by a pod.
Also the `pv-protection-controller` is always started to remove finalizers from PVs automatically when a PV is not `Bound` to a PVC.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes N/A
This issue https://github.com/kubernetes/kubernetes/issues/60764 is for downgrade from K8s 1.10 to K8s 1.9.
This PR fixes the same problem but for downgrade from K8s 1.11 to K8s 1.10.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-20 17:23:17 -07:00
Kubernetes Submit Queue 9c25da64f0
Merge pull request #62649 from liggitt/loopback-routing
Automatic merge from submit-queue (batch tested with PRs 50899, 62649). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ensure webhook service routing resolves kubernetes.default.svc correctly

Going through the normal endpoint resolve path isn't correct in multi-master scenarios

The auth wrapper is pulling from LoopbackClientConfig, the service resolver should do the same

```release-note
Fixes the kubernetes.default.svc loopback service resolution to use a loopback configuration.
```
2018-04-20 15:34:12 -07:00
Pavel Pospisil d3ddf7eb8b Always Start pvc-protection-controller and pv-protection-controller
After K8s 1.10 is upgraded to K8s 1.11 finalizer [kubernetes.io/pvc-protection] is added to PVCs
because StorageObjectInUseProtection feature will be GA in K8s 1.11.
However, when K8s 1.11 is downgraded to K8s 1.10 and the StorageObjectInUseProtection feature is disabled
the finalizers remain in the PVCs and as pvc-protection-controller is not started in K8s 1.10 finalizers
are not removed automatically from deleted PVCs and that's why deleted PVC are not removed from the system
but remain in Terminating phase.
The same applies to pv-protection-controller and [kubernetes.io/pvc-protection] finalizer in PVs.

That's why pvc-protection-controller is always started because the pvc-protection-controller removes finalizers
from PVCs automatically when a PVC is not in active use by a pod.
Also the pv-protection-controller is always started to remove finalizers from PVs automatically when a PV is not
Bound to a PVC.

Related issue: https://github.com/kubernetes/kubernetes/issues/60764
2018-04-20 19:54:50 +02:00
Jordan Liggitt fe23fa3eee
Ensure service routing resolves kubernetes.default.svc correctly 2018-04-20 12:26:38 -04:00
Kubernetes Submit Queue e9374411d5
Merge pull request #62509 from sjenning/qos-reserved-feature-gate
Automatic merge from submit-queue (batch tested with PRs 61962, 58972, 62509, 62606). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: move QOSReserved from experimental to alpha feature gate

Fixes https://github.com/kubernetes/kubernetes/issues/61665

**Release note**:
```release-note
The --experimental-qos-reserve kubelet flags is replaced by the alpha level --qos-reserved flag or QOSReserved field in the kubeletconfig and requires the QOSReserved feature gate to be enabled.
```

/sig node
/assign  @derekwaynecarr 
/cc @mtaufen
2018-04-19 16:47:21 -07:00
Kubernetes Submit Queue 1e39d68ecb
Merge pull request #62243 from resouer/fix-62068
Automatic merge from submit-queue (batch tested with PRs 59592, 62308, 62523, 62635, 62243). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Separate pod priority from preemption

**What this PR does / why we need it**:
Users request to split priority and preemption feature gate so they can use priority separately.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62068 

**Special notes for your reviewer**:

~~I kept use `ENABLE_POD_PRIORITY` as ENV name for gce cluster scripts for backward compatibility reason. Please let me know if other approach is preffered.~~

~~This is a potential **break change** as existing clusters will be affected, we may need to include this in 1.11 maybe?~~

TODO: update this doc https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/

[Update] Usage: in config file for scheduler:
```yaml
apiVersion: componentconfig/v1alpha1
kind: KubeSchedulerConfiguration
...
disablePreemption: true
```

**Release note**:

```release-note
Split PodPriority and PodPreemption feature gate
```
2018-04-19 14:50:27 -07:00
Kubernetes Submit Queue 500b63aed6
Merge pull request #62726 from xiangpengzhao/kubeadm-json-name
Automatic merge from submit-queue (batch tested with PRs 62726, 60085, 62583). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Refactor kubeadm api validation.

**What this PR does / why we need it**:
This PR refactor kubeadm api validation to use field json name. When users get a validation error, they can easily know which field is invalid in their config files.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
@fabriziopandini I remember we mentioned this refactoring in some comment. I didn't see this change was done, so I send this PR to address this.

**Release note**:

```release-note
NONE
```
2018-04-19 11:00:13 -07:00
Kubernetes Submit Queue 9931a60630
Merge pull request #62632 from xiangpengzhao/fix-gc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix garbled code in kubeadm output

**What this PR does / why we need it**:
This fixes the garbled code:
![image](https://user-images.githubusercontent.com/15881573/38799293-afa3f392-4196-11e8-88c4-a0783a288f7e.png)

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-19 08:39:58 -07:00
Kubernetes Submit Queue 088c6a7ac1
Merge pull request #62815 from timothysc/upgrade_message
Automatic merge from submit-queue (batch tested with PRs 62781, 62815). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update kubeadm upgrade message

**What this PR does / why we need it**:
Updates kubeadm upgrade message per user request

**Which issue(s) this PR fixes**:
Fixes https://github.com/kubernetes/kubeadm/issues/672


**Special notes for your reviewer**:
none

**Release note**:

```
NONE
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews @kargakis
2018-04-19 01:25:06 -07:00