Commit Graph

24870 Commits (f34a24e98e7c837b567b78be3af958ac1156cd80)

Author SHA1 Message Date
Kubernetes Submit Queue 0d5485b350 Merge pull request #54031 from jianglingxia/jlx-nfsvolume
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>.

reopen #53856 about doTestPlugin func delete volumePath in nfsvolume

**What this PR does / why we need it**:
reopen #53856 because of some reason that the branch become unknown repository,so commit a new pr and then close The original pr,thanks!
**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-10-20 02:20:09 -07:00
FengyunPan 462087fd74 Implement InstanceExistsByProviderID() for cloud providers
Fix #51406
If cloud providers(like aws, gce etc...) implement ExternalID()
and support getting instance by ProviderID , they also implement
InstanceExistsByProviderID().
2017-10-20 14:59:28 +08:00
Kubernetes Submit Queue ba66fcb63d Merge pull request #54125 from feiskyer/docker-images
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 dockershim panic when listing images

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

dockershim panic when listing containers because of `opts.Filters` not initialized:

505ccb88da/pkg/kubelet/dockershim/docker_image.go (L35-L39)

Also when imgSpec.Image is empty string, dockershim returns an empty image list which is not expected. (We should not set opts.Filters in this case).

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-19 23:03:26 -07:00
WanLinghao c79aba664b fix some small errors in 'kubectl set' series command
modified:   pkg/kubectl/cmd/set/set_env.go
modified:   pkg/kubectl/cmd/set/set_serviceaccount.go
modified:   pkg/kubectl/cmd/set/set_subject.go
2017-10-20 12:48:34 +08:00
FengyunPan 3cf89a5de7 Check the count of cloud node for LoadBalancer service
If there is no available node for LoadBalancer service, the LoadBlancer
service will become unavailable, we should update service status.
This is part of #53193
2017-10-20 12:04:02 +08:00
lichuqiang fd8b04649e unnecessary functions cleanup for deviceplugin 2017-10-20 09:37:59 +08:00
jianglingxia 91ddc79472 doTestPlugin func delete volumePath in nfsvolume 2017-10-20 09:37:15 +08:00
Kubernetes Submit Queue d98911c58f Merge pull request #53491 from jsafrane/fix-recycler-reuse
Automatic merge from submit-queue (batch tested with PRs 52794, 54243, 54248, 53491, 53841). 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>.

PV recycler: don't reuse old recycler pod.

It might be forged by user and block Kubernetes from recycling. Try to kill it instead.

+ report error when Kubernetes failed to delete recycler pod. PV controller will re-try recycling the PV again and delete the pod eventually.

**Which issue this PR fixes**
fixes #53413

**Release note**:
```release-note
None
```

@kubernetes/sig-storage-pr-reviews 
/assign @tallclair
2017-10-19 16:27:13 -07:00
Christian Heimes 5f9d8ba5a1 Run hack/update-bazel.sh
Signed-off-by: Christian Heimes <cheimes@redhat.com>
2017-10-19 23:44:34 +02:00
Yassine TIJANI 27d80eb76c cleaning newNodeController from unsupported kubelet version 2017-10-19 22:27:50 +02:00
Christian Heimes 477aadaa2f Regenerate code with hack/update-codegen.sh
Signed-off-by: Christian Heimes <cheimes@redhat.com>
2017-10-19 22:26:13 +02:00
Kubernetes Submit Queue c3d47b683b Merge pull request #53031 from vishh/device-id
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>.

Make AllocateResponse artifacts global across all devices per container in device plugin API

The current version of Device plugins returns artifacts (env vars, mounts, devices) per device, per container. This is not necessary and results in complex merging issues on kubelet side

There can still be a conflict if the artifacts returned by device plugin conflicts with the pod spec. In that case, I'd recommend failing pods in kubelet. This is yet to be addressed.

The go package name for device plugin apis is updated from `pkg/kubelet/apis/deviceplugin/v1alpha1` to `pkg/kubelet/apis/deviceplugin/v1alpha` (sub-version dropped) because we expect the alpha version to change until it graduates to beta and changing the go package everytime the actual alpha version changes is too tedious.

```release-note
Device plugin Alpha API no longer supports returning artifacts per device as part of AllocateResponse.
```

TODO:
- [x] Bump kubelet side API version
- [X] Post an updated device plugin image that works with the new API version
- [ ] Stabilize e2es (This PR needs to be merged since there is a dependency on the plugin side for vendoring)
2017-10-19 12:43:52 -07:00
Kubernetes Submit Queue 44f898067b Merge pull request #54244 from gnufied/fix-log-spam-from-node-status
Automatic merge from submit-queue (batch tested with PRs 53809, 54244, 54142). 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>.

Fixes spam from node status updates

Some of us are looking at reducing unncessary logging spam which happens in k8s.  This message is anyway logged by caller of the function and hence we should not log it again.

cc @kubernetes/sig-storage-pr-reviews @eparis
2017-10-19 11:50:03 -07:00
Kubernetes Submit Queue c7a1a061c3 Merge pull request #53809 from rrati/lease-reconciler-fixes
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>.

Fixed the lease endpoint reconciler creation of kubernetes endpoint and lease file ttl. #53803

Fixed the prefix used to create the kubernetes endpoint and the ttl value used for lease files.

Fixes: #53803
2017-10-19 11:44:56 -07:00
Vishnu kannan 16b0363b95 Disabling k8s.io/kubernetes/pkg/kubelet/cm TestPodContainerDeviceAllocation due to #54100
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-10-19 10:35:24 -07:00
Vishnu kannan e0032af916 bump device plugin version to v1alpha2 to reflect the change to AllocateResponce API
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-10-19 10:35:24 -07:00
Vishnu kannan 18eee1eaa0 Make AllocateResponse artifacts global across all devices per container in device plugin API
There is no use case known for passing artifacts per device as it currently exists. The current API is also
complex to use for simple clients. Hence this PR creates a flat namespace where artifacts like environment variables
and mount points apply globally to all devices returned as part of AllocateResponse proto.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-10-19 10:34:00 -07:00
Solly Ross d2b41120ea Make HPA controller use polymorphic scale client
This updates the HPA controller to use the polymorphic scale client from
client-go.  This should enable HPAs to work with arbitrary scalable
resources, instead of just those in the extensions API group (meaning we
can deprecate the copy of ReplicationController in extensions/v1beta1).
It also means that the HPA controller now pays attention to the
APIVersion field in `scaleTargetRef` (more specifically, the group part
of it).

Note that currently, discovery information on which resources are
available where is only fetched once (the first time that it's
requested).  In the future, we may want a refreshing discovery REST
mapper.
2017-10-19 13:21:02 -04:00
Solly Ross 3f51babdd1 Update extensions fuzzer to use selector fuzzer
This removes the override on the extensions fuzzer so that
extensions.Scale will use the full label selector fuzzer.
2017-10-19 11:01:45 -04:00
Solly Ross ef583aeed2 Fuzz label selectors
Previously, we did not have custom code for fuzzing label selectors.
Anything that used a label selector (like Scale) had to manually bypass
fuzzing the selector, or write its own fuzzer.  This introduces a fuzzer
for label selectors which generates random correct selectors with random
keys and values.
2017-10-19 11:01:45 -04:00
Solly Ross eac2049fc9 [client-go] avoid Registry in fake REST client
Previously, the fake RESTClient in client-go required a Registry.  It
used the Registry to fetch the GroupVersion for the fake client.
However, the way it did so was dubious in some cases (it hard-coded the
default API group in places), and not strictly necssary.

This updates the fake client to just recieve the GroupVersion and
internal group name directly, instead of requiring a Registry, so that
it can be consumed in unit tests where a Registry isn't necessarily
readily available (e.g. elsewhere in client-go).
2017-10-19 11:01:44 -04:00
juanvallejo ee2f9c95e7
update resource selector - kubectl drain 2017-10-19 10:10:06 -04:00
David Eads 0859798e8e update admission webhook to accept client config 2017-10-19 09:52:58 -04:00
Kubernetes Submit Queue 78ada62c30 Merge pull request #53821 from rrati/apiserver-clean-shutdown
Automatic merge from submit-queue (batch tested with PRs 54145, 53821). 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>.

Added PreStopHooks to apiserver to allow clean shutdown.  

BootStrapController now registers a PreStopHook to clean up the kubernetes service endpoints.  The PreStopHooks allow the apiserver to shutdown cleanly under a controlled shutdown case.  The BootStrapController's PreStopHook will clean up after itself by removing the apiserver from the list of IPs in the kubernetes service.

fixes #53438
2017-10-19 06:50:13 -07:00
Hemant Kumar e3f0c8bb2d Fixes spam from node status updates
The same error is logged in 2 places which is unncessary.
2017-10-19 09:37:07 -04:00
David Eads 730d42011a generated 2017-10-19 08:06:38 -04:00
David Eads 33deaedaf6 add url path for admission webhooks 2017-10-19 08:06:38 -04:00
Kubernetes Submit Queue 83ea3271bd Merge pull request #54192 from mkumatag/versioned_busybox
Automatic merge from submit-queue (batch tested with PRs 54154, 54192). 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>.

Versioned busybox docker image

**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 #53942

**Special notes for your reviewer**:

**Release note**:

```NONE
```
2017-10-19 03:41:14 -07:00
Kubernetes Submit Queue 3667154d85 Merge pull request #54154 from mtaufen/deprecate-enable-custom-metrics
Automatic merge from submit-queue (batch tested with PRs 54154, 54192). 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 --enable-cusom-metrics to KubeletFlags and mark it deprecated

With respect to https://github.com/kubernetes/kubernetes/pull/53833#issuecomment-336890235, EnableCustomMetrics should be marked deprecated and should not remain in the KubeletConfiguration struct. 

Broader issue: https://github.com/kubernetes/features/issues/281

```release-note
The Kubelet's --enable-custom-metrics flag is now marked deprecated.
```
2017-10-19 03:41:11 -07:00
Kubernetes Submit Queue 3c46e67c14 Merge pull request #54209 from hzxuzhonghu/route
Automatic merge from submit-queue (batch tested with PRs 52753, 54034, 53982, 54209). 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>.

stopCh should be passed to route-controller main goroutine

**What this PR does / why we need it**:
currently neverstop channel is used, stopCh should be used
```
	go wait.NonSlidingUntil(func() {
		if err := rc.reconcileNodeRoutes(); err != nil {
			glog.Errorf("Couldn't reconcile node routes: %v", err)
		}
	}, syncPeriod, wait.NeverStop)
```
**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-10-19 02:45:25 -07:00
Kubernetes Submit Queue f01bfd4580 Merge pull request #54204 from Lion-Wei/ipvs-valid
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 ProxyModeIPVS in proxy mode validation

**What this PR does / why we need it**:
Currently didn't add "ipvs" in proxy mode check, then if we use "ipvs" mode, will get this error:
'error: KubeProxyConfiguration.Mode.ProxyMode: Invalid value: "ipvs": must be userspace,iptables or blank (blank means the best-available proxy (currently iptables)'
So I added 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-10-19 01:28:17 -07:00
Kubernetes Submit Queue eb041b00ea Merge pull request #53609 from juanvallejo/jvallejo/set-user-specified-ns-dry-run-create
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 user-specified  ns to --dry-run created obj

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

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

Includes a namespace in a created resource's metadata when `--dry-run` is used if:
- a namespace was explicitly set by the user (via `--namespace`)
- No errors occur accessing the object's metadata

cc @fabianofranz @deads2k
2017-10-19 00:24:42 -07:00
Lion-Wei ee3fbf9c5a add ProxyModeIPVS in proxy mode validation 2017-10-19 14:34:37 +08:00
Kubernetes Submit Queue 29d2f15c9e Merge pull request #47636 from xiangpengzhao/some-cleanup
Automatic merge from submit-queue (batch tested with PRs 51310, 51458, 47636). 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>.

Clean up some service related description

**What this PR does / why we need it**:
As per the review comment https://github.com/kubernetes/kubernetes/pull/47250#discussion_r121162426, send this cleanup PR.

**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**:
since this is minor cleanup, there is no related issue. see https://github.com/kubernetes/kubernetes/pull/47250#discussion_r121162426

**Release note**:

```release-note
NONE
```
2017-10-18 20:47:10 -07:00
Jing Ai 4a522820df Revert pkg/cloudprovider/providers/gce/BUILD made by GoSublime, which is irrelevant to the fix. 2017-10-18 20:22:29 -07:00
Jing Ai 36dff9fc64 Pass zone name instead of zone url to GCE API to update NIC setting for alias range. 2017-10-18 20:02:26 -07:00
hzxuzhonghu 152a0a83f8 pass stop channel to route-controller main goroutine 2017-10-19 11:01:05 +08:00
Manjunath A Kumatagi 951d2c060e Versioned busybox docker image 2017-10-19 07:17:44 +05:30
hzxuzhonghu 96b48d4386 add event broadcaster logging for all contoller managers 2017-10-19 09:18:43 +08:00
pshahzeb a842ee9694 Fixing usage of clustered datastore to be absolute datastore 2017-10-18 17:37:53 -07:00
Pengfei Ni 77ed72f583 Fix dockershim panic when listing images 2017-10-19 08:32:50 +08:00
Zihong Zheng 72542f5b82 Fix retry logic in service controller 2017-10-18 16:58:19 -07:00
juanvallejo 96d3f4552f
exit with correct exit code on plugin failure 2017-10-18 19:01:29 -04:00
Kubernetes Submit Queue aaec4e20e8 Merge pull request #53164 from enisoc/rc-rs-conversion
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 RC/RS conversion

This fixes some round-trip information loss when representing an RC as an RS. I want to use these conversions in #49429 to eliminate the maintenance burden of duplicated RC code.

@kubernetes/sig-apps-pr-reviews
2017-10-18 15:42:10 -07:00
Kubernetes Submit Queue b3a9b802da Merge pull request #53823 from deads2k/admission-01-allow-fail
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>.

allow fail close webhook admission

Webhook admission needs to allow failing closed.  Even in an alpha state, I don't want to be one DDOS away from having an exposed cluster.

/assign caesarxuchao
/assign sttts
2017-10-18 14:49:54 -07:00
Kubernetes Submit Queue 900c0761e3 Merge pull request #53722 from deads2k/rbac-01-allow-star
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>.

allow */subresource in rbac policy rules

xref #29698
xref #38756
xref #49504
xref #38810

Allow `*/subresource` format in RBAC policy rules to support polymorphic subresources like `*/scale` for HPA.

@DirectXMan12 fyi

```release-note
RBAC PolicyRules now allow resource=`*/<subresource>` to cover `any-resource/<subresource>`.   For example, `*/scale` covers `replicationcontroller/scale`.
```
2017-10-18 14:02:05 -07:00
Kubernetes Submit Queue d196a4abbb Merge pull request #54062 from porridge/fix-typo-method
Automatic merge from submit-queue (batch tested with PRs 43661, 54062). 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 typo in function name.

Also remove a superfluous comment.

**Release note**:
```release-note
NONE
```
2017-10-18 13:11:23 -07:00
Kubernetes Submit Queue 257b6f38e9 Merge pull request #43661 from xiangpengzhao/revert-genmac
Automatic merge from submit-queue (batch tested with PRs 43661, 54062). 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 #43583 (kubenet: remove code forcing bridge MAC address)

**What this PR does / why we need it**:
*kubenet: remove code forcing bridge MAC address*

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

cc @dcbw @freehan
2017-10-18 13:11:20 -07:00
Anthony Yeh c1377383bb
Add fuzz test for RC/RS conversion. 2017-10-18 12:37:30 -07:00
Kubernetes Submit Queue 09a42ba9e0 Merge pull request #47717 from chentao1596/remove-extra-log-parameter
Automatic merge from submit-queue (batch tested with PRs 47717, 53896). 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>.

Delete the redundant parameter flag

What this PR does / why we need it:

  Delete redundant parameter flag, otherwise the log will be show like:

  Warning: path "/var/lib/kubelet/pods/3c6c4869-4d02-11e7-9685-fa163eeda0fa/volumes" does not exist: %!q(MISSING)

  thank you!
2017-10-18 11:52:03 -07:00
Anthony Yeh 89cfaf9184
Fix loss of Conditions during RC/RS conversion. 2017-10-18 11:46:31 -07:00
Anthony Yeh b4815bd4cb
Fix loss of MinReadySeconds on RC/RS conversion. 2017-10-18 11:46:31 -07:00
Anthony Yeh f290819f75
Fix loss of selector during RC/RS conversion.
The `out` parameter in Convert_map_to_unversioned_LabelSelector was
being ignored.
2017-10-18 11:46:31 -07:00
juanvallejo 027c8b9ef2
update .dockercfg content to config.json
update the data format of .dockercfg to match the new docker config.json
format, which encapsulates all registry auth objects in an overall
"auths" object:

{
    "auths": {
        "reg.url": {
            "auth": "...=="
        }
    }
}
2017-10-18 14:33:14 -04:00
David Eads f81b6004de allow fail close webhook admission 2017-10-18 14:28:02 -04:00
Tim Allclair 570c17a3b8
Create api-{approvers,reviewers} alias 2017-10-18 10:54:28 -07:00
Kubernetes Submit Queue 2d914ee703 Merge pull request #53984 from sttts/sttts-legacyscheme
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>.

pkg/api: extract Scheme/Registry/Codecs into pkg/api/legacyscheme

This serves as

- a preparation for the pkg/api->pkg/apis/core move
- and makes the dependency to the scheme explicit when vizualizing
  left depenncies.

The later helps with our our efforts to split up the monolithic repo
into self-contained sub-repos, e.g. for kubectl, controller-manager
and kube-apiserver in the future.
2017-10-18 10:49:10 -07:00
Michael Taufen 50b5a124bf Move --enable-cusom-metrics to KubeletFlags and mark it deprecated 2017-10-18 10:28:07 -07:00
Phillip Wittrock fd169a6218 Switch to v1.List instead of allowing the conversion fn to be provided. 2017-10-18 09:30:46 -07:00
Kubernetes Submit Queue 054e4da8cd Merge pull request #54109 from liggitt/networkpolicy-apply-master
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>.

Ensure network policy conversion round trips nil from field

xref https://github.com/kubernetes/kubernetes/issues/53906

```release-note
NONE
```
2017-10-18 08:27:15 -07:00
Dr. Stefan Schimanski cad0364e73 Update bazel 2017-10-18 17:24:04 +02:00
Dr. Stefan Schimanski 7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Kubernetes Submit Queue 1e356871a4 Merge pull request #53958 from dixudx/fix_pv_recycle_multiarch
Automatic merge from submit-queue (batch tested with PRs 53958, 53947). 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 PV Recycle issue when running on multi-arch

**What this PR does / why we need it**:
Currently PV Recycle uses image `gcr.io/google_containers/busybox`, which is an amd64 image, not applied for multi-arch , to start pod `"pv-recycler"`. For other non-x86 platforms, like `ppc64le` and `arm64`, the pod cannot get started due to the busybox image.


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

**Special notes for your reviewer**:
/cc @gyliu513 @mkumatag 
/assign @saad-ali @jsafrane 

**Release note**:

```release-note
fix PV Recycle failed on non-amd64 platfrom
```
2017-10-18 06:44:00 -07:00
Kubernetes Submit Queue 6265d2170b Merge pull request #53719 from dixudx/fix_azure_disk_format_log_error
Automatic merge from submit-queue (batch tested with PRs 53872, 53719). 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 azureDisk warns about disk format failure

**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 #53713

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-10-18 05:47:55 -07:00
Dr. Stefan Schimanski a31075b1b3 Move global scheme to pkg/api/legacyscheme 2017-10-18 13:26:56 +02:00
Kubernetes Submit Queue 4c413ae9a7 Merge pull request #54117 from nikhiljindal/removeLogs
Automatic merge from submit-queue (batch tested with PRs 53965, 54117, 53685). 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>.

Fixing a glog message to not print managed zones when it is empty

```release-note
NONE
```
2017-10-18 03:29:56 -07:00
Kubernetes Submit Queue b958430ec2 Merge pull request #53965 from Random-Liu/add-extra-info-in-cri
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>.

CRI: Add extra information in status functions in CRI.

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

@yujuhong @feiskyer @mrunalp 
/cc @kubernetes/sig-node-api-reviews 

```release-note
Verbose option is added to each status function in CRI. Container runtime could return extra information in status response for debugging.
```
2017-10-18 03:02:29 -07:00
Kubernetes Submit Queue a1e786f138 Merge pull request #54059 from porridge/fix-lint-err
Automatic merge from submit-queue (batch tested with PRs 53696, 54059). 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 lint warnings for useless err checks.

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

This check was recently added to golint.

**Which issue this PR fixes**

Related to #37254

**Release note**:
```release-note
NONE
```
2017-10-18 00:58:59 -07:00
Kubernetes Submit Queue a3a659b8ca Merge pull request #53696 from drinktee/kuberuntimeunitest
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>.

Increases test coverage for kubelet/kuberuntime

What this PR does / why we need it:
Increases test coverage for kubelet/kuberuntime
#46123

Which issue this PR fixes:
#46123

/assign @feiskyer
2017-10-18 00:43:08 -07:00
chenguoyan01 a7d2a2bef4 fix build vendor
Change-Id: I4ec11639d5f8e8611322ac901afdada3f6aa1180
2017-10-18 14:57:59 +08:00
nikhiljindal 4303611ba5 Fixing a glog message to not print managed zones when it is empty 2017-10-17 22:46:58 -07:00
Kubernetes Submit Queue 505ccb88da Merge pull request #54041 from malc0lm/rm-replenishmentControllers-Run
Automatic merge from submit-queue (batch tested with PRs 54030, 54041). 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>.

Adjust replenishmentControllers in resource quota controller

**What this PR does / why we need it**:
Since replenishmentControllers was generated by ctx.InformerFactory, remove "replenishmentControllers []cache.Controller" which is never used, and it is needless to run replenishmentControllers which has ran in "ctx.InformerFactory.Start(ctx.Stop)". 
**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-10-17 21:26:03 -07:00
Sahdev P. Zala 07be0a057a Create new unit tests for version and kind validation
This is a follow up PR per discussion in the
https://github.com/kubernetes/kubernetes/pull/53587
Creating new unit tests here for basic and aggregated validation of version
and kind group.
2017-10-17 23:10:20 -04:00
Di Xu f9e9fc84aa fix PV Recycle issue when running on multi-arch 2017-10-18 10:44:33 +08:00
Phillip Wittrock 72d672c3d5 Remove dependency on internal types from pkg/kubectl/resource.
Updates the Result.Object function to take an argument.
2017-10-17 18:58:16 -07:00
supereagle 0b88971505 kubelet: remove the --network-plugin-dir flag 2017-10-18 09:37:19 +08:00
Jordan Liggitt d9149506f7
Ensure network policy conversion round trips nil from field 2017-10-17 20:04:50 -04:00
Kubernetes Submit Queue d97c759110 Merge pull request #53587 from spzala/master
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>.

Provide aggregated validation errors for version and kind

Currently the validation checks is done individually for version and
kind group. For example, if user provided yaml file is missing apiVersion
and kind fields, first they will receive error on apiVersion. Once user
update the file and try to recreate, an error on missing kind is displayed.
The behavior is same for wrong types of the fields.
These errors should be aggregated and displayed.

Examples of current validation:
1
test.yaml is missing apiVersion and kind:
$kubectl.sh create -f /home/sahdev/go/src/bugfixes/test.yaml
error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: apiVersion not set; if you choose to ignore these errors, turn validation off with --validate=false
2.
test.yaml is fixed for apiVersion but missing kind:
$kubectl.sh create -f /home/sahdev/go/src/bugfixes/test.yaml
error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: kind not set; if you choose to ignore these errors, turn validation off with --validate=false

Examples with aggregated validation: 
1.
error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false
2.
error: error validating "/home/sahdev/go/src/bugfixes/testmix.yaml": error validating data: [apiVersion isn't string type, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false



**What this PR does / why we need it**:
To provide aggregated validations to user for version and kind group.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-17 16:35:39 -07:00
Kubernetes Submit Queue e3e2e24cc5 Merge pull request #52503 from joelsmith/journald-log-fallback
Automatic merge from submit-queue (batch tested with PRs 54040, 52503). 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>.

Get fallback termination msg from docker when using journald log driver

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

When using the legacy docker container runtime and when a container has `terminationMessagePolicy=FallbackToLogsOnError` and when docker is configured with a log driver other than `json-log` (such as `journald`), the kubelet should not try to get the container's log from the json log file (since it's not there) but should instead ask docker for the logs.

**Which issue this PR fixes** fixes #52502

**Special notes for your reviewer**:

**Release note**:
```release-note
Fixed log fallback termination messages when using docker with journald log driver
```
2017-10-17 13:18:15 -07:00
Kubernetes Submit Queue 86f7e2706a Merge pull request #54040 from dixudx/fix_kubelet_runtime_version_parsing
Automatic merge from submit-queue (batch tested with PRs 54040, 52503). 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>.

falls back to parse Docker runtime version as generic if not semver

**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 #54039

**Special notes for your reviewer**:
/assign @tallclair @vishh 

**Release note**:

```release-note
falls back to parse Docker runtime version as generic if not semver
```
2017-10-17 13:18:12 -07:00
Kubernetes Submit Queue abb7789cd8 Merge pull request #54073 from liggitt/node-default-label
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>.

Do not remove kubelet labels during startup

Fixes #54070 

```release-note
kubelet: prevent removal of default labels from Node API objects on startup
```
2017-10-17 10:55:40 -07:00
Sahdev P. Zala 0c0a4696c7 Provide aggregated validation errors for version and kind
Currently the validation checks is done individually for version and
kind group. For example, if user provided yaml file is missing apiVersion
and kind fields, first they will receive error on apiVersion. Once user
update the file and try to recreate, an error on missing kind is displayed.
The behavior is same for wrong types of the fields.
These errors should be aggregated and displayed.
2017-10-17 13:31:12 -04:00
Kubernetes Submit Queue dfdfb8932f Merge pull request #52052 from joelsmith/master
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>.

Clean up kublet secret and configmap unit test

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

These changes are clean-up items to fix confusing code encountered while investigating #52043. No actual bugs are fixed here (except, maybe, correcting unit tests that had actual/expected swapped).

A summary of the changes, as listed in the commit:

* Expected value comes before actual value in assert.Equal()
* Use `assert.Equal()` instead of `assert.True()` when possible
* Add a unit test that verifies no-op pod updates to the `secret_manager` and the `configmap_manager`
* Add a clarifying comment about why it's good to seemingly delete a secret on updates.
* Fix (for now, non-buggy) variable shadowing issue

**Special notes for your reviewer**:

N/A

**Release note**:
```release-note
NONE
```
2017-10-17 10:06:16 -07:00
chenguoyan01 4cff9dab46 add unit tests in /pkg/api/v1helper
Change-Id: I97b1c1d5521d6db6b96bc3659d0484f5527cb6cc
2017-10-18 00:24:35 +08:00
Jordan Liggitt 9df1f7ef11
Do not remove kubelet labels during startup 2017-10-17 11:49:02 -04:00
Kubernetes Submit Queue 7acb055aa2 Merge pull request #53535 from php-coder/psp_update_fuzzer
Automatic merge from submit-queue (batch tested with PRs 51416, 53535). 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>.

PodSecurityPolicy: teach fuzzer about fsGroup/supplementalGroups strategies

**What this PR does / why we need it**:
At present, fuzzer for PSP doesn't take into account `fsGroup`/`supplementalGroups` strategies. This PR teach fuzzer about these strategies in order to have ability to catch more possible errors.

**Special notes for your reviewer**:
Let me know if you think that we need to cover more (all?) fields in the PSP.

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

PTAL @pweil- @sttts 
CC @simo5
2017-10-17 08:44:15 -07:00
Kubernetes Submit Queue 0e21ac81c0 Merge pull request #51416 from justinsb/fix_nodeidentitifer_godocs
Automatic merge from submit-queue (batch tested with PRs 51416, 53535). 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 NodeIdentifier godocs: IdentifyNode -> NodeIdentity
2017-10-17 08:44:13 -07:00
Kubernetes Submit Queue d91e97f243 Merge pull request #53037 from smarterclayton/verify_client_cert
Automatic merge from submit-queue (batch tested with PRs 53978, 54008, 53037). 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>.

Verify the bootstrap client cert before using it
2017-10-17 04:53:42 -07:00
Marcin Owsiany 49553d4a7a Fix lint warnings for useless err checks.
This check was recently added to golint.
2017-10-17 12:52:54 +02:00
chenguoyan01 6a9070a59d add TestStatus to instrumented_services_test
Change-Id: Ib2fafd714ed0a48a4dbb3b9fb406e516d5587ae4
2017-10-17 18:33:02 +08:00
Kubernetes Submit Queue 1d8f1e268f Merge pull request #47699 from supereagle/fix-typos
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 typos: remove duplicated word in comments

**What this PR does / why we need it**: Remove the duplicated word `the` in comments

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

**Special notes for your reviewer**:

```release-note
NONE
```
2017-10-17 02:35:52 -07:00
Marcin Owsiany 36dc1c4515 Fix typo in function name.
Also remove a superfluous comment.
2017-10-17 11:31:46 +02:00
andyzhangx 286d8ae287 add windows implementation of GetMountRefs
add unit test and fix according to comments

fix unit test issue

add const in getAllParentLinks func
2017-10-17 07:35:18 +00:00
Di Xu 8f61376d05 kubelet falls back to parse generic version string if not semver 2017-10-17 14:31:18 +08:00
Malcolm Lee efdf99d09a Since replenishmentControllers was generated by ctx.InformerFactory, remove "replenishmentControllers []cache.Controller" which is never used. 2017-10-17 14:05:55 +08:00
Lantao Liu c6ddc749e8 Add extra information in status functions in CRI. 2017-10-17 04:11:34 +00:00
Kubernetes Submit Queue 97808e5a86 Merge pull request #52849 from liggitt/psp-defaulting-order
Automatic merge from submit-queue (batch tested with PRs 48665, 52849, 54006, 53755). 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>.

Order PSP by name, prefer non-mutating PSPs

Fixes #36184
Fixes #23217
Related to #23217

Removes unnecessary mutation of pods:
* Determines effective security context for pods using a wrapper containing the pod and container security context, rather than building/setting a combined struct on every admission
* Does not set `privileged:&false` on security contexts with `privileged:nil`
* Does not set `runAsNonRoot:&true` on security contexts that already have a non-nil, non-0 `runAsUser`
* Does not mutate/normalize container capabilities unless changes are required (missing  defaultAddCapabilities or requiredDropCapabilities)

Defines behavior when multiple PSP objects allow a pod:
* PSPs which allow the pod as-is (no defaulting/mutating) are preferred
* If the pod must be defaulted/mutated to be allowed, the first PSP (ordered by name) to allow the pod is selected
* During update operations, when mutations to pod specs are disallowed, only non-mutating PSPs are used to validate the pod

```release-note
PodSecurityPolicy: when multiple policies allow a submitted pod, priority is given to ones which do not require any fields in the pod spec to be defaulted. If the pod must be defaulted, the first policy (ordered by name) that allows the pod is used.
```
2017-10-16 18:09:41 -07:00
Kubernetes Submit Queue d24d368845 Merge pull request #48665 from praseodym/add-short-names-help-text
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 missing short names to kubectl help text

**What this PR does / why we need it**:
This PR adds two short names that exist but are not listed in the help text that `kubectl get` produces.

**Special notes for your reviewer**:
🍰 

**Release note**:
```release-note
NONE
```
2017-10-16 17:45:26 -07:00
chentao1596 42845e19bf Delete redundant parameter flag 2017-10-17 08:31:50 +08:00
Kubernetes Submit Queue 03cb11f020 Merge pull request #52275 from mattjmcnaughton/mattjmcnaughton/18155-hpa-tolerance-should-be-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>.

Make HPA tolerance a flag

**What this PR does / why we need it**:
Make HPA tolerance configurable as a flag. This change allows us to use
different tolerance values in production/testing.

**Which issue this PR fixes**: 
Fixes #18155

**Release note:**
```release-note
Control HPA tolerance through the `horizontal-pod-autoscaler-tolerance` flag.
```

Signed-off-by: mattjmcnaughton <mattjmcnaughton@gmail.com>
2017-10-16 16:47:43 -07:00
Kubernetes Submit Queue 74cd0f0766 Merge pull request #53861 from pwittrock/resource-validation-deps
Automatic merge from submit-queue (batch tested with PRs 53106, 52193, 51250, 52449, 53861). 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 version-conversion code out of shared kubectl resource package

```release-note
NONE
```
2017-10-16 14:47:28 -07:00
David Eads e8a703b651 allow */subresource in rbac policy rules 2017-10-16 16:17:51 -04:00
Phillip Wittrock 7ab3f96100 Move kubectl type conversion libs out of the resource & util package and into the conversion command.
Kubectl shouldn't have code that does type conversion.  This should be in the server.
2017-10-16 11:54:31 -07:00
Kubernetes Submit Queue 88975e98d6 Merge pull request #53919 from apelisse/fix-new-apply-crash
Automatic merge from submit-queue (batch tested with PRs 53694, 53919). 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>.

Do not crash when groupVersion doesn't have a group

**What this PR does / why we need it**: fixes a crash when the group is empty, because it assumes that split will return a two element array. Which it doesn't.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-10-16 10:58:30 -07:00
Kubernetes Submit Queue 6118a4b9af Merge pull request #53694 from andyzhangx/azure-avset-nil-fix
Automatic merge from submit-queue (batch tested with PRs 53694, 53919). 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 controller manager crash issue on a manually created k8s cluster

**What this PR does / why we need it**:
fix controller manager crash issue on a manually created k8s cluster, it's due to availability set nil issue in azure loadbalancer

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
In the testing of a manually created k8s cluster, I found controller manager on master would crash in current scenario:
1. Use acs-engine to set up k8s 1.7.7 cluster (it's with an availability set)
2. Manually add a node to the k8s cluster (without an availibity set in this VM)
3. Set up a service and schedule the pod onto this newly added node
4. controller manager would crash on master because although this k8s cluster has an availability set, the newly added node's `machine.AvailabilitySet` is nil which would cause controller manager crash

**Special notes for your reviewer**:
@brendanburns @karataliu @JiangtianLi 

**Release note**:

```
fix controller manager crash issue on a manually created k8s cluster
```
/sig azure
2017-10-16 10:58:27 -07:00
Kubernetes Submit Queue a6625085f5 Merge pull request #52473 from tianshapjq/typo
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>.

typo in annotations

**What this PR does / why we need it**: just typo in annotations

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

**Release note**:

```release-note
none
```
2017-10-16 08:28:09 -07:00
Robert Rati 099404a0ee Fixed the lease endpoint reconciler creation of kubernetes endpoint and lease file ttl 2017-10-16 10:51:29 -04:00
Clayton Coleman 5649f9a578 Move pkg/kubelet/util/csr into client-go
Everything else it depends on was already there, and now we have a
somewhat consistent code chain.
2017-10-16 16:05:48 +02:00
m1093782566 dab9b84b67 add proxy metrics in app level 2017-10-16 21:10:51 +08:00
Clayton Coleman b3a11aa635
Have the certificate manager decide if the server is healthy
Prevent a Kubelet from shutting down when the server isn't responding to
us but we cannot get a new certificate. This allows a cluster to coast
if the master is unresponsive or a node is partitioned and their client
cert expires.
2017-10-16 14:27:03 +02:00
Clayton Coleman cbecf17727
cache.ListWatchUntil should return err.ErrWaitTimeout
Clients shouldn't have to know about watch.ErrWatchClosed, which is
typically a server side decision to close and always means "Timeout" in
this conetxt.
2017-10-16 14:27:03 +02:00
Clayton Coleman 7555dec82e
Kubelet should exit if the current client cert has expired
The client cert manager uses the most recent cert to request new
certificates. If that certificate is expired, it will be unable to
complete new CSR requests. This commit alters the manager to force
process exit if no further client cert rotation is possible, which
is expected to trigger a restart of the kubelet and either a
re-bootstrap from the bootstrap kubeconfig or a re-read of the
current disk state (assuming that some other agent is managing the
bootstrap configuration).

This prevents the Kubelet from wedging in a state where it cannot make
API calls.
2017-10-16 14:27:03 +02:00
Clayton Coleman c3bea24ab6
Collapse duplicate code into pkg/util/csr
There is no reason to duplicate this code into two places.
2017-10-16 14:27:03 +02:00
Clayton Coleman de3d7d1881
If CSR is deleted, exit immediately
No point in waiting
2017-10-16 14:27:02 +02:00
Clayton Coleman 710dfb3427
Delete the private key for the bootstrap client cert on failure
Ensures that in a crash loop state we can make forward progress by
generating a new key and hence new CSR. If we do not delete the key, an
expired CSR may block startup.

Also more aggressively delete a bad cert path
2017-10-16 14:27:02 +02:00
Clayton Coleman 74a0abb699
An expired certificate is not compatible
If the certificate in the CSR is expired, it's no good to the code.
Error out with the correct message.
2017-10-16 14:27:02 +02:00
Clayton Coleman ae6ee96b36
Verify the bootstrap client cert before using it
Before the bootstrap client is used, check a number of conditions that
ensure it can be safely loaded by the server. If any of those conditions
are invalid, re-bootstrap the node. This is primarily to force
bootstrapping without human intervention when a certificate is expired,
but also handles partial file corruption.
2017-10-16 14:26:56 +02:00
Robert Rati 00b085ad4a Added PreShutdownHook functions for endpoint reconcilers 2017-10-16 08:18:34 -04:00
Cao Shufeng 52e292afe7 clean up pkg/apis/meta/v1/time.go
This file has been moved to staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
2017-10-16 16:36:44 +08:00
Jordan Liggitt a5f722e181
PodSecurityPolicy: avoid unnecessary securitycontext mutation 2017-10-16 02:22:10 -04:00
Jordan Liggitt b6a750c1f6
SecurityContext: Add accessors/mutators for effective container security context 2017-10-16 02:22:10 -04:00
Jordan Liggitt 34ed25cf52
GC: Add check for nil interface 2017-10-16 02:21:11 -04:00
Jordan Liggitt fef3b03188
PodSecurityPolicy: pass effective runAsNonRoot and runAsUser to user validation interface 2017-10-16 02:21:11 -04:00
Jordan Liggitt e34a00d14f
PodSecurityPolicy: pass effective selinux options to validate 2017-10-16 02:21:11 -04:00
Jordan Liggitt 5dc4da7c6a
PodSecurityPolicy: limit validation to provided groups 2017-10-16 02:21:11 -04:00
Jordan Liggitt 9e34f2b968
PodSecurityPolicy: pass effective capabilities to validation interface 2017-10-16 02:21:11 -04:00
Jordan Liggitt abc7c077e1
PodSecurityPolicy: avoid unnecessary mutation of supplemental groups 2017-10-16 02:21:10 -04:00
Jordan Liggitt cfb490e3a1
PodSecurityPolicy: avoid unnecessary mutation of container capabilities 2017-10-16 02:21:10 -04:00
Jordan Liggitt 59510caaf3
PodSecurityPolicy: only set runAsNonRoot when runAsUser is nil 2017-10-16 02:21:10 -04:00
Jordan Liggitt b45b809f4c
PodSecurityPolicy: Do not mutate nil privileged field to false 2017-10-16 02:21:10 -04:00
Kubernetes Submit Queue 77b83e446b Merge pull request #53839 from ixdy/update-bazel-workspace
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>.

 Update rules_go, repo-infra, and rules_docker dependencies

**What this PR does / why we need it**: several of our bazel dependencies were getting pretty old, since they required bazel 0.5.4+ but there were various failures if we tried to use them with bazel 0.5.4.

Now that bazel 0.6.0 (and 0.6.1) have been out for a while, we can bump our dependencies and get a number of fixes and new functionality.

x-ref #52677 and others

**Special notes for your reviewer**:
* This will now explicitly require bazel 0.6.0+ to build kubernetes.
* Our staging directories are causing some issues for `gazelle`; it wants to set `importpath = "k8s.io/kubernetes/staging/src/k8s.io/blah"` instead of `importpath = "k8s.io/blah"`. I'm not sure what is the correct way to fix this; what we're doing here is pretty weird and nonstandard. I've used a `sed` substitution for now.
* The `-proto=default` option of `gazelle` has a number of bugs right now (https://github.com/bazelbuild/rules_go/issues/888, https://github.com/bazelbuild/rules_go/issues/900, https://github.com/bazelbuild/rules_go/issues/907), so I am forcing the legacy behavior.

**Release note**:

```release-note
NONE
```

/assign @mikedanese @spxtr @BenTheElder
2017-10-15 21:50:13 -07:00
Kubernetes Submit Queue 9ba01e5e78 Merge pull request #50729 from allencloud/remove-redundant-error-test-case
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 redundant error test case in autoscaling validation

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



**What this PR does / why we need it**:
I think the error test case I removed is the same as https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/autoscaling/validation/validation_test.go#L393-L412 .
So maybe removal of this part is proper, since it would reduce the codes and save a little bit time in testing.

**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-10-15 20:19:51 -07:00
Kubernetes Submit Queue 021e3ebf0c Merge pull request #52465 from WanLinghao/kubectl_cp_amend
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>.

improve kubectl cp command in several ways 

**Release note**:
"kubectl cp" process soft link in better ways as well as some little bugs
  
**Soft link**:
before this patch 
    "kubectl cp" command will copy the soft link to destination as an empty regular file
after this patch
    "kubectl cp" command will behave the same as tar command
this patch improves it on both from container and to container

**some bugs**
1.from container to host
     a.when copy a file ends with '/', it will cause a panic.
        for example, container gakki has a regular file /tmp/test, then run command 
         _kubectl cp gakki:/tmp/test/  /tmp_
         a panic happens
 b.when copy a file which does not exist in container, the command ends up without 
         any error information

2.from host to container
    a.when run command like
        kubectl cp ""  gakki:/tmp
        it will try cp current directory to container, in other words, this command works
        the same as kubectl cp . gakki:/tmp
  b.current cp command will omit  an empty directory
2017-10-15 19:28:21 -07:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 02f0d92160 Merge pull request #51686 from choury/fix_dup_unbind
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 duplicate unbind action in kube-proxy

**What this PR does / why we need it**:
Fix duplicate unbind action in kube-proxy. It will generate unnecessary error info If unbind multi-ports on one service .

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

**Release-note**:
```release-note
NONE
```
2017-10-15 17:38:45 -07:00
Kubernetes Submit Queue 8166743cb6 Merge pull request #53890 from FengyunPan/registry-approver
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>.

Volunteer to help with sig/openstack

I would like to do some code review/approve for OpenStack cloud
provider and cinder volume.

**Release note**:
```release-note
NONE
```
2017-10-15 16:03:27 -07:00
Xingcai Zhang 70f47a7975 Update many misspelled word initializer 2017-10-15 22:09:26 +08:00
Guangya Liu 53596dd2d2 glusterfs service endpoint prefix should be `glusterfs-dynamic-`. 2017-10-15 11:03:09 +08:00
Kubernetes Submit Queue 58835cd590 Merge pull request #53897 from liggitt/cluster-info
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>.

Improve generated proxy URLs for cluster-info

Fixes #53927

improves the output of `kubectl cluster-info` to print more qualified URLs, including changing the proxied scheme to `https` if the service port name is `https` or port number is 443

```release-note
NONE
```
2017-10-14 04:46:32 -07:00
Kubernetes Submit Queue 0ba7c52b8c Merge pull request #53458 from dims/fix-pkg-cmd-dependencies
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 pkg/ depends on cmd/ problems

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

Partial fix for https://github.com/kubernetes/kubernetes/issues/53341

**Special notes for your reviewer**:
No logic changes, Just moving things around

**Release note**:

```release-note
NONE
```
2017-10-13 23:56:55 -07:00
Kubernetes Submit Queue 3deab69d3b Merge pull request #53790 from yanxuean/cgroupredundancy
Automatic merge from submit-queue (batch tested with PRs 52959, 53790). 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 redundancy code in setCPUCgroupConfig

fix #53925

Signed-off-by: yanxuean <yan.xuean@zte.com.cn>



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

The check of burstableCPUShares is redundancy. We have done it in MilliCPUToShares. It is responsibility of MilliCPUToShares.
```
func (m *qosContainerManagerImpl) setCPUCgroupConfig(configs map[v1.PodQOSClass]*CgroupConfig) error {
        ........
	// set burstable shares based on current observe state
	burstableCPUShares := MilliCPUToShares(burstablePodCPURequest)
	if burstableCPUShares < uint64(MinShares) {
		burstableCPUShares = uint64(MinShares)
	}
```
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Improveing code.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-10-13 19:19:32 -07:00
Antoine Pelisse f6b66c70bf Do not crash when groupVersion doesn't have a group 2017-10-13 15:01:27 -07:00
Jordan Liggitt 0218cee931
Improve generated proxy URLs for cluster-info 2017-10-13 16:30:12 -04:00
Kubernetes Submit Queue dcac65ae42 Merge pull request #53831 from gnufied/fix-multiattach-error-flake
Automatic merge from submit-queue (batch tested with PRs 51840, 53542, 53857, 53831, 53702). 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 possible flake in multiattach unit test

It is possible that by the time we check for multiattach
error on node, the reconciler loop may not have processed second
volume and hence we are going to retry for multiattach error
on node before giving up and marking the test as failed.

Fixes https://github.com/openshift/origin/issues/16836
2017-10-13 12:44:55 -07:00
Kubernetes Submit Queue e6e23ae163 Merge pull request #53857 from derekwaynecarr/sync-event
Automatic merge from submit-queue (batch tested with PRs 51840, 53542, 53857, 53831, 53702). 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 sync pod throws more detailed events

**What this PR does / why we need it**:
If there are errors in the kubelet sync pod iteration, it is difficult to determine the problem.

This provides more specific events for errors that occur in the syncPod iteration to help perform problem isolation.

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

**Special notes for your reviewer**:
It is safer to dispatch more specific events now that we have an event budget per object enforced via https://github.com/kubernetes/kubernetes/pull/47367

**Release note**:
```release-note
kubelet provides more specific events when unable to sync pod
```
2017-10-13 12:44:52 -07:00
Kubernetes Submit Queue 1ee617c871 Merge pull request #53542 from dashpole/priority_eviction
Automatic merge from submit-queue (batch tested with PRs 51840, 53542, 53857, 53831, 53702). 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 Evictions take Priority into account

Issue: https://github.com/kubernetes/kubernetes/issues/22212
This implements the eviction strategy documented here: https://github.com/kubernetes/community/pull/1162, and discussed here: https://github.com/kubernetes/community/pull/846.
When priority is not enabled, all pods are treated as equal priority.

This PR makes the following changes:

1. Changes the eviction ordering strategy to (usage < requests, priority, usage - requests)
2. Changes unit testing to account for this change in eviction strategy (including tests where priority is disabled).
3. Adds a node e2e test which tests the eviction ordering of pods with different priorities.

/assign @dchen1107 @vishh 
cc @bsalamat @derekwaynecarr 

```release-note
Kubelet evictions take pod priority into account
```
2017-10-13 12:44:50 -07:00
Kubernetes Submit Queue ea5cd00958 Merge pull request #51840 from jcbsmpsn/cleanup-csrs
Automatic merge from submit-queue (batch tested with PRs 51840, 53542, 53857, 53831, 53702). 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>.

New controller to GC CSRs.

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

```release-note
Adds a new controller which automatically cleans up Certificate Signing Requests that are
Approved and Issued, or Denied.
```
2017-10-13 12:44:47 -07:00
Kubernetes Submit Queue 9e792173d0 Merge pull request #53851 from jianglingxia/jlx-deferfunc
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>.

defer func of kubelet volume testing

**What this PR does / why we need it**:
there has some defer func ,I think maybe modify better,thanks!
**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-10-13 10:40:40 -07:00
Derek Carr 54224600ec kubelet syncPod throws specific events 2017-10-13 10:24:09 -04:00
Kubernetes Submit Queue f1d9962fec Merge pull request #53720 from shyamjvs/test-kubemark
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 random string generator to avoid multiple locks & use bit-masking

Ref https://github.com/kubernetes/kubernetes/issues/53327

We recently started seeing a 50% decrease in scheduling throughput (for e.g in kubemark-500 scale job) and turns out https://github.com/kubernetes/kubernetes/pull/53135 introduced it.
The reason is [this call](2caae38d32/plugin/pkg/scheduler/algorithm/predicates/predicates.go (L272)) to create a random 32-length string.
From the code of the `rand` utility (which is being heavily used throughout the system for randomizing object names), I noticed following performance issues:
- to create an n-length string, we are making n calls to `rand.Intn()` each of which does a lock+unlock operation on the RNG.. while just 1 lock+unlock operation is enough for all
- we're choosing one character (from an alphabet of 27 chars) per each random integer.. while we can select 10 characters using a single int63 (by masking and bit-shifting) as 1 character uses just 5 bits of randomness
- the character set is defined as a global slice (mutable), so the compiler needs to fetch length of the slice on each invocation to `len()` (we're making n of those).. while we can just use a const string (immutable) which will make len directly available as a cached constant (yes, go does it!)

This PR is making the above fixes. I'll try to add some benchmarking to measure the difference (as @wojtek-t suggested).

/cc @kubernetes/sig-scalability-misc @kubernetes/sig-scheduling-bugs @kubernetes/sig-api-machinery-misc @wojtek-t @smarterclayton
2017-10-13 06:11:09 -07:00
Davanum Srinivas eda7fbd16a Ignore .import-restrictions when checking against generated docs 2017-10-13 07:09:38 -04:00
Davanum Srinivas 21fdd1c5ed Add import-boss directives
The pkg/api/testing can be removed whem kubeadm splits into
its own repository.
The pkg/kubemark probably will remain as is for the foreseeable
future.
2017-10-13 07:06:22 -04:00
Davanum Srinivas 6d5e1d2bea Drop cmd/gke-certificates-controller from bazel build script 2017-10-13 07:06:21 -04:00
Davanum Srinivas fce40cf8ad Fix license boilerplate 2017-10-13 07:06:21 -04:00
Davanum Srinivas 48433c8773 Remove cmd/kubelet dependency from pkg/kubelet 2017-10-13 07:06:21 -04:00
Davanum Srinivas 2a2b0cbffa Remove cmd/kubelet dependency from pkg/kubelet/volumemanager 2017-10-13 07:06:21 -04:00
Davanum Srinivas 26b11474ca Remove cmd/kubeadm from pkg/controller 2017-10-13 07:06:21 -04:00
Davanum Srinivas a4574bbb04 Make sure pkg/controller/service does not depend on cmd/kubeadm/app 2017-10-13 07:06:21 -04:00
FengyunPan 30e7a5c118 Volunteer to help with sig/openstack
I would like to do some code review/approve for OpenStack cloud
provider and cinder volume.
2017-10-13 16:49:59 +08:00
Kubernetes Submit Queue e51e714ae3 Merge pull request #47621 from danehans/ipallocator
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>.

Updates RangeSize error message and tests for IPv6.

**What this PR does / why we need it**:
Updates the RangeSize function's error message and tests for IPv6. Converts RangeSize unit test to a table test and tests for success and failure cases. This is needed to support IPv6. Previously, it was unclear whether RangeSize supported IPv6 CIDRs. These updates make IPv6 support explicit.

**Which issue this PR fixes**
Partially fixes Issue #1443

**Special notes for your reviewer**:
/area ipv6

**Release note**:
```NONE
```
2017-10-13 01:19:26 -07:00
Maru Newby 15dcb45c4a fed: Move cluster generator & constants from kubectl to kubefed pkg
This will ensure the history of the federation-only files can be
cheaply retained during branch filtering.
2017-10-12 23:44:43 -07:00
WanLinghao b1f85e2dfe This patch improve kubectl cp command from two aspects
A.support soft link better
before this patch
  "kubectl cp" command will copy the soft link to destination as an empty regular file
after this patch
  "kubectl cp" command will behave the same as tar command
  this patch improves it on both from container and to container

B.fix some bugs
1.from container to host
  a.when copy a file ends with '/', it will cause a panic.
    for example, container gakki has a regular file /tmp/test, then run command
    kubectl cp gakki:/tmp/test/ /tmp
    panic happens
  b.when copy a file which does not exist in container, the command ends up without
    any error information

2.from host to container
  a.when run command like
    kubectl cp "" gakki:/tmp
    it will try cp current directory to container, in other words, this command works
    the same as kubectl cp . gakki:/tmp
  b.current cp command will omit an empty directory

modified:   pkg/kubectl/cmd/cp.go
modified:   pkg/kubectl/cmd/cp_test.go
2017-10-13 13:51:53 +08:00
m1093782566 7bb279f74d add m1093782566 to pkg/proxy/OWNERS 2017-10-13 11:39:25 +08:00
Kubernetes Submit Queue 7c75723867 Merge pull request #52383 from dixudx/quote_field_valid_string
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>.

quote valid strings for field validation

**What this PR does / why we need it**:
Some of the declared const vars are empty string `""`, such as

* [`NamespaceAll`, `NamespaceNone`](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/types.go#L197-L200)
* [`HostPathUnset`](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/types.go#L631)

When validating such supported fields, empty string will be printed without quotes, which is kind of ugly.

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

**Special notes for your reviewer**:
/assign @liggitt 

**Release note**:

```release-note
None
```
2017-10-12 20:25:10 -07:00
Kubernetes Submit Queue 2743d0ba22 Merge pull request #53776 from houjun41544/20171012
Automatic merge from submit-queue (batch tested with PRs 53776, 53786, 53352, 51567). 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>.

Delete redundant defination

**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-10-12 19:27:31 -07:00
Kubernetes Submit Queue 53241b931c Merge pull request #53771 from dixudx/update_cluster_printer
Automatic merge from submit-queue (batch tested with PRs 53749, 53642, 53813, 53771, 53762). 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 cluster printer to enable --show-labels

**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 #53729

**Special notes for your reviewer**:

**Release note**:

```release-note
update cluster printer to enable --show-labels
```
2017-10-12 18:22:40 -07:00
jianglingxia 573a89eeb0 defer func of kubelet volume testing 2017-10-13 09:21:54 +08:00
Di Xu 7508afedd3 quote valid strings for field validation 2017-10-13 07:52:16 +08:00
Kubernetes Submit Queue 4548a07c0e Merge pull request #53781 from sttts/sttts-kill-pkg-api-util
Automatic merge from submit-queue (batch tested with PRs 47039, 53681, 53303, 53181, 53781). 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>.

Get rid of pkg/api/util

Old helpers we can replace with apimachinery tools.
2017-10-12 15:45:31 -07:00
Kubernetes Submit Queue dc404d49d4 Merge pull request #53303 from liggitt/discovery-logging
Automatic merge from submit-queue (batch tested with PRs 47039, 53681, 53303, 53181, 53781). 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>.

Avoid fetching entire discovery tree when possible

For specific commands, we use discovery to determine whether a particular resource is available.

We should avoid fetching the entire discovery tree to check a single resource group version. As the number of groups grows, the performance hit and potential to encounter an error also grows.

```release-note
NONE
```
2017-10-12 15:45:26 -07:00
Kubernetes Submit Queue ab56f37100 Merge pull request #47039 from zjj2wry/crb_test
Automatic merge from submit-queue (batch tested with PRs 47039, 53681, 53303, 53181, 53781). 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>.

RBAC: Add test for create clusterrolebindding

**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-10-12 15:45:22 -07:00
Hemant Kumar 68d417d7d8 Fix possibly flake in multiattach unit test
It is possible that by the time we check for multiattach
error on node, the reconciler loop may not have processed second
volume and hence we are going to retry for multiattach error
on node before giving up and marking the test as failed.
2017-10-12 16:27:54 -04:00
David Ashpole 539fddb49d kubelet evictions take priority into account 2017-10-12 13:15:05 -07:00
Shyam Jeedigunta c279a53ca0 Optimize random string generator to avoid multiple locks & use bitmasking 2017-10-12 19:13:17 +02:00
Kubernetes Submit Queue 03adf92aa9 Merge pull request #53753 from derekwaynecarr/log-spam
Automatic merge from submit-queue (batch tested with PRs 53119, 53753, 53795, 52981). 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>.

Reduce log spam in qos container manager

**What this PR does / why we need it**:
excessive log stmts make it hard to debug actual problems.

**Release note**:
```release-note
NONE
```
2017-10-12 08:28:36 -07:00
zhengchuan hu f50e0e7c50 Fix incorrect link in api 2017-10-12 22:50:17 +08:00
Dr. Stefan Schimanski a6f0cd01ee Get rid of pkg/api/util 2017-10-12 16:36:32 +02:00
Kubernetes Submit Queue efe6180806 Merge pull request #53752 from lookuptable/comment
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>.

Update comments in pkg/kubeapiserver/authenticator/config.go

**What this PR does / why we need it**:
Make the comments consistent with the function signatures

**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
```
2017-10-12 06:36:25 -07:00
yanxuean 8adb2181eb remove redundancy code in setCPUCgroupConfig
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-10-12 18:42:18 +08:00
houjun 80c3d2df14 Fix errors in cephfs_test.go 2017-10-12 15:06:01 +08:00
Di Xu 5a9313e10b update cluster printer to enable --show-labels 2017-10-12 14:05:58 +08:00
Kubernetes Submit Queue 4ff6ef4a37 Merge pull request #49361 from xiangpengzhao/svc-test
Automatic merge from submit-queue (batch tested with PRs 53606, 49361). 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>.

Release NodePorts at the end of test cases

**What this PR does / why we need it**:
#49098 reported a flake of HealthCheck NodePort leak and #49099 fixed it. I don't know why I forgot to check other Node Ports in the test cases. Though I haven't encountered such flake yet, it'd be good to release those Node Ports at the end of test cases to avoid flake.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #49548
Thanks @kargakis for reporting #49548!

**Special notes for your reviewer**:
/cc @deads2k @freehan 

**Release note**:

```release-note
NONE
```
2017-10-11 22:41:31 -07:00
Kubernetes Submit Queue 87bd30a142 Merge pull request #53606 from juanvallejo/jvallejo/add-approx-pod-template-factory-method
Automatic merge from submit-queue (batch tested with PRs 53606, 49361). 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 ApproximatePodTemplateForObject factory method

Makes it possible to get at a pod spec template even if an object is scaled to zero, for use with commands that care about pod templates.

**Release note**:

```release-note
NONE
```

Related downstream patch and use-case: https://github.com/openshift/origin/pull/16379

cc @smarterclayton
2017-10-11 22:41:29 -07:00
Kubernetes Submit Queue f60b92a26a Merge pull request #50836 from FengyunPan/auto-get-NodeSecurityGroupID
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 autoprobing node-security-group for openstack cloud provider

1. Support autoprobing node-security-group
2. Support multiple Security Groups for cluster's nodes
3. Fix recreating Security Group for cluster's nodes

This is a part of #50726

**Special notes for your reviewer**:
/assign @anguslees 
/assign @dims 

**Release note**:
```release-note
Support autoprobing node-security-group for openstack cloud provider, Support multiple Security Groups for cluster's nodes.
```
2017-10-11 21:40:16 -07:00
Jordan Liggitt 59c4d7fdf3
Avoid fetching entire discovery tree when possible 2017-10-12 00:27:42 -04:00
Kubernetes Submit Queue 0515895c08 Merge pull request #53684 from dashpole/feature_gate_allocatable_eviction
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 feature gate for allocatable disk eviction

Issue: #52336 
This PR adds the local storage feature gate to local storage allocatable eviction.

cc @kubernetes/sig-node-bugs 
/assign @jingxu97 @dchen1107 

we should target this for 1.7 if possible.

```release-note
fix a bug where disk pressure could trigger prematurely
```
2017-10-11 20:39:32 -07:00
Kubernetes Submit Queue cea1af38e2 Merge pull request #53714 from FengyunPan/fix-SecurityGroupName
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>.

The Securty Group name must be unique

Currently the service's name is not unique, and the Securty Group
name is not unique too. openstack cloud provider will delete the
Securty Group of other loadbalancer service when do a deletion.

OpenStack cloud provider get the ID of Securty Group by name, so the Securty Group name must be unique.
https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go#L1262

**Release note**:
```release-note
NONE
```
2017-10-11 18:49:21 -07:00
Kubernetes Submit Queue eabc7a3553 Merge pull request #53700 from euank/swapReader
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>.

kubelet/cm: remove unneeded fork of 'cat'

Reading a file in Go is perfectly possible without invoking cat.

I also removed an outdated comment.

This is meant to be a trivial/minor code cleanup, nothing more.

```release-note
NONE
```
2017-10-11 17:54:08 -07:00
Di Xu 811447ea0a avoid kubelet converts and validates pods multiple times 2017-10-12 08:10:09 +08:00
Di Xu f2f88204f4 fix azureDisk warns about disk format failure 2017-10-12 08:07:51 +08:00
Kubernetes Submit Queue 7e384479d7 Merge pull request #51215 from juanvallejo/jvallejo/preserve-specified-destination-path
Automatic merge from submit-queue (batch tested with PRs 53668, 53624, 52639, 53581, 51215). 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>.

preserve specified destination path

**Release note**:
```release-note
"kubectl cp" updated to honor destination names 
```

**Before**
```
$ kubectl cp foo_dir pod_name:/tmp/bar_dir
$ kubectl exec pod_name -it -- /bin/sh
sh-4.2$
sh-4.2$ ls /tmp
sh-4.2$ foo_dir
```

**After**
```
$ kubectl cp foo_dir pod_name:/tmp/bar_dir
$ kubectl exec pod_name -it -- /bin/sh
sh-4.2$
sh-4.2$ ls /tmp
sh-4.2$ bar_dir
```


**Notable changes to `kubectl cp` After This Patch**
- Copying a directory `bar_dir` to an existing directory in the pod will copy the directory itself, rather than just the file contents:

```bash
*Before*
> remote-pod-shell$ ls /tmp
                    existing_remote_dir              

$ kubectl cp ./my/local/awesome_dir mypod:/tmp/existing_remote_dir
> remote-pod-shell$ ls /tmp
                    existing_remote_dir
                    awesome_dir
```
```bash
*After*
> remote-pod-shell$ ls /tmp
                    existing_remote_dir              

$ kubectl cp ./my/local/awesome_dir mypod:/tmp/existing_remote_dir
> remote-pod-shell$ ls /tmp
                    existing_remote_dir
> remote-pod-shell$ ls /tmp/existing_remote_dir
                    awesome_dir
```

```
*Before*: Directory contents were merged if a local and remote directory shared the same name
*After*:  A new name will be honored for the copied local directory on the remote pod.
          If a new name was not specified for the local directory being copied, and it shares the
          same name as an already-existing directory on the pod, current behavior will follow and
          its contents will be added to those of the already-existing directory.
```

```
*Before*: If a trailing slash (e.g. kubectl cp ./local/dir pod:/tmp) was not added to a directory
          name in the destination path (...:/tmp vs /tmp/...), when copying to a pod, `kubectl`
          would attempt to copy the local directory under the parent of the remote directory
          rather than inside of it.
*After*:  Slashes do not alter the behavior of the command, or destination of the intended 
          source file or directory. With a command such as (kubectl cp ./local_dir pod:/tmp),
          `local_dir` would be copied inside of <pod:/tmp> (an error is returned if pod:/tmp is
           a file).
```

Related downstream bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1469411

@fabianofranz @kubernetes/sig-cli-misc
2017-10-11 17:00:08 -07:00
Derek Carr 328a12d160 Reduce log spam in qos container manager 2017-10-11 19:47:40 -04:00
Kubernetes Submit Queue 7db90f8b87 Merge pull request #53088 from mtaufen/remove-experimental-deprecated-kubeletconfig
Automatic merge from submit-queue (batch tested with PRs 53204, 53364, 53559, 53589, 53088). 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>.

Mulligan: Remove deprecated and experimental fields from KubeletConfiguration

Revert "Merge pull request #51857 from kubernetes/revert-51307-kc-type-refactor"

This reverts commit 9d27d92420, reversing
changes made to 2e69d4e625.

See original: #51307

We punted this from 1.8 so it could go through an API review. The point
of this PR is that we are trying to stabilize the kubeletconfig API so
that we can move it out of alpha, and unblock features like Dynamic
Kubelet Config, Kubelet loading its initial config from a file instead
of flags, kubeadm and other install tools having a versioned API to rely
on, etc.

We shouldn't rev the version without both removing all the deprecated
junk from the KubeletConfiguration struct, and without (at least
temporarily) removing all of the fields that have "Experimental" in
their names. It wouldn't make sense to lock in to deprecated fields.
"Experimental" fields can be audited on a 1-by-1 basis after this PR,
and if found to be stable (or sufficiently alpha-gated), can be restored
to the KubeletConfiguration without the "Experimental" prefix.

Related issue: https://github.com/kubernetes/kubernetes/issues/53084

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

/cc @kubernetes/api-reviewers
2017-10-11 15:14:47 -07:00
Kubernetes Submit Queue 3aff54f345 Merge pull request #53589 from sttts/sttts-pkg-api-testing
Automatic merge from submit-queue (batch tested with PRs 53204, 53364, 53559, 53589, 53088). 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>.

pkg/api: move *_test.go -> pkg/api/testing

Cleaning up pkg/api, one little step towards pkg/apis/core.
2017-10-11 15:14:45 -07:00
Yang Guan 6860628b46 Update comments in pkg/kubeapiserver/authenticator/config.go
Make the comments consistent with the function signatures
2017-10-11 21:44:00 +00:00
Kubernetes Submit Queue a69e6fb9b3 Merge pull request #53724 from davidstack/master
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>.

update wrong comments
2017-10-11 12:36:31 -07:00
Kubernetes Submit Queue efd6e6a50d Merge pull request #53517 from andrewsykim/improve-ccm-logging
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>.

Log when node is initialized in cloud controller manager

**What this PR does / why we need it**:
Always logs when a node is successfully initialized and raises log level for adding node labels to new nodes. This is useful since the only way to know if CCM is working properly is to check for the taint `node.cloudprovider.kubernetes.io/uninitialized`. 

**Release note**:

```release-note
Log when node is successfully initialized by Cloud Controller Manager
```

cc @luxas @wlan0 @jhorwit2
2017-10-11 10:43:58 -07:00
David Ashpole 8659676408 feature gate local storage allocatable eviction 2017-10-11 09:53:56 -07:00
Michael Taufen 8180536bed Mulligan: Remove deprecated and experimental fields from KubeletConfiguration
Revert "Merge pull request #51857 from kubernetes/revert-51307-kc-type-refactor"

This reverts commit 9d27d92420, reversing
changes made to 2e69d4e625.

See original: #51307

We punted this from 1.8 so it could go through an API review. The point
of this PR is that we are trying to stabilize the kubeletconfig API so
that we can move it out of alpha, and unblock features like Dynamic
Kubelet Config, Kubelet loading its initial config from a file instead
of flags, kubeadm and other install tools having a versioned API to rely
on, etc.

We shouldn't rev the version without both removing all the deprecated
junk from the KubeletConfiguration struct, and without (at least
temporarily) removing all of the fields that have "Experimental" in
their names. It wouldn't make sense to lock in to deprecated fields.
"Experimental" fields can be audited on a 1-by-1 basis after this PR,
and if found to be stable (or sufficiently alpha-gated), can be restored
to the KubeletConfiguration without the "Experimental" prefix.
2017-10-11 09:52:39 -07:00
Kubernetes Submit Queue df072ca97e Merge pull request #53025 from mtaufen/feature-gate-map
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>.

Make feature gates loadable from a map[string]bool

Command line flag API remains the same. This allows ComponentConfig             
structures (e.g. KubeletConfiguration) to express the map structure             
behind feature gates in a natural way when written as JSON or YAML.             
                                                                                
For example:                                                                    
                                                                                
KubeletConfiguration Before:
```
apiVersion: kubeletconfig/v1alpha1
kind: KubeletConfiguration
featureGates: "DynamicKubeletConfig=true,Accelerators=true"
```

KubeletConfiguration After:
```
apiVersion: kubeletconfig/v1alpha1
kind: KubeletConfiguration
featureGates:
  DynamicKubeletConfig: true
  Accelerators: true
```

Fixes: #53024

```release-note
The Kubelet's feature gates are now specified as a map when provided via a JSON or YAML KubeletConfiguration, rather than as a string of key-value pairs.
```

/cc @mikedanese @jlowdermilk @smarterclayton
2017-10-11 09:05:33 -07:00