Commit Graph

21492 Commits (d02f40a5e725d70f59e9f9e96b22ddad5c0426f7)

Author SHA1 Message Date
Chao Xu ab3e7a73ec validation of subresources 2017-05-31 15:20:22 -07:00
ymqytw c3481b07d2 support setElementOrder 2017-05-31 15:08:25 -07:00
Chao Xu 5e0e8bfa22 fix flake 2017-05-31 14:07:40 -07:00
mtanino aebaee39d5 Log out from multiple portals with iscsi storage plugin
When using iscsi storage with multiple target portal (TP)
addresses and multipathing the volume manager logs on to
the IQN for all portal addresses, but when a pod gets
destroyed the volume manager only logs out for the primary
TP and sessions for another TPs are always remained.

This patch adds methods to store and load iscsi disk
configrations, then uses the stored config at DetachDisk
path.

Fix #45394
2017-05-31 16:53:47 -04:00
Derek Carr 6207e19fb8 Fix cross-compile error 2017-05-31 16:10:22 -04:00
Jing Xu 695f7be697 generated files 2017-05-31 13:06:39 -07:00
Jing Xu 85f030c2aa Add storage isolation API
This PR adds the new APIs to support storage capacity isolation as described in the proposal
https://github.com/kubernetes/community/pull/306

1. Add SizeLimit for emptyDir volume
2. Add scratch and overlay storage type used by container level or
node level
2017-05-31 12:26:04 -07:00
Jeremy Whitlock 5375bc0cc8 add generated sources for admission API group "install" package 2017-05-31 11:41:10 -07:00
Jeremy Whitlock 83d3d59ce0 add "install" package for admission API group
To properly register the types in the admission API group we need to
create an "install" package and wire it up.  This is required by the
webhook admission controller being developed as part of
https://github.com/kubernetes/community/pull/132
2017-05-31 11:41:10 -07:00
Chao Xu ec787db460 generated 2017-05-31 09:57:20 -07:00
Derek Carr 18bf8f8616 redudant if-block in validation code 2017-05-31 12:08:52 -04:00
deads2k 954eb3ceb9 move labels to components which own the APIs 2017-05-31 10:32:06 -04:00
NickrenREN e62bdf82da Extract volume relevant events reason
Extract volume relevant events reason and make them const
2017-05-31 22:11:36 +08:00
Cao Shufeng fb8d78bec9 add some unit tests for "kubectl create clusterrole" 2017-05-31 17:43:15 +08:00
Kubernetes Submit Queue f0962765a7 Merge pull request #46182 from FengyunPan/check_detach
Automatic merge from submit-queue

Check volume's status before detaching volume

When volume's status is 'detaching', controllermanager will detach
it again and return err. It is necessary to check volume's status
before detaching volume.

same issue: #44536
2017-05-31 02:40:45 -07:00
Guangya Liu 3402443874 Added a new test case for daemoncontroller.
This patch added a new test case of daemonSet with node selector,
matching some nodes, and launch pods on all the nodes.
2017-05-31 17:14:02 +08:00
Shyam Jeedigunta 1cf6b339f6 Use TTL-based caching configmap manager in kubelet 2017-05-31 10:39:40 +02:00
Shyam Jeedigunta 4425864707 Migrate kubelet configmap management logic to an interface 2017-05-31 10:39:36 +02:00
Kubernetes Submit Queue 91cef78f43 Merge pull request #46640 from derekwaynecarr/active-deadline-seconds-fix
Automatic merge from submit-queue (batch tested with PRs 46661, 46562, 46657, 46655, 46640)

Improve validation of active deadline seconds

**What this PR does / why we need it**:
Improve validation of active deadline seconds to not allow it to be larger than max uint32.

If users choose a value that is too large, the conversion of that value to a duration in seconds can cause an overflow.  I see no practical benefit of having a value larger than uint32 at this time.

xref: https://bugzilla.redhat.com/show_bug.cgi?id=1456156

**Release note**:
```release-note
Restrict active deadline seconds max allowed value to be maximum uint32
```
2017-05-31 01:08:11 -07:00
Kubernetes Submit Queue c7e0e50495 Merge pull request #46655 from janetkuo/controllerrevision-printer
Automatic merge from submit-queue (batch tested with PRs 46661, 46562, 46657, 46655, 46640)

Implement kubectl get controllerrevisions

Before:
```console
$ kubectl get controllerrevisions 
error: unknown type &apps.ControllerRevision{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{....}...}
```
After:
```console
$ kubectl get controllerrevisions 
NAME          CONTROLLER       REVISION   AGE
foo-2312378   DaemonSet/foo    1          2d
```

**Release note**:

```release-note
```

@kubernetes/sig-apps-pr-reviews @kubernetes/sig-cli-maintainers
2017-05-31 01:08:07 -07:00
Kubernetes Submit Queue 50c6a38c1e Merge pull request #46562 from dixudx/volume_manager_function_format
Automatic merge from submit-queue (batch tested with PRs 46661, 46562, 46657, 46655, 46640)

remove redundant carriage return for readable

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

remove redundant carriage to make it more readable.
2017-05-31 01:08:01 -07:00
Waseem Ahmad 8442a118ea Denote if a printer is generic.
This fixes #38779.

This allows us to avoid case in which printers.GetStandardPrinter
returns nil for both printer and err removing any potential panics that
may arise throughout kubectl commands.

Please see #38779 and #38112 for complete context.

Add comment explaining adding handlers to printers.HumanReadablePrinter
also remove an unnecessary conversion of printers.HumanReadablePrinter
to printers.ResourcePrinter.
2017-05-31 13:02:23 +05:30
Tomas Nozicka 9ed01e44a1 Fix standardFinalizers - add missing metav1.FinalizerDeleteDependents 2017-05-31 09:21:02 +02:00
Kubernetes Submit Queue 77a8c25839 Merge pull request #46212 from CaoShuFeng/RBACSuperUser
Automatic merge from submit-queue (batch tested with PRs 46394, 46650, 46436, 46673, 46212)

Remove deprecated variable RBACSuperUser

authorization-rbac-super-user is deprecated now. So we can remove
the vaiable. Further more the comment about this variable is wrong.
Remove them also.

**Release note**:
```NONE
```
2017-05-31 00:14:11 -07:00
Kubernetes Submit Queue 4f9e371834 Merge pull request #46673 from dixudx/fix_typo_in_componentconfig_types
Automatic merge from submit-queue (batch tested with PRs 46394, 46650, 46436, 46673, 46212)

fix typos in pkg/apis/componentconfig/types.go

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

fix several typos in `pkg/apis/componentconfig/types.go`
2017-05-31 00:14:09 -07:00
Kubernetes Submit Queue 0ff75d74d3 Merge pull request #46436 from rootfs/openstack-client
Automatic merge from submit-queue (batch tested with PRs 46394, 46650, 46436, 46673, 46212)

refactor and export openstack service clients

**What this PR does / why we need it**:
Refactor and export openstack service client.
Exporting OpenStack client so other projects can use the them to call functions that are not implemented in openstack cloud providers yet.

**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**:

```release-note
NONE
```
2017-05-31 00:14:07 -07:00
Kubernetes Submit Queue 9c7b59778c Merge pull request #46394 from alexandercampbell/write-help-messages-to-stdout
Automatic merge from submit-queue (batch tested with PRs 46394, 46650, 46436, 46673, 46212)

Write "kubectl options" help message to stdout, not stderr

Fix a very minor issue causing `kubectl` to write its help messages to `stderr` instead of `stdout`.

Try this:

`kubectl options | grep log`

It should print only the options related to logging, but right now it prints the entire help menu (since it's printing to stderr).

This patch brings us closer to unix convention and reduces user friction.

~~Another use case (if a user can't remember whether it's `-r` or `-R` for recursion):~~

~~`kubectl patch -h | grep recursive`~~

Update: this patch only affects `kubectl options`. The other commands are working as intended.

**Release note**:

```release-note
NONE
```
2017-05-31 00:14:00 -07:00
Kubernetes Submit Queue 154b816a90 Merge pull request #46654 from yujuhong/reduce-log-spam
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

kubelet status manager: short-circut the evaluation if possible

This avoids redundant checks in the `PodResourcesAreReclaimed`, which
also logs misleading "Pod is terminated" messages on every check

/cc @kubernetes/sig-node-pr-reviews
2017-05-30 23:20:06 -07:00
Kubernetes Submit Queue e97b72296f Merge pull request #46556 from mbohlool/gvk
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Use meta.v1 GroupVersionKind with json tags to generate OpenAPI spec

We are using two different GVK struct in generation of OpenAPI extensions. This PR unify that and also add json tags to meta.v1 GVK to comply with json naming system in other serializations. Also the value of Action extension is now lowercase.

ref: https://github.com/kubernetes/kubernetes/pull/46388
2017-05-30 23:20:04 -07:00
Kubernetes Submit Queue 0aad9d30e3 Merge pull request #44897 from msau42/local-storage-plugin
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Local storage plugin

**What this PR does / why we need it**:
Volume plugin implementation for local persistent volumes.  Scheduler predicate will direct already-bound PVCs to the node that the local PV is at.  PVC binding still happens independently.

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

**Release note**:

```
Alpha feature: Local volume plugin allows local directories to be created and consumed as a Persistent Volume.  These volumes have node affinity and pods will only be scheduled to the node that the volume is at.
```
2017-05-30 23:20:02 -07:00
Kubernetes Submit Queue 3702352aa9 Merge pull request #43879 from dcbw/fix-up-runtime-GetNetNS
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

kubelet/network: report but tolerate errors returned from GetNetNS()

Runtimes should never return "" and nil errors, since network plugin
drivers need to treat netns differently in different cases.  So return
errors when we can't get the netns, and fix up the plugins to do the
right thing.

Namely, we don't need a NetNS on pod network teardown.  We do need
a netns for pod Status checks and for network setup.

@kubernetes/rh-networking @kubernetes/sig-network-bugs @DirectXMan12
2017-05-30 23:19:59 -07:00
zhengjiajin 7c362f2f65 unit test for create cluster 2017-05-31 14:19:12 +08:00
Kubernetes Submit Queue 5995690396 Merge pull request #46076 from liggitt/node-authorizer
Automatic merge from submit-queue

Node authorizer

This PR implements the authorization portion of https://github.com/kubernetes/community/blob/master/contributors/design-proposals/kubelet-authorizer.md and kubernetes/features#279:
* Adds a new authorization mode (`Node`) that authorizes requests from nodes based on a graph of related pods,secrets,configmaps,pvcs, and pvs:
  * Watches pods, adds edges (secret -> pod, configmap -> pod, pvc -> pod, pod -> node)
  * Watches pvs, adds edges (secret -> pv, pv -> pvc)
  * When both Node and RBAC authorization modes are enabled, the default RBAC binding that grants the `system:node` role to the `system:nodes` group is not automatically created.
* Tightens the `NodeRestriction` admission plugin to require identifiable nodes for requests from users in the `system:nodes` group.

This authorization mode is intended to be used in combination with the `NodeRestriction` admission plugin, which limits the pods and nodes a node may modify. To enable in combination with RBAC authorization and the NodeRestriction admission plugin:
* start the API server with `--authorization-mode=Node,RBAC --admission-control=...,NodeRestriction,...`
* start kubelets with TLS boostrapping or with client credentials that place them in the `system:nodes` group with a username of `system:node:<nodeName>`

```release-note
kube-apiserver: a new authorization mode (`--authorization-mode=Node`) authorizes nodes to access secrets, configmaps, persistent volume claims and persistent volumes related to their pods.
* Nodes must use client credentials that place them in the `system:nodes` group with a username of `system:node:<nodeName>` in order to be authorized by the node authorizer (the credentials obtained by the kubelet via TLS bootstrapping satisfy these requirements)
* When used in combination with the `RBAC` authorization mode (`--authorization-mode=Node,RBAC`), the `system:node` role is no longer automatically granted to the `system:nodes` group.
```

```release-note
RBAC: the automatic binding of the `system:node` role to the `system:nodes` group is deprecated and will not be created in future releases. It is recommended that nodes be authorized using the new `Node` authorization mode instead. Installations that wish to continue giving all members of the `system:nodes` group the `system:node` role (which grants broad read access, including all secrets and configmaps) must create an installation-specific ClusterRoleBinding.
```

Follow-up:
- [ ] enable e2e CI environment with admission and authorizer enabled (blocked by kubelet TLS bootstrapping enablement in https://github.com/kubernetes/kubernetes/pull/40760)
- [ ] optionally enable this authorizer and admission plugin in kubeadm
- [ ] optionally enable this authorizer and admission plugin in kube-up
2017-05-30 22:42:54 -07:00
Cao Shufeng 3bf3a031e8 This change add nonResourceURL to kubectl auth cani 2017-05-31 11:25:29 +08:00
Di Xu 96b6577456 fix typos in pkg/apis/componentconfig/types.go 2017-05-31 11:21:04 +08:00
xiangpengzhao 4ec3fc4e2a Fix selfLinks of pods started from manifests 2017-05-31 11:11:59 +08:00
Kubernetes Submit Queue f2074ba8de Merge pull request #45059 from jcbsmpsn/rotate-server-certificate
Automatic merge from submit-queue (batch tested with PRs 46635, 45619, 46637, 45059, 46415)

Certificate rotation for kubelet server certs.

Replaces the current kubelet server side self signed certs with certs signed by
the Certificate Request Signing API on the API server. Also renews expiring
kubelet server certs as expiration approaches.

Two Points:
1. With `--feature-gates=RotateKubeletServerCertificate=true` set, the kubelet will
    request a certificate during the boot cycle and pause waiting for the request to
    be satisfied.
2. In order to have the kubelet's certificate signing request auto approved,
    `--insecure-experimental-approve-all-kubelet-csrs-for-group=` must be set on
    the cluster controller manager. There is an improved mechanism for auto
    approval [proposed](https://github.com/kubernetes/kubernetes/issues/45030).

**Release note**:
```release-note
With `--feature-gates=RotateKubeletServerCertificate=true` set, the kubelet will
request a server certificate from the API server during the boot cycle and pause
waiting for the request to be satisfied. It will continually refresh the certificate as
the certificates expiration approaches.
```
2017-05-30 19:49:02 -07:00
Kubernetes Submit Queue cb6be1eb06 Merge pull request #46637 from mtaufen/fix-nodecontroller-log
Automatic merge from submit-queue (batch tested with PRs 46635, 45619, 46637, 45059, 46415)

fix a comment and log message in the nodecontroller

I was poking around in the nodecontroller code and this looked wrong.
2017-05-30 19:49:00 -07:00
Kubernetes Submit Queue 4e531f615d Merge pull request #45619 from mikedanese/cert-sar
Automatic merge from submit-queue (batch tested with PRs 46635, 45619, 46637, 45059, 46415)

migrate group approver to use subject access reviews

WIP, needs test and changes to kubeadm

depends on https://github.com/kubernetes/kubernetes/pull/45514
2017-05-30 19:48:57 -07:00
Chao Xu 134535032c nonnamespaced tag 2017-05-30 19:20:08 -07:00
Kubernetes Submit Queue 390f210366 Merge pull request #46628 from derekwaynecarr/scope-unit-test
Automatic merge from submit-queue (batch tested with PRs 44061, 46614, 46419, 46628, 46134)

cleanup kubelet new node status test

**What this PR does / why we need it**:
this scopes the test to just testing allocatable values.  extra parts of the original test were copied from another test that was not relevant.
2017-05-30 18:35:01 -07:00
Kubernetes Submit Queue 7ed0426041 Merge pull request #46614 from humblec/glusterfs-umount-clean
Automatic merge from submit-queue (batch tested with PRs 44061, 46614, 46419, 46628, 46134)

Remove glusterfs fuse client mount library version check for `auto_unmount` mount option.
2017-05-30 18:34:56 -07:00
Janet Kuo 80af0012f5 Implement kubectl get controllerrevisions 2017-05-30 18:15:26 -07:00
Kubernetes Submit Queue da5edc11f3 Merge pull request #44061 from yujuhong/docker_flags
Automatic merge from submit-queue

kubelet: group all container-runtime-specific flags/options into a separate struct

They don't belong in the KubeletConfig.

This addresses #43253
2017-05-30 17:43:52 -07:00
Huamin Chen 4d4bdf11de refactor and export openstack service clients
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-05-31 00:36:33 +00:00
divyenpatel 85dcf6d52c Adding vsphere Storage API Latency and Error Metrics support
fix bazel failure
2017-05-30 16:54:30 -07:00
FengyunPan 300f531389 Wait for detach operation to complete
When volume's status is 'detaching', controllermanager will detach
it again and return err. It is necessary to wait for detach
operation to complete within the alloted time.
2017-05-31 07:52:15 +08:00
Kubernetes Submit Queue e0a6cde6f4 Merge pull request #46647 from mikedanese/kubelet-certs-approver
Automatic merge from submit-queue

add myself and liggitt to pkg/kubelet/certificats OWNERs

For as long a kubelet is using the internal client, this certificate
manager is bound to the kubelet. Once kubelet has moved to client-go we
plan to extract this library to be general purpose. In the meantime,
liggitt and I should handle reviews of this code.

@liggitt @timstclair
2017-05-30 16:41:55 -07:00
Yu-Ju Hong ccfecb1ebd kubelet status manager: short-circut the evaluation if possible
This avoids redundant checks in the `PodResourcesAreReclaimed`, which
also logs misleading "Pod is terminated" messages on every check.
2017-05-30 15:58:40 -07:00
Kubernetes Submit Queue b0c3fb16ca Merge pull request #46412 from zjj2wry/va-test
Automatic merge from submit-queue

add test in validation

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

**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**:

```release-note
NONE
```
2017-05-30 15:43:21 -07:00
Mike Danese 5920e48333 add myself and liggitt to pkg/kubelet/certificats OWNERs
For as long a kubelet is using the internal client, this certificate
manager is bound to the kubelet. Once kubelet has moved to client-go we
plan to extract this library to be general purpose. In the meantime,
liggitt and I should handle reviews of this code.
2017-05-30 15:07:02 -07:00
Kubernetes Submit Queue f7215b7cdf Merge pull request #45755 from ahmetb/set-context-differentiate
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

Differentiate update/create message on set-context
2017-05-30 14:57:07 -07:00
Kubernetes Submit Queue 8c1f45953b Merge pull request #46431 from zjj2wry/rollback-rollback
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

Fix api description in swagger

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

**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**:

```release-note
 NONE
```
2017-05-30 14:57:05 -07:00
Kubernetes Submit Queue e9b92c8094 Merge pull request #46154 from jcbsmpsn/improve-certificate-manager-waiting
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

Attempt certificate rotation as expiration approaches.
2017-05-30 14:57:02 -07:00
Kubernetes Submit Queue 001513e9d0 Merge pull request #46100 from zjj2wry/hh
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

clean up: put test description in head to clear

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

**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**:

```release-note
```
2017-05-30 14:56:59 -07:00
mbohlool a3cbfde4b1 Make OpenAPI GVK and Action extensions all lower-case 2017-05-30 14:43:27 -07:00
Jordan Liggitt fc8e915a4b
Add Node authorization mode based on graph of node-related objects 2017-05-30 16:53:03 -04:00
Jordan Liggitt 48a9357926
Add PV util for extracting referenced secrets 2017-05-30 15:12:30 -04:00
Kubernetes Submit Queue b5eadb5d6b Merge pull request #43946 from jhorwit2/jah/host-path-psp
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

Allow PSP's to specify a whitelist of allowed paths for host volume

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

This PR adds the ability to whitelist paths for the host volume to ensure pods cannot access directories they aren't supposed to. E.g. `/var/lib/kubelet`, `/etc/kubernetes/*`, etc. 

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


**Special notes for your reviewer**:

**Release note**:

```release-note
Allow PSP's to specify a whitelist of allowed paths for host volume based on path prefixes
```
2017-05-30 11:59:10 -07:00
Kubernetes Submit Queue 1889d654f5 Merge pull request #46114 from arthur0/rename_context
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

Add `kubectl config rename-context`

Add `kubectl config rename-context`

This command allows renaming a context, instead of editing manually in .kubeconfig

Fix https://github.com/kubernetes/kubernetes/issues/45131

```release-note
Add `kubectl config rename-context`
```
2017-05-30 11:59:07 -07:00
Kubernetes Submit Queue 222d247489 Merge pull request #46463 from wongma7/getinstances
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

AWS: consider instances of all states in DisksAreAttached, not just "running"

Require callers of `getInstancesByNodeNames(Cached)` to specify the states they want to filter instances by, if any. DisksAreAttached, cannot only get "running" instances because of the following attach/detach bug we discovered:

1. Node A stops (or reboots) and stays down for x amount of time
2. Kube reschedules all pods to different nodes; the ones using ebs volumes cannot run because their volumes are still attached to node A
3. Verify volumes are attached check happens while node A is down
4. Since aws ebs bulk verify filters by running nodes, it assumes the volumes attached to node A are detached and removes them all from ASW
5. Node A comes back; its volumes are still attached to it but the attach detach controller has removed them all from asw and so will never detach them even though they are no longer desired on this node and in fact desired elsewhere
6. Pods cannot run because their volumes are still attached to node A

So the idea here is to remove the wrong assumption that callers of `getInstancesByNodeNames(Cached)` only want "running" nodes.

I hope this isn't too confusing, open to alternative ways of fixing the bug + making the code nice.

ping @gnufied @kubernetes/sig-storage-bugs

```release-note
Fix AWS EBS volumes not getting detached from node if routine to verify volumes are attached runs while the node is down
```
2017-05-30 11:59:04 -07:00
Kubernetes Submit Queue 69c4a8ff0c Merge pull request #46281 from zjj2wry/err
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

add error info

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

**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**:

```release-note
NONE
```
2017-05-30 11:59:02 -07:00
Derek Carr 9d412210e9 Active deadline seconds validation improvements 2017-05-30 14:57:06 -04:00
Mike Danese 66b4b99616 migrate group approver to use subject access reviews 2017-05-30 11:43:03 -07:00
Michael Taufen f848756cff fix a comment and log message in the nodecontroller 2017-05-30 11:32:43 -07:00
Kubernetes Submit Queue a07298ce54 Merge pull request #46608 from fabianofranz/fixes_kubectl_cache_on_windows
Automatic merge from submit-queue (batch tested with PRs 46552, 46608, 46390, 46605, 46459)

Fixes kubectl cached discovery on Windows

Fixes https://github.com/kubernetes/kubectl/issues/18

The `kubectl` cached discovery makes use of `func (f *File) Chmod(mode FileMode) error` which is not supported and errors out on Windows, making `kubectl get` and potentially a number of other commands to fail miserably on that platform. `os.Chmod` by file name, on the other hand, does not error out and should be used instead.

**Release note**:

```release-note
NONE
```
@deads2k @brendandburns @kubernetes/sig-cli-pr-reviews
2017-05-30 08:41:54 -07:00
Yu-Ju Hong c82350214e Group container-runtime-specific flags/options together
Do not store them in kubelet's configuration. Eventually, we would like
to deprecate all these flags as they should not be part of kubelet.
2017-05-30 08:10:39 -07:00
Derek Carr 9da6cee161 cleanup kubelet new node status test 2017-05-30 11:08:31 -04:00
Kubernetes Submit Queue 93704942ad Merge pull request #46488 from ailusazh/FixTypoInTaintContainer
Automatic merge from submit-queue (batch tested with PRs 43275, 45014, 46449, 46488, 46525)

fix typo in taint_controller

**What this PR does / why we need it**:
fix typo in taint_controller

**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**:
2017-05-30 07:49:07 -07:00
Kubernetes Submit Queue 9aa9fb0cfd Merge pull request #45014 from CaoShuFeng/unit_for_freed_image_size
Automatic merge from submit-queue (batch tested with PRs 43275, 45014, 46449, 46488, 46525)

add unit for freed image size

**Release note**:

```release-note
NONE
```
2017-05-30 07:49:03 -07:00
Kubernetes Submit Queue 28996ac6c3 Merge pull request #43275 from lvjiangzhao/fix-typo-170317
Automatic merge from submit-queue (batch tested with PRs 43275, 45014, 46449, 46488, 46525)

Fix typo

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

**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**:

```release-note
```
2017-05-30 07:49:00 -07:00
Kubernetes Submit Queue 20ec8912d0 Merge pull request #45421 from allencloud/change-to-use-make-slice-to-store-objects
Automatic merge from submit-queue

use make slice to store objects to improve efficiency

Signed-off-by: allencloud <allen.sun@daocloud.io>



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

we we know the slice length in advance, I think we had better use make to create the specified length of slice. This will improve some kind of performance. Since if we create a slice with []type{}, we did not know how much space runtime should reserve, since slice implementation should be continuous in memory. While when we make a slice with specified length, runtime would reserve a continuous memory space which will not result in slice movement in case of current space is not enough.

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2017-05-30 06:27:18 -07:00
Kubernetes Submit Queue 2f498065d7 Merge pull request #46535 from yujuhong/rm-redundant-check
Automatic merge from submit-queue

kubelet: remove a redundant check for mounting the hosts file

HostNetwork is not part of the Pod.Spec.SecurityContext in the versioned
pod. Remove the redundant check.

See https://github.com/kubernetes/kubernetes/issues/43632#issuecomment-304370330 for the explanation.
2017-05-30 05:40:34 -07:00
Kubernetes Submit Queue 0f95f13dcc Merge pull request #46350 from wojtek-t/reduce_kube_proxy_allocations_2
Automatic merge from submit-queue (batch tested with PRs 45534, 37212, 46613, 46350)

Speed up and reduce number of memory allocations in kube-proxy

This is a second (and last PR) in this series - this solves all very-low-hanging fruits.

This PR:
- reduces cpu usage by ~25%
- reduces memory allocations by ~3x (together with #46033 by 10-12x)

Without this PR:
```
(pprof) top
8.59GB of 8.79GB total (97.75%)
Dropped 238 nodes (cum <= 0.04GB)
Showing top 10 nodes out of 64 (cum >= 0.11GB)
      flat  flat%   sum%        cum   cum%
    3.66GB 41.60% 41.60%     8.72GB 99.17%  k8s.io/kubernetes/pkg/proxy/iptables.(*Proxier).syncProxyRules
    3.07GB 34.96% 76.56%     3.07GB 34.96%  runtime.rawstringtmp
    0.62GB  7.09% 83.65%     0.62GB  7.09%  runtime.hashGrow
    0.34GB  3.82% 87.46%     0.34GB  3.82%  runtime.stringtoslicebyte
    0.29GB  3.24% 90.71%     0.58GB  6.61%  encoding/base32.(*Encoding).EncodeToString
    0.22GB  2.47% 93.18%     0.22GB  2.47%  strings.genSplit
    0.18GB  2.04% 95.22%     0.18GB  2.04%  runtime.convT2E
    0.11GB  1.22% 96.44%     0.73GB  8.36%  runtime.mapassign
    0.10GB  1.08% 97.52%     0.10GB  1.08%  syscall.ByteSliceFromString
    0.02GB  0.23% 97.75%     0.11GB  1.25%  syscall.SlicePtrFromStrings
```

with this PR:
```
(pprof) top
2.98GB of 3.08GB total (96.78%)
Dropped 246 nodes (cum <= 0.02GB)
Showing top 10 nodes out of 70 (cum >= 0.10GB)
      flat  flat%   sum%        cum   cum%
    1.99GB 64.60% 64.60%     1.99GB 64.60%  runtime.rawstringtmp
    0.58GB 18.95% 83.55%     0.58GB 18.95%  runtime.hashGrow
    0.10GB  3.40% 86.95%     0.69GB 22.47%  runtime.mapassign
    0.09GB  2.86% 89.80%     0.09GB  2.86%  syscall.ByteSliceFromString
    0.08GB  2.63% 92.44%     0.08GB  2.63%  runtime.convT2E
    0.03GB  1.13% 93.56%     0.03GB  1.13%  syscall.Environ
    0.03GB  0.99% 94.56%     0.03GB  0.99%  bytes.makeSlice
    0.03GB  0.97% 95.52%     0.03GB  1.06%  os.Stat
    0.02GB  0.65% 96.18%     3.01GB 97.79%  k8s.io/kubernetes/pkg/proxy/iptables.(*Proxier).syncProxyRules
    0.02GB   0.6% 96.78%     0.10GB  3.35%  syscall.SlicePtrFromStrings
```
2017-05-30 04:46:06 -07:00
Kubernetes Submit Queue 4979ae4b86 Merge pull request #46074 from zjj2wry/set-image
Automatic merge from submit-queue (batch tested with PRs 45488, 45335, 45909, 46074, 46615)

add test for set image validation

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

**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**:

```release-note
```
2017-05-30 03:47:02 -07:00
Kubernetes Submit Queue 8caffc300e Merge pull request #45909 from zhangxiaoyu-zidif/add-unittest-for-configmap
Automatic merge from submit-queue (batch tested with PRs 45488, 45335, 45909, 46074, 46615)

Add Unit Test:describe configmap

**What this PR does / why we need it**:
Add Unit Test:describe configmap

**Release note**:

```release-note
NONE
```
2017-05-30 03:46:59 -07:00
Kubernetes Submit Queue 49b0fe17c9 Merge pull request #45335 from zhangxiaoyu-zidif/fix-goerrors-new
Automatic merge from submit-queue (batch tested with PRs 45488, 45335, 45909, 46074, 46615)

fmt.Errorf replaces errors

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

fmt.Errorf replaces errors
importing errors is redundant.

**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**:

```release-note
NONE
```
2017-05-30 03:46:57 -07:00
Kubernetes Submit Queue d1e221960e Merge pull request #45488 from bboreham/eviction-log-format
Automatic merge from submit-queue (batch tested with PRs 45488, 45335, 45909, 46074, 46615)

Fix screwed-up log message format

It had two %-verbs and three arguments

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

Fixes kubelet log lines like this:

    May 08 11:49:04 brya-1 kubelet[23248]: W0508 11:49:04.248123   23248 eviction_manager.go:128] Failed to admit pod kube-proxy-g3hjs_kube-system(55c1fbbb-33e4-11e7-b83c-42010a800002) - node has conditions: %v%!(EXTRA []v1.NodeConditionType=[MemoryPressure])

to remove the `%v%!(EXTRA`

**Release note**:
```release-note
NONE
```
2017-05-30 03:46:55 -07:00
Kubernetes Submit Queue b6c00aeb10 Merge pull request #46377 from noah8713/master
Automatic merge from submit-queue (batch tested with PRs 45327, 46217, 46377, 46428, 46588)

Fix comment typo in kube-apiserver and cachesize

**What this PR does / why we need it**:
Fix comment typo in files cmd/kube-apiserver/app/server.go and pkg/registry/cachesize/cachesize.go
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Not a major issue, just a minor improvement.
**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-30 01:56:03 -07:00
Kubernetes Submit Queue e9a2ddc87b Merge pull request #46217 from zjj2wry/validate
Automatic merge from submit-queue (batch tested with PRs 45327, 46217, 46377, 46428, 46588)

fix some typo

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

**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**:

```release-note
```
2017-05-30 01:56:00 -07:00
Wojciech Tyczynski 03c255d7c5 Store chain names to avoid recomputing them multiple times 2017-05-30 10:50:10 +02:00
Wojciech Tyczynski c4d51f12a2 Store port endpoint chain names to avoid recomputing it multiple times 2017-05-30 10:49:36 +02:00
Wojciech Tyczynski 88e3e8f470 Reuse args slice for generating iptable rules. 2017-05-30 10:49:35 +02:00
Wojciech Tyczynski 070f393bc8 Precompute probabilities in iptables kube-proxy. 2017-05-30 10:49:34 +02:00
Humble Chirammal 357cff5f11 Remove glusterfs fuse client mount library version check
for `auto_unmount` mount option.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-30 14:13:25 +05:30
Di Xu caeb584230 remove redundant carriage return (cont'd) 2017-05-30 16:29:21 +08:00
Kubernetes Submit Queue 4e3bd25a55 Merge pull request #46590 from yastij/disruption-getPodsForPdb
Automatic merge from submit-queue

avoiding unnecessary loop to copy pods listed

**What this PR does / why we need it**: avoids unnecessary loop to copy pods listed

**Which issue this PR fixes** : fixes #46433 

**Release note**:

```release-note
```
/assign @wojtek-t
2017-05-30 00:49:50 -07:00
Wojciech Tyczynski 1242e8ca20 Minor improvement for memory allocations 2017-05-30 08:11:12 +02:00
Clayton Coleman 7ce63eb608
Refactor printers to support rendering as a Table
Return tables from the server.
2017-05-29 18:30:10 -04:00
Kubernetes Submit Queue aee0ced31f Merge pull request #43585 from foolusion/add-health-check-node-port-to-aws-loadbalancer
Automatic merge from submit-queue

AWS: support node port health check

**What this PR does / why we need it**:
if a custom health check is set from the beta annotation on a service it
should be used for the ELB health check. This patch adds support for
that.
**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**:
Let me know if any tests need to be added.
**Release note**:

```release-note
```
2017-05-29 15:29:51 -07:00
Fabiano Franz 5c4da128c3 Fixes kubectl cached discovery on Windows 2017-05-29 17:52:00 -03:00
Jacob Simpson 93c9aded40 Attempt certificate rotation as expiration approaches. 2017-05-29 12:28:16 -07:00
Jacob Simpson 4c22e6bc6a Certificate rotation for kubelet server certs.
Replaces the current kubelet server side self signed certs with certs
signed by the Certificate Request Signing API on the API server. Also
renews expiring kubelet server certs as expiration approaches.
2017-05-29 12:28:01 -07:00
Josh Horwitz 0200df5539 generated swagger go 2017-05-29 13:03:25 -04:00
Josh Horwitz 58c1af01bd generated files 2017-05-29 13:03:25 -04:00
Josh Horwitz f75b3f3d05 Added host path whitelist to psp 2017-05-29 13:03:25 -04:00
Yassine TIJANI cc5977aaa0 avoiding unnecessary loop to copy pods listed see #46433
adding comments stating that returned pods should be used as read-only objects

fixing typo

avoiding unnecessary loop to copy pods listed see #46433

fixing fmt

avoiding unnecessary loop to copy pods listed see #46433
2017-05-29 15:40:30 +02:00
Kubernetes Submit Queue c77b74e328 Merge pull request #46486 from NickrenREN/pv-provisioner-check
Automatic merge from submit-queue

Optimize provisioner plugin result check logic

If err is not returned by findProvisionablePlugin(...), storageClass is certainly not nil


**Release note**:

```release-note
NONE
```
2017-05-29 05:31:38 -07:00
Guangya Liu d5eda34073 Improved code coverage for pkg/kubelet/util.
The test coverage for pkg/kubelet/util.go increased from 45.1%
to 84.3%.
2017-05-29 18:42:32 +08:00
Kubernetes Submit Queue eeda892240 Merge pull request #46565 from hex108/exit_kubemark
Automatic merge from submit-queue

Let kubemark exit if it fails to start

Fix the bug: If there is sth wrong to run hollow kubelet, kubemark will just hang instead of exiting. 

I came across the problem when I tried to start kubemark with no-root user.

```
I0523 15:27:39.721447   16855 docker_service.go:223] Setting cgroupDriver to cgroupfs
I0523 15:27:39.721634   16855 docker_legacy.go:151] No legacy containers found, stop performing legacy cleanup.
I0523 15:27:39.722208   16855 kubelet.go:559] Starting the GRPC server for the docker CRI shim.
I0523 15:27:39.722228   16855 docker_server.go:60] Start dockershim grpc server
I0523 15:27:39.722265   16855 server.go:819] failed to unlink socket file "/var/run/dockershim.sock": permission denied
E0523 15:27:39.722327   16855 container_manager_linux.go:98] Unable to ensure the docker processes run in the desired containers
```
2017-05-29 01:50:32 -07:00