Commit Graph

16326 Commits (5783a0ec4cb53336e2997a7033a29890905db6ca)

Author SHA1 Message Date
Kubernetes Submit Queue 91b7e1f9c3 Merge pull request #34638 from screeley44/k8-get-sc
Automatic merge from submit-queue

Adding default StorageClass annotation printout for resource_printer and describer and some refactoring

adding ISDEFAULT for _kubectl get storageclass_ output

```
[root@screeley-sc1 gce]# kubectl get storageclass
NAME            TYPE                   ISDEFAULT
another-class   kubernetes.io/gce-pd   NO        
generic1-slow   kubernetes.io/gce-pd   YES       
generic2-fast   kubernetes.io/gce-pd   YES       
```

```release-note
Add ISDEFAULT to kubectl get storageClass output
```

@kubernetes/sig-storage
2016-10-19 11:36:08 -07:00
Dan Williams 40cefcaf8f cloudprovider/gce: canonicalize instance name when returning instance array
'names' is an array of FQDNs.  'instances' is a map indexed by canonicalized
name.  Clearly these two won't always match, so when building the final
instance array to return, make sure to look up map entries by their canonicalized
name.

In the below example, "ocp-master-5pob" is clearly found as a GCE instance
but when building the final instance array it cannot be matched as the code
is looking for "ocp-master-5pob.c.ose-refarch.internal" instead.  The node
is then deleted from the cluster as it cannot be found by the cloud provider.

gce.go:2519] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]): initial node prefix ocp-
gce.go:2530] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]): looking for instances map[ocp-master-5pob:<nil>]
gce.go:2533] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]): getting zone 'europe-west1-c' (remaining 1)
gce.go:2563] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]):    instance name <omitted> not requested
gce.go:2563] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]):    instance name <omitted> not requested
gce.go:2533] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]): getting zone 'europe-west1-b' (remaining 1)
gce.go:2563] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]):    instance name <omitted> not requested
gce.go:2576] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]):    found instance 'ocp-master-5pob' remaining 0
gce.go:2563] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]):    instance name <omitted> not requested
gce.go:2533] ### getInstancesByNames([ocp-master-5pob.c.ose-refarch.internal]): getting zone 'europe-west1-d' (remaining 0)
gce.go:2588] Failed to retrieve instance: "ocp-master-5pob.c.ose-refarch.internal"
gce.go:2624] ### getInstanceByName(ocp-master-5pob.c.ose-refarch.internal): got []: instance not found
gce.go:2626] getInstanceByName/multiple-zones: failed to get instance ocp-master-5pob.c.ose-refarch.internal; err: instance not found
nodecontroller.go:587] Deleting node (no longer present in cloud provider): ocp-master-5pob.c.ose-refarch.internal
nodecontroller.go:664] Recording Deleting Node ocp-master-5pob.c.ose-refarch.internal because it's not present according to cloud provider event message for node ocp-master-5pob.c.ose-refarch.internal
2016-10-19 13:03:58 -05:00
Wojciech Tyczynski 0ced3f43bf Avoid unnecessary reallocations of slice in Cacher 2016-10-19 19:33:33 +02:00
Huamin Chen 10b29de55c remove pv annotation from rbd volume
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-10-19 13:30:33 -04:00
derekwaynecarr 39da9d19f0 Add an informer for StorageClass 2016-10-19 12:26:57 -04:00
Kubernetes Submit Queue d4087d0b73 Merge pull request #35022 from jsafrane/gluster-secrets2
Automatic merge from submit-queue

Remove PV annotations for Gluster provisioner.

Don't store Gluster SotrageClass parameters in annotations, it's insecure.
Instead, expect that there is the StorageClass available at the time
when it's needed by Gluster deleter.

See #34822 for detais

@kubernetes/sig-storage
2016-10-19 08:45:08 -07:00
Kubernetes Submit Queue 5133e1f0df Merge pull request #34683 from asalkeld/cmd/testing/fake
Automatic merge from submit-queue

Move the common test functions from cmd_test.go to cmd/testing/fake.go

**What this PR does / why we need it**:
This is so that we can use NewAPIFactory() from cmd/set/*test.go
Up until now we would get a import loop error.

This commit also adds a basic unit test case for cmd/set/set_image.go

**Which issue this PR fixes**
partial #34592

**Special notes for your reviewer**:
None

**Release note**:
```release-note
NONE
```
2016-10-19 08:03:07 -07:00
Scott Creeley 86f1a94be5 Adding default StorageClass annotation printout for resource_printer 2016-10-19 10:59:07 -04:00
Kubernetes Submit Queue be1996ee64 Merge pull request #35112 from errordeveloper/fix-35105
Automatic merge from submit-queue

Get rid of output line that break automated usage of `kubectl set image`

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

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

**Special notes for your reviewer**: We could consider printing it to stderr, or using `IsTerminal()`, but I went for the simplest thing first.

**Release note**:
```release-note
Make `kubectl set image` easier to script
```
2016-10-19 06:23:38 -07:00
Kubernetes Submit Queue 6b56d7baa2 Merge pull request #34976 from deads2k/api-30-separate-third-party
Automatic merge from submit-queue

separate third party resources from master (moves + consequences)

Remove the third party resource code from the main `Master` struct.  I think we may be able to get this down to particular way to configure/`New` a generic API server.
2016-10-19 06:23:29 -07:00
Kubernetes Submit Queue 8290366a8f Merge pull request #33966 from dims/fix-issue-33375
Automatic merge from submit-queue

Enable local-up-cluster.sh to start with the secured port

related to #33375
2016-10-19 05:40:32 -07:00
Klaus Ma 930cd155ad Did not print 'No resources found.' if error. 2016-10-19 20:40:11 +08:00
Ilya Dmitrichenko 2494462e5f
Get rid of output line that break automated usage of `kubectl set image` (fix #35105) 2016-10-19 13:13:20 +01:00
deads2k f9cbc42581 separate third party resources from master (moves + consequences) 2016-10-19 07:40:58 -04:00
Davanum Srinivas 20d1818d78 Enable local-up-cluster.sh to start with the secured port
Generate a kubeconfig for use with controller-manager, kubelet,
scheduler etc. This kubeconfig should use the secure https
port of the api server with appropriate ca cert for the components
to talk to api server.

With this change, one can set API_PORT=0 to completely switch off
insecure access for testing admission controllers etc.

Fixes #33375
2016-10-19 06:36:01 -04:00
Dr. Stefan Schimanski 08d4fa5c4f Turn APIGroupPrefix into a constant 2016-10-19 11:52:15 +02:00
Michail Kargakis 3d23db53e6 registry: remove redundant PDB deep-copy from eviction REST 2016-10-19 10:33:06 +02:00
Kubernetes Submit Queue 61e0113019 Merge pull request #34906 from luxas/remove_old_networking
Automatic merge from submit-queue

WIP: Remove the legacy networking mode

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
Removes the deprecated configure-cbr0 flag and networking mode to avoid having untested and maybe unstable code in kubelet, see: #33789

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

**Special notes for your reviewer**: There are a lot of deployments who rely on this networking mode. Not sure how we deal with that: force switch to kubenet or just delete the old deployment?

But please review the code changes first (the first commit)

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Removed the deprecated kubelet --configure-cbr0 flag, and with that the "classic" networking mode as well
```

PTAL @kubernetes/sig-network @kubernetes/sig-node @mikedanese
2016-10-19 01:03:39 -07:00
Kubernetes Submit Queue cd44cec587 Merge pull request #34765 from ivan4th/fix-more-typos
Automatic merge from submit-queue

Fix typos
2016-10-19 00:21:11 -07:00
Kubernetes Submit Queue 3fc8cff07d Merge pull request #35071 from thockin/volume-mount-merge-key
Automatic merge from submit-queue

Change merge key for VolumeMount to mountPath

Fixes #34800
2016-10-19 00:21:03 -07:00
Michal Rostecki 957776bd9e kubectl: Fix --help output for kubectl create service loadbalancer
Fixes #35086
2016-10-19 09:06:22 +02:00
Wojciech Tyczynski 8040719d7f Avoid computing key func multiple times in cacher 2016-10-19 08:38:18 +02:00
Wojciech Tyczynski f10b0205e7 Store keys in watchCache store 2016-10-19 08:38:18 +02:00
Wojciech Tyczynski 9895f337ee Avoid unnecessary copies in cacher 2016-10-19 08:33:58 +02:00
ymqytw 55c6116d66 address comments and add tests 2016-10-18 22:55:15 -07:00
Kubernetes Submit Queue db2d8e0cc4 Merge pull request #34819 from feiskyer/AppArmor
Automatic merge from submit-queue

CRI: add docs for AppArmor and Seccomp

This PR adds docs for AppArmor and Seccomp in CRI.

cc/ @yujuhong @Random-Liu
2016-10-18 21:52:04 -07:00
guangxuli 2c9e84f50f add a clean code for TestCanSupport
update other location

forgot two files need to be updated
2016-10-19 12:35:46 +08:00
Kubernetes Submit Queue 2ea4e1f066 Merge pull request #33352 from smarterclayton/unified_defaulters
Automatic merge from submit-queue

Split conversion and defaulting

Separate conversion and defaulting.   Defaulting occurs mixed with conversion today - change the server so that the `VersioningCodec` performs defaulting on the external type during decoding.  

* Add a new method to `Scheme` - `func (*runtime.Scheme) Default(runtime.Object)` - that takes an object and performs defaulting.  
* Call `Default` during decoding and at static initialization time
* Use the new `defaulter-gen` to generate top level object defaulters (`v1.Pod`) at build time for any type that needs to perform defaulting.  
* Add tests and alter the existing code to adapt as necessary
* Fix a few bugs in conversions that depended on defaulting behavior

---

Step 1 of decoupling conversion and defaulting. The generator will assist in creating top level defaulters that in a single method invoke all nested defaulters, preventing the need to recurse via reflection or conversion. These top level defaulters will be registered in the scheme and invoked instead of the nested recursion path. This will set the stage for a future generator, capable of creating defaulters from embedded struct tags on external types. However, we must gradually switch these over.

The immediate goal here is to split defaulting and conversion so that the unsafe convertor can be used to maximum potential (we would be able to use direct memory conversion for any identical nested struct, even those that must be defaulted).

The generator uses `k8s:defaulter-gen=TypeMeta` on most public packages to flag any top level type that has defaulters to get a `SetObjectDefaults_NAME` function created (types that don't have defaulters won't have functions).  This also creates a `RegisterDefaults` method that applies a default to an interface{} and returns true if the object was handled.  Existing defaults are left as is.

Add a test to verify old and new path generate the same outcomes.  Defaulter will move to gengo before this is merged, and subsequent PRs will remove defaulting during conversion and have the VersioningCodec apply defaults.
2016-10-18 20:34:13 -07:00
Kubernetes Submit Queue 29af9853fe Merge pull request #35047 from deads2k/controller-11-rs-flakes
Automatic merge from submit-queue

fix more RS controller flakes

I saw another flake:

```
panic: Fail in goroutine after TestUpdatePods has completed
/usr/local/go/src/runtime/panic.go:500 +0x1ae
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/util/runtime/runtime.go:56 +0x17d
/usr/local/go/src/runtime/panic.go:458 +0x271
/usr/local/go/src/testing/testing.go:412 +0x182
/usr/local/go/src/testing/testing.go:484 +0x95
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/replicaset/replica_set_test.go:619 +0x1d2
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/replicaset/replica_set.go:414 +0x191
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/replicaset/replica_set.go:403 +0x39
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/replicaset/replica_set.go:169 +0x42
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/util/wait/wait.go:87 +0x70
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/util/wait/wait.go:88 +0xbe
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/util/wait/wait.go:49 +0x5b
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/replicaset/replica_set_test.go:625 +0x369
```

This resolves that by separating the listers from the watch like it used to be in this set of tests.  The tests were like this before the refactor.  I think they limit utility, but I'm not prepared to re-write them all.

@kargakis
2016-10-18 19:52:48 -07:00
Kubernetes Submit Queue 20841a5b0e Merge pull request #34537 from AdoHe/get_info
Automatic merge from submit-queue

kubectl get print filter info use verbose

add a quick fix #34469
2016-10-18 19:10:27 -07:00
Tim St. Clair 05669255d1
Add ExecSync method 2016-10-18 19:03:10 -07:00
Kubernetes Submit Queue 103dc654a9 Merge pull request #35023 from k82cn/remove_empty_line
Automatic merge from submit-queue

Removed empty line.
2016-10-18 18:27:29 -07:00
Clayton Coleman 957c0955aa
Run defaulting on the scheduler startup 2016-10-18 21:07:35 -04:00
Clayton Coleman 3ee591d7ab
Invoke init container defaulting in conversion
Because annotations...

Remove old references to DefaultingInterface in manual conversions.
2016-10-18 21:07:35 -04:00
Clayton Coleman 1694cfb72d
Make defaulting part of versioning codec
Most normal codec use should perform defaulting. DirectCodecs should not
perform defaulting. Update the defaulting_test to fuzz the list of known
defaulters. Use the new versioning.NewDefaultingCodec() method.
2016-10-18 21:07:35 -04:00
Clayton Coleman 742fb698d4
generated: Remove defaulting from conversion 2016-10-18 21:07:34 -04:00
Clayton Coleman 4f8d1a86e5
Add a defaulting test that verifies old and new defaults are equivalent 2016-10-18 21:07:34 -04:00
Clayton Coleman 89b3a0d863
Register new defaulting functions 2016-10-18 21:07:34 -04:00
Clayton Coleman 745690a2d4
generated: Defaulters 2016-10-18 21:07:33 -04:00
Clayton Coleman 4324e39393
Flag all packages as needing defaulters 2016-10-18 21:07:33 -04:00
Clayton Coleman 5062406b77
Hand generated conversion should check nil 2016-10-18 21:07:32 -04:00
Clayton Coleman 0aa8da19a9
Move old defaulters to public functions
Also make Deployment defaulting resilient to fuzzing
2016-10-18 21:07:32 -04:00
Clayton Coleman 68a9983ec7
Add a new Default() method on Scheme
Allow defaulter functions to be registered with the scheme.
2016-10-18 21:07:32 -04:00
Tim St. Clair 21564aafed
stdin should be a bool, not a byte stream 2016-10-18 17:17:05 -07:00
Kubernetes Submit Queue a31482207f Merge pull request #34960 from sdminonne/serviceaccount_informer
Automatic merge from submit-queue

To add service account informer

@deads2k  this PR adds ServiceAccount informer as discussed [here](https://github.com/openshift/origin/pull/11330#issuecomment-253216303)
2016-10-18 16:21:41 -07:00
ymqytw 3bd3c9570f fix test 2016-10-18 16:01:51 -07:00
ymqytw 7922a2a105 wait until the pods are deleted completely 2016-10-18 16:01:51 -07:00
Angus Salkeld d58554a647 Move the common test functions from cmd_test.go to cmd/testing/fake.go
This is so that we can use NewAPIFactory() from cmd/set/*test.go
Up until now we would get a import loop error.

This commit also adds a basic unit test case for cmd/set/set_image.go
2016-10-19 08:53:26 +10:00
Tim Hockin 837443d37a Change merge key for VolumeMount to mountPath 2016-10-18 15:27:12 -07:00
Kubernetes Submit Queue 4b7024efe7 Merge pull request #27784 from deads2k/catch-mutators
Automatic merge from submit-queue

add optional mutation checks for shared informer cache

We need to make sure that no one is mutating caches if they're using a shared informer.  It is important that whatever is tracking those changes gets the object *before* anyone else possibly could.

This adds the ability to track the original objects in the cache and their current values.  Go doesn't have an exit hook or a way to say "wait for non-daemon go-funcs to complete before exit", so this runs a gofunc on a loop that can panic the entire process.  It's gated behind an env var.

@derekwaynecarr did I get the right spots to make sure that e2e runs with this flag?
@smarterclayton @kubernetes/rh-cluster-infra
2016-10-18 14:38:57 -07:00
Kubernetes Submit Queue f39e86c0a5 Merge pull request #34474 from liggitt/connection-info-refactor
Automatic merge from submit-queue

Remove static kubelet client, refactor ConnectionInfoGetter

Follow up to https://github.com/kubernetes/kubernetes/pull/33718

* Collapses the multi-valued return to a `ConnectionInfo` struct
* Removes the "raw" connection info method and interface, since it was only used in a single non-test location (by the "real" connection info method)
* Disentangles the node REST object from being a ConnectionInfoProvider itself by extracting an implementation of ConnectionInfoProvider that takes a node (using a provided NodeGetter) and determines ConnectionInfo
* Plumbs the KubeletClientConfig to the point where we construct the helper object that combines the config and the node lookup. I anticipate adding a preference order for choosing an address type in https://github.com/kubernetes/kubernetes/pull/34259
2016-10-18 13:20:25 -07:00
Kubernetes Submit Queue 84aa5f695f Merge pull request #35038 from sjenning/nfs-nonblock-reader2
Automatic merge from submit-queue

kubelet: storage: don't hang kubelet on unresponsive nfs

Fixes #31272 

Currently, due to the nature of nfs, an unresponsive nfs volume in a pod can wedge the kubelet such that additional pods can not be run.

The discussion thus far surrounding this issue was to wrap the `lstat`, the syscall that ends up hanging in uninterruptible sleep, in a goroutine and limiting the number of goroutines that hang to one per-pod per-volume.

However, in my investigation, I found that the callsites that request a listing of the volumes from a particular volume plugin directory don't care anything about the properties provided by the `lstat` call.  They only care about whether or not a directory exists.

Given that constraint, this PR just avoids the `lstat` call by using `Readdirnames()` instead of `ReadDir()` or `ReadDirNoExit()`

### More detail for reviewers
Consider the pod mounted nfs volume at `/var/lib/kubelet/pods/881341b5-9551-11e6-af4c-fa163e815edd/volumes/kubernetes.io~nfs/myvol`.  The kubelet wedges because when we do a `ReadDir()` or `ReadDirNoExit()` it calls `syscall.Lstat` on `myvol` which requires communication with the nfs server.  If the nfs server is unreachable, this call hangs forever.

However, for our code, we only care what about the names of files/directory contained in `kubernetes.io~nfs` directory, not any of the more detailed information the `Lstat` call provides.  Getting the names can be done with `Readdirnames()`, which doesn't need to involve the nfs server.

@pmorie @eparis @ncdc @derekwaynecarr @saad-ali @thockin @vishh @kubernetes/rh-cluster-infra
2016-10-18 12:37:31 -07:00
derekwaynecarr 555231fad7 PVC informer lister supports listing 2016-10-18 14:36:33 -04:00
Kubernetes Submit Queue b77e13444f Merge pull request #34939 from wojtek-t/throttle_retried_requests
Automatic merge from submit-queue

Throttle retried requests in client

Fix #34938
2016-10-18 10:08:53 -07:00
deads2k 2c42936703 fix more RS controller flakes 2016-10-18 12:58:48 -04:00
Kubernetes Submit Queue 01c31b380d Merge pull request #34997 from vmware/fix-kube-vsphere.kerneltime
Automatic merge from submit-queue

Fix kube vsphere.kerneltime

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
This fixes kube-up to correctly install and configure on vSphere and avoid panics when only a single ESX(hypervisor) is used instead of a cluster.

**Which issue this PR fixes** 
fixes #34992
fixes #34847

**Special notes for your reviewer**:

We plan to cherry pick this into 1.4 release branch as well Ref: https://github.com/kubernetes/kubernetes/pull/34993
2016-10-18 09:26:18 -07:00
Kubernetes Submit Queue c592a46e16 Merge pull request #28300 from pweil-/psp-seccomp
Automatic merge from submit-queue

Add PSP support for seccomp profiles

Seccomp support for PSP.  There are still a couple of TODOs that need to be fixed but this is passing tests.

One thing of note, since seccomp is all being stored in annotations right now it breaks some of the assumptions we've stated for the provider in terms of mutating the passed in pod.  I've put big warning comments around the pieces that do that to make sure it's clear and covered the rollback in admission if the policy fails to validate.

@sttts @pmorie @erictune @smarterclayton @liggitt
2016-10-18 09:26:09 -07:00
Rodolfo Carvalho c75ddfe76d Fix some typos 2016-10-18 18:24:38 +02:00
Kubernetes Submit Queue e62a8b9167 Merge pull request #34962 from deads2k/cotnroller-08-rs-controller
Automatic merge from submit-queue

convert replica set controller to shared informer

Switches the replicaset to a shared informer.

@kargakis fyi
2016-10-18 07:20:37 -07:00
Seth Jennings da3683e2b7 kubelet: storage: don't hang kubelet on unresponsive nfs 2016-10-18 08:45:40 -05:00
Kubernetes Submit Queue 2f990ac429 Merge pull request #34979 from deads2k/tpr-04-storage-post-hook
Automatic merge from submit-queue

convert TPR controller to posthook instead of disable flag

Converts the third party resource controller into a posthook using a loopback client instead going direct to etcd.  This let's us eliminate more flags and special-casing during initialization.  Also, using a client brings us closer to building this without side-effects for downstream composers.
2016-10-18 06:39:41 -07:00
deads2k aee54ae57e add optional mutation checks for shared informer cache 2016-10-18 09:19:38 -04:00
Kubernetes Submit Queue 1dfae3633d Merge pull request #34981 from deads2k/cli-03-supress-error
Automatic merge from submit-queue

glog non-fatal, usually unimportant error instead of fmt

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

This particular message isn't usually important, so demote it to glog.
2016-10-18 05:59:14 -07:00
Kubernetes Submit Queue 6e2f5f8f6d Merge pull request #28742 from jessfraz/test-go1.7rc1
Automatic merge from submit-queue

Update to go 1.7

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

Closes #33070
Closes #32999

```release-note
Updated Go to 1.7
```


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

This is to test go version 1.7
2016-10-18 05:59:04 -07:00
deads2k b471398f1f convert replica set controller to shared informer 2016-10-18 08:13:37 -04:00
Kubernetes Submit Queue 67732d7383 Merge pull request #34967 from deads2k/api-27-fix-version
Automatic merge from submit-queue

make version an explicit choice so zero config and customized work

Makes `/version` key off of setting the version.  This allows composers to add a version that is correct.
2016-10-18 05:07:02 -07:00
deads2k ea1eefa7ff glog non-fatal, usually unimportant error instead of fmt 2016-10-18 07:58:20 -04:00
Kubernetes Submit Queue 27a7c01bce Merge pull request #34975 from deads2k/api-29-dead-fields
Automatic merge from submit-queue

remove write only field

Happened upon a completely dead field.
2016-10-18 03:35:37 -07:00
Kubernetes Submit Queue e6cc8ff149 Merge pull request #34498 from mml/remotecommand-golint
Automatic merge from submit-queue

Fix lint error in remotecommand.go

Before:

```
pkg/client/unversioned/remotecommand/remotecommand.go:101:9: should omit type http.RoundTripper from declaration of var rt; it will be inferred from the right-hand side

Please fix the above errors. You can test via "golint" and commit the result.
```
2016-10-18 03:35:21 -07:00
Klaus Ma 4b6cd9aece Removed empty line. 2016-10-18 17:14:05 +08:00
Jerzy Szczepkowski f495e7322c HPA: fixed wrong count for target replicas calculations.
HPA: fixed wrong count for target replicas calculations (#34821).
2016-10-18 10:20:27 +02:00
Jan Safranek 2b2508ba15 Remove PV annotations for Gluster provisioner.
Don't store Gluster SotrageClass parameters in annotations, it's insecure.
Instead, expect that there is the StorageClass available at the time
when it's needed by Gluster deleter.
2016-10-18 09:54:35 +02:00
Salvatore Dario Minonne a745872b94 To add service account informer 2016-10-18 09:24:54 +02:00
Kubernetes Submit Queue c19569f03f Merge pull request #34502 from fabianofranz/cli_usability_improvements
Automatic merge from submit-queue

Improvements to CLI usability and maintainability

Improves `kubectl` from an usability perspective by

1. Fixing how we handle terminal width in help. Some sections like the flags use the entire available width, while others like long descriptions breaks lines but don't follow a well established max width (screenshot below). This PR adds a new responsive writer that will adjust to terminal width and set 80, 100, or 120 columns as the max width, but not more than that given POSIX best practices and recommendations for better readability.
![terminal_width](https://cloud.githubusercontent.com/assets/158611/19253184/b23a983e-8f1f-11e6-9bae-667dd5981485.png)
2. Adds our own normalizers for long descriptions and cmd examples which allows us better control about how things like lists, paragraphs, line breaks, etc are printed. Features markdown support. Looks like `templates.LongDesc` and `templates.Examples` instead of `dedent.Dedend`.
3. Allows simple reordering and reuse of help and usage sections.
3. Adds `verify-cli-conventions.sh` which intends to run tests to make sure cmd developers are using what we propose as [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md). Just a couple simple tests for now but the framework is there and it's easy to extend.
4. Update [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md) to use our own normalizers instead of `dedent.Dedent`.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Improves how 'kubectl' uses the terminal size when printing help and usage.
```

@kubernetes/kubectl
2016-10-17 23:41:23 -07:00
Kubernetes Submit Queue 3193bedb33 Merge pull request #34948 from wojtek-t/avoid_unnecessary_allocation
Automatic merge from submit-queue

Avoid unnecessary allocation

This is supposed to avoid unnecessary memory allocations.

PodToSelectableFields seems to be the biggest contributor to memory allocations:
```
Showing top 10 nodes out of 247 (cum >= 83166442)
      flat  flat%   sum%        cum   cum%
1796823715 31.09% 31.09% 1796823715 31.09%  k8s.io/kubernetes/pkg/registry/core/pod.PodToSelectableFields
 530856268  9.19% 40.28%  530856268  9.19%  k8s.io/kubernetes/pkg/storage.NamespaceKeyFunc
 241505351  4.18% 44.46%  241505351  4.18%  reflect.unsafe_New
...
```
2016-10-17 22:54:26 -07:00
Kubernetes Submit Queue 7414cafbeb Merge pull request #34860 from mbohlool/optional
Automatic merge from submit-queue

+optional tag for OpenAPI spec

OpenAPI rely on "omitempty" json tag to determine if a field is optional or not. This change will add "+optional" tag to all fields with "omitempty" json tag and support the tag in OpenAPI spec generator.
2016-10-17 22:07:00 -07:00
Kubernetes Submit Queue f98c06b1bb Merge pull request #33901 from jmcarp/issue-31984
Automatic merge from submit-queue

Escape special characters in jsonpath field names.

There may be a better way to do this, but this seemed like the simplest possible version.

Example: `{.items[*].metadata.labels.kubernetes\.io/hostname}`

[Resolves #31984]
2016-10-17 18:29:31 -07:00
Tim St. Clair be7834dc4a
Add streaming methods to CRI API 2016-10-17 18:28:03 -07:00
Matt Liggett 805a740d64 Fix lint error in remotecommand.go
Before:

pkg/client/unversioned/remotecommand/remotecommand.go:101:9: should omit type http.RoundTripper from declaration of var rt; it will be inferred from the right-hand side

Please fix the above errors. You can test via "golint" and commit the result.
2016-10-17 17:26:27 -07:00
Kubernetes Submit Queue 1da120ca8a Merge pull request #34961 from kubernetes/revert-32485-e2e-provisioning-class
Automatic merge from submit-queue

Revert "Add e2e tests for storageclass"

Reverts kubernetes/kubernetes#32485

This PR broke the multizone tests on GCE/GKE, and broke the AWS tests, e.g.:
* https://k8s-testgrid.appspot.com/google-aws
* https://k8s-testgrid.appspot.com/google-gke#gke-multizone
* https://k8s-testgrid.appspot.com/google-gke#gci-gke-multizone
Suggest revert. 

Fixes #34794

cc @k8s-oncall
2016-10-17 17:12:20 -07:00
Tim St. Clair bd80da5822
Don't report FS stats for system containers 2016-10-17 16:57:17 -07:00
Ritesh H Shukla 26db528da3 Fix panic in vSphere when deploying on a single ESX node.
Use ComputeResource instead of ClusterComputeResource when
initializing the vSphere Cloud Provider
2016-10-17 23:42:59 +00:00
deads2k 1423654295 convert TPR controller to posthook instead of disable flag 2016-10-17 16:24:02 -04:00
deads2k 5a9b16d40a make version an explicit choice so zero config and customized work 2016-10-17 16:10:07 -04:00
derekwaynecarr 3c0b35d6b1 Add LimitRange informer 2016-10-17 16:00:26 -04:00
deads2k cd59d9b99f remove write only field 2016-10-17 15:33:43 -04:00
pweil- 49e14744db support seccomp in psp 2016-10-17 14:49:02 -04:00
Zach Loafman 22352d2844 Revert "Add e2e tests for storageclass" 2016-10-17 10:32:27 -07:00
mbohlool 0191433d58 Generated protobufs 2016-10-17 09:11:20 -07:00
mbohlool 25afcc5522 Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
Kubernetes Submit Queue f85d8f2e66 Merge pull request #34951 from wojtek-t/tune_cacher_logs
Automatic merge from submit-queue

Reduce amount of annoying logs in cacher
2016-10-17 08:45:00 -07:00
Kubernetes Submit Queue b008c683ec Merge pull request #34548 from kargakis/estimate-available-from-rs
Automatic merge from submit-queue

controller: set minReadySeconds in deployment's replica sets

* Estimate available pods for a deployment by using minReadySeconds on
the replica set.
* Stop requeueing deployments on pod events, superseded by following the
replica set status.
* Cleanup redundant deployment utilities

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

@kubernetes/deployment ptal
2016-10-17 08:44:51 -07:00
Wojciech Tyczynski 0f2270698c Reduce amount of annoying logs in cacher 2016-10-17 16:15:24 +02:00
Justin Santa Barbara ad6d842a65 Create hostNetwork pods even if network plugin not ready 2016-10-17 10:12:14 -04:00
Fabiano Franz 3f7579cacb Tools for checking CLI conventions 2016-10-17 11:50:02 -02:00
Fabiano Franz 4d641c4911 Use responsive writer in help 2016-10-17 11:50:02 -02:00
Fabiano Franz f6d1ac72a0 Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
Lucas Käldström 565c5e6268 Remove unused net 2016-10-17 16:47:35 +03:00
Fabiano Franz 6f66c0eafa Add normalizers for cmd examples and descriptions 2016-10-17 11:31:38 -02:00
Fabiano Franz 6d6aeb0027 Add responsive writers which adjust to terminal sizes 2016-10-17 11:31:34 -02:00
Lucas Käldström 72c36c8a1b Run update-all 2016-10-17 16:25:25 +03:00
Wojciech Tyczynski c6b098068d Allocate podFields map with a correct hint for size 2016-10-17 15:07:15 +02:00
Wojciech Tyczynski 422121f93a Avoid unnecessary map allocation 2016-10-17 15:01:00 +02:00
Kubernetes Submit Queue 418a1d3093 Merge pull request #34935 from wojtek-t/addtional_tracing_step
Automatic merge from submit-queue

Extend tracing in watchCache
2016-10-17 03:19:55 -07:00
Kubernetes Submit Queue fce3b95345 Merge pull request #34752 from ivan4th/fix-misspellings-of-receive
Automatic merge from submit-queue

Fix misspellings of 'receive'

Fix typos
2016-10-17 03:19:18 -07:00
Wojciech Tyczynski 564fc0cc80 Throttle retried requests in client 2016-10-17 11:45:35 +02:00
Wojciech Tyczynski 6d06a384ad Extend tracing in watchCache 2016-10-17 11:22:59 +02:00
Wojciech Tyczynski 4d5ac91f88 Add tracing to listing in Cacher 2016-10-17 08:58:40 +02:00
Lukasz Zajaczkowski b7da874789 Add NodePort value in kubectl output 2016-10-17 07:57:34 +02:00
Kubernetes Submit Queue 609b9e5124 Merge pull request #31881 from guangxuli/get_docker_auth
Automatic merge from submit-queue

make function ReadDockerConfigFile more flexible

In our code, the public function `ReadDockerConfigFile` looks like not enough flexible:
when I want to use this function to get docker config info from a specific path, I have to call  `SetPreferredDockercfgPath`, and then the setting preferredPath will be valid in function  `ReadDockerConfigFile`.  I know in our code, we call  `SetPreferredDockercfgPath` in one place ,then call `ReadDockerConfigFile` in another place, it was not in same context. But it looks like not thread safety. 
 I think if user who use our code want to get docker config from a specific path, it is reasonable to call directly `ReadDockerConfigFile ` with a dockerconfigPath argument, and it can avoid some scenarios that thread is not safety . 
I add a test case for this function.
2016-10-16 11:41:08 -07:00
Lucas Käldström 0800df74ab Remove the legacy networking mode --configure-cbr0 2016-10-16 21:26:41 +03:00
Jordan Liggitt a082a2e749
Remove static kubelet client, refactor ConnectionInfoGetter 2016-10-15 22:15:04 -04:00
Kubernetes Submit Queue 3f4c438946 Merge pull request #34836 from mikedanese/prune-1
Automatic merge from submit-queue

kubectl: apply prune should fallback to basic delete when a resource has no reaper

Fixes #34790

cc @kubernetes/kubectl @MrHohn
2016-10-15 18:38:20 -07:00
Kubernetes Submit Queue 8b6cebcb35 Merge pull request #34711 from wojtek-t/serializable_get
Automatic merge from submit-queue

Change etcd Get operation to serializable

Ref https://github.com/kubernetes/kubernetes/issues/34709
2016-10-15 17:48:23 -07:00
Kubernetes Submit Queue dc6117f233 Merge pull request #34721 from juanvallejo/allow-callers-to-bypass-cmdutil-checkerr-logging
Automatic merge from submit-queue

Allow callers to bypass cmdutil.CheckError() logging

**Release note**:
```release-note
release-note-none
```

This patch is originally from:
https://github.com/kubernetes/kubernetes/pull/25451 (eedb67a30d)

Simplifies code where clients are writing their own errors, and want to
terminate with an exit code.

cc @smarterclayton
2016-10-15 16:34:36 -07:00
Kubernetes Submit Queue db80dd3339 Merge pull request #34854 from deads2k/cli-02-restmaper
Automatic merge from submit-queue

attempt to use discovery RESTMapper and fallback if we can't

Updates `kubectl` to always attempt discovery regardless of server version.  This is needed to extension servers.
2016-10-15 13:46:40 -07:00
Kubernetes Submit Queue b988eed233 Merge pull request #34848 from deads2k/rbac-16-fix-authorization-filter
Automatic merge from submit-queue

you can be authorized and have a failure

Fix the authorization filter to allow you through and to avoid showing internal errors to users when authorization failed.
2016-10-15 13:00:25 -07:00
Kubernetes Submit Queue c32a05333b Merge pull request #32671 from soltysh/generator_options
Automatic merge from submit-queue

Update run flags to point to generators docs

@janetkuo you've requested that in https://github.com/kubernetes/kubernetes/pull/32484#issuecomment-246840562 I'm opening this PR but like you I don't like the length of the descriptions already. The other problem with this is that there's not clean docs for a user to figure out what the generators are. I've stumbled upon this several times and I always found myself looking into the code :/ How about adding new flag/subcommand that will give you more information about generators and we'd move all those `--restart` and `--generator` information into specific generator info and present at the top level only general information?
2016-10-15 12:17:29 -07:00
Kubernetes Submit Queue 5ff8829b32 Merge pull request #34503 from derekwaynecarr/fix-qos
Automatic merge from submit-queue

Fix edge case in qos evaluation

If a pod has a container C1 and C2, where sum(C1.requests, C2.requests) equals (C1.Limits), the code was reporting that the pod had "Guaranteed" qos, when it should have been Burstable.

/cc @vishh @dchen1107
2016-10-15 12:17:11 -07:00
Kubernetes Submit Queue fd52ae5215 Merge pull request #31903 from screeley44/k8-validation-test
Automatic merge from submit-queue

Add unit test for bad ReclaimPolicy and valid ReclaimPolicy in /pkg/api/validation

unit tests for validation.go regarding PersistentVolumeReclaimPolicy (bad value and good value)

see PR: #30304
2016-10-15 11:36:07 -07:00
Kubernetes Submit Queue 4dbd657e67 Merge pull request #34342 from justinsb/fix_typo_initializing
Automatic merge from submit-queue

Fix typo: initilizing -> initializing
2016-10-15 09:31:53 -07:00
Kubernetes Submit Queue 3f8b03aafd Merge pull request #32349 from lojies/execerrnil
Automatic merge from submit-queue

when err is nil,remove it from glog

err can be nil here.
2016-10-15 09:31:45 -07:00
Kubernetes Submit Queue d21af56e05 Merge pull request #34802 from ivan4th/remove-duplicated-code-in-kubectl-portforward-test
Automatic merge from submit-queue

Remove duplicated code in kubectl portforward test
2016-10-15 09:31:28 -07:00
Kubernetes Submit Queue 936bb64a9c Merge pull request #34808 from ivan4th/remove-duplicate-code-from-kubectl-describe
Automatic merge from submit-queue

Remove duplicate code from kubectl describe
2016-10-15 08:09:55 -07:00
Wojciech Tyczynski 81779360de Accept Quorum parameter in etcd3. 2016-10-15 16:53:56 +02:00
Kubernetes Submit Queue 864a7bacaa Merge pull request #34828 from deads2k/api-26-apiserver-annoyance
Automatic merge from submit-queue

default serializer

Everyone uses the same serializer.  Set it as the default, but still allow someone to take control if they want.

Found while trying to use genericapiserver for composition.
2016-10-15 07:29:59 -07:00
Kubernetes Submit Queue 9174429776 Merge pull request #33546 from k82cn/k8s_15834
Automatic merge from submit-queue

Updated err message when retrieving resources by name with --all-name…

fixes #15834
2016-10-15 06:50:00 -07:00
Kubernetes Submit Queue 88d6d7a677 Merge pull request #34807 from luxas/kubeadm_reset
Automatic merge from submit-queue

Implement kubeadm reset

@kubernetes/sig-cluster-lifecycle
2016-10-15 06:10:36 -07:00
Kubernetes Submit Queue a010d3b195 Merge pull request #34028 from juanvallejo/jvallejo/add-dry-run-flag-kubectl-apply
Automatic merge from submit-queue

add --dry-run flag to `kubectl apply, kubectl create`

Partially addresses https://github.com/kubernetes/kubernetes/issues/11488

**Release note**:
```release-note
release-note-none
```

Related StackOverflow:
http://stackoverflow.com/questions/38824409/validate-openshift-objects-defined-in-yaml-before-actually-applying-or-executing

This patch adds a `--dry-run` flag to the `apply` command in order to
allow validation of objects, without patching or creating them. If a
`--dry-run` flag is present and no validation errors are found, the
command will exit before "configuring" or creating any objects.

@ncdc @fabianofranz
2016-10-15 05:30:40 -07:00
Kubernetes Submit Queue c526657a2a Merge pull request #32434 from smarterclayton/diff_improvements
Automatic merge from submit-queue

ObjectReflectDiff needs a few more checks for nil
2016-10-15 03:33:08 -07:00
Kubernetes Submit Queue a38fc047e2 Merge pull request #34615 from Calpicow/master
Automatic merge from submit-queue

Use same SSH tunnel as kubelet

Provides a secure workaround for #11816 by having kube-apiserver use the same SSH tunnel as the kubelet it is trying to connect to. Use in conjunction with iptables or kubelet `--address=127.0.0.1`. The latter will break heapster.

Will fallback to random behavior if the tunnel cannot be found.
2016-10-15 02:53:08 -07:00
Kubernetes Submit Queue f418cd3d46 Merge pull request #34426 from dagnello/lb-nodeport-update
Automatic merge from submit-queue

Openstack: Update lb member when node port changes

Ensures lb members are update if node port changes.

cc @suonto
2016-10-15 02:13:14 -07:00
Lucas Käldström ecdaa7195a Implement kubeadm reset 2016-10-15 11:58:06 +03:00
Kubernetes Submit Queue 560c46574e Merge pull request #34817 from gmarek/podgc
Automatic merge from submit-queue

PodGCController waits for informer sync before doing anything.
2016-10-15 01:32:05 -07:00
Kubernetes Submit Queue 13196527cf Merge pull request #34759 from caesarxuchao/remove-unversioned
Automatic merge from submit-queue

Remove imports of "pkg/client/unversioned" in "pkg/controller"

We are trying to deprecate "pkg/client/unversioned", see https://github.com/kubernetes/kubernetes/issues/25442.

Also part of https://github.com/kubernetes/kubernetes/issues/29934.
2016-10-15 00:10:15 -07:00
Kubernetes Submit Queue e5cdc95b85 Merge pull request #34767 from ivan4th/fix-more-typos-1
Automatic merge from submit-queue

Fix typos
2016-10-14 23:30:23 -07:00
Kubernetes Submit Queue c0fea2a1e2 Merge pull request #34862 from ymqytw/fix_edit_panic
Automatic merge from submit-queue

fix error handling

Add missing error handling mentioned in [#33250 Comment](https://github.com/kubernetes/kubernetes/pull/33250#issuecomment-253920315)
@janetkuo
2016-10-14 23:30:15 -07:00
Kubernetes Submit Queue c0bd6e8ea5 Merge pull request #33958 from juanvallejo/jvallejo/add-global-timeout-flag
Automatic merge from submit-queue

Add global timeout flag

**Release note**:
```release-note
Add a new global option "--request-timeout" to the `kubectl` client
```

UPSTREAM: https://github.com/kubernetes/client-go/pull/10

This patch adds a global timeout flag (viewable with `kubectl -h`) with
a default value of `0s` (meaning no timeout).

The timeout value is added to the default http client, so that zero
values and default behavior are enforced by the client.

Adding a global timeout ensures that user-made scripts won't hang for an
indefinite amount of time while performing remote calls (right now, remote
calls are re-tried up to 10 times when each attempt fails, however, there is
no option to set a timeout in order to prevent any of these 10 attempts from
hanging indefinitely).

**Example**
```
$ kubectl get pods # no timeout flag set - default to 0s (which means no
timeout)
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$ kubectl get pods --request-timeout=0 # zero means no timeout no timeout flag set
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$kubectl get pods --request-timeout=1ms
Unable to connect to the server: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
```
2016-10-14 23:29:58 -07:00
Kubernetes Submit Queue 4e393fadf3 Merge pull request #34611 from jsafrane/provision-pvc
Automatic merge from submit-queue

Pass whole PVC to provisioner plugins

Gluster provisioner is interested in namespace of PVCs that are being provisioned and I don't want to add at as a new field in `volume.VolumeOptions` - it would contain almost whole PVC.

Let's rework `VolumeOptions` and pass direct reference to PVC there instead of some "interesting" fields and let the provisioner to pick information it is interested in.

There was lot of refactoring in volume plugins to apply this change (too many plugins), however the logic is simple and it's all the same in all plugins.

@rootfs @humblec
2016-10-14 22:49:32 -07:00
Kubernetes Submit Queue d671fcf0c4 Merge pull request #34852 from deads2k/fix-webhook
Automatic merge from submit-queue

honor SAR verb

Verbs on non-resource requests were dropped.  This results in always being denied for all the authorizers I know of, so no unintended exposure, but its still ugly. We should probably pick.

@liggitt I would have expected the kubelet work to get stuck on this.
2016-10-14 21:27:44 -07:00
Kubernetes Submit Queue 9368982799 Merge pull request #34725 from wojtek-t/cacher_throughput
Automatic merge from submit-queue

Increase buffer sizes in cacher for watchers interested in all/many o…

Should increase throughput of cacher in large clusters.
2016-10-14 19:18:29 -07:00
Kubernetes Submit Queue 19848dddfd Merge pull request #24980 from aveshagarwal/master-project-node-selector
Automatic merge from submit-queue

Add support for admission controller based on namespace node selectors.

This work is to upstream openshift's project node selectors based admission controller.

Fixes https://github.com/kubernetes/kubernetes/issues/17151
2016-10-14 18:37:33 -07:00
Pengfei Ni 2ecdc2a81b CRI: add docs for AppArmor and Seccomp 2016-10-15 09:04:42 +08:00
Kubernetes Submit Queue e2ef58e915 Merge pull request #27206 from JacobTanenbaum/add_limit
Automatic merge from submit-queue

Add 'kubectl set resources'

Add "kubectl set resources" for easier updating container memory/cpu limits/requests (for pods or resources with pod templates).

**Usage**

`kubectl set resources (-f FILENAME | TYPE NAME)  ([--limits=LIMITS & --requests=REQUESTS])`

**Examples**
Set a deployments nginx container cpu limits to "200m and memory to "512Mi"
`kubectl set resources deployment nginx -c=nginx --limits=cpu=200m,memory=512Mi`

Set the limit and requests for all containers in nginx
`kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi`

Print the result (in yaml format) of updating nginx container limits from a local, without hitting the server
`kubectl set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml`

Remove limits on containers in nginx
`kubectl set resources deployment nginx --limits=cpu=0,memory=0`

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


EDIT: removed the '--remove' flag example
2016-10-14 17:55:34 -07:00
Kubernetes Submit Queue 35abd47f5a Merge pull request #32111 from MatMaul/openstack-trustid
Automatic merge from submit-queue

Support trust id as a scope in the OpenStack authentication logic

This patch allows the use of Kubernetes with Keystone trust delegation to avoid passing the user credentials in clear inside the config file : a specific user with delegated rights can be created and used instead.
2016-10-14 16:31:50 -07:00
Mike Danese c17a8a773d kubectl: apply prune should fallback to basic delete when a resource has no reaper 2016-10-14 15:04:38 -07:00
ymqytw af1ee9e6b3 fix error handling 2016-10-14 14:54:57 -07:00
Kubernetes Submit Queue 5daae42b8f Merge pull request #34826 from pigmej/patch-1
Automatic merge from submit-queue

fixed absense to absence

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

**Which issue this PR fixes** just a typo

**Special notes for your reviewer**: just a typo

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```NONE
```
2016-10-14 14:50:18 -07:00
juanvallejo bae1cca65c
Allow callers to bypass cmdutil.CheckError() logging 2016-10-14 17:45:53 -04:00
Ivan Shvedunov f1258dca4e Fix typos 2016-10-15 00:21:00 +03:00
deads2k a8b471491b you can be authorized and have a failure 2016-10-14 16:18:23 -04:00
deads2k abf2c43ad7 attempt to use discovery RESTMapper and fallback if we can't 2016-10-14 16:06:31 -04:00
Andy Goldstein e7befa2a14 Only wait for cache syncs once in NodeController 2016-10-14 15:50:05 -04:00
deads2k e37d2f3465 honor SAR verb 2016-10-14 15:38:39 -04:00
Kubernetes Submit Queue 928b8cbdb8 Merge pull request #34809 from gmarek/sync2
Automatic merge from submit-queue

NodeController waits for informer sync before doing anything

cc @lavalamp @davidopp

```release-note
NodeController waits for full sync of all it's informers before taking any action.
```
2016-10-14 08:55:16 -07:00
deads2k 7412be4465 default serializer 2016-10-14 11:27:32 -04:00
guangxuli 8a9cfdf86a make function ReadDockerConfigFile more flexible
rename the variable

make parameter more flexible

handle docker config file path

use a single set of paths

delete debug print

gofmt

delete the empty line

comment is not correct

move the comment to the correct place

keep original signature

godoc
2016-10-14 23:23:46 +08:00
Kubernetes Submit Queue c3742a8fbe Merge pull request #34047 from deads2k/rbac-11-informer-cache
Automatic merge from submit-queue

Run rbac authorizer from cache

RBAC authorization can be run very effectively out of a cache.  The cache is a normal reflector backed cache (shared informer).

I've split this into three parts:
 1. slim down the authorizer interfaces
 1. boilerplate for adding rbac shared informers and associated listers which conform to the new interfaces
 1. wiring

@liggitt @ericchiang @kubernetes/sig-auth
2016-10-14 08:12:28 -07:00
Jędrzej Nowak 7a7c36261e fixed absense to absence 2016-10-14 16:28:46 +02:00
Klaus Ma 005b8dad14 Updated err message when retrieving resources by name with --all-namespaces. 2016-10-14 22:21:01 +08:00
juanvallejo fd087caadb Add global timeout flag
This patch adds a global timeout flag (viewable with `kubectl -h`) with
a default value of `0s` (meaning no timeout).

The timeout value is added to the default http client, so that zero
values and default behavior are enforced by the client.

**Example**
```
$ kubectl get pods # no timeout flag set - default to 0s (which means no
timeout)
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$ kubectl get pods --timeout=0 # zero means no timeout no timeout flag set
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$kubectl get pods --timeout=1ms
Unable to connect to the server: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
```
2016-10-14 09:57:40 -04:00
gmarek e2b78ddadc NodeController waits for informer sync before doing anything 2016-10-14 15:52:57 +02:00
Kubernetes Submit Queue 1efdf72e23 Merge pull request #33973 from ymqytw/fix_edit
Automatic merge from submit-queue

Improve edit experience

Improve edit experience a bit according [#26050(comment)](https://github.com/kubernetes/kubernetes/issues/26050#issuecomment-246089751)
> a) always go back to the editor
b) always retain what I hand-edited, even if that has to be in comments


@janetkuo
2016-10-14 06:41:36 -07:00
gmarek fd874ab173 PodGCController waits for informer sync before doing anything. 2016-10-14 15:24:09 +02:00
Mathieu Velten c1b3100ba2 Support trust id as a scope in the OpenStack authentication logic. 2016-10-14 14:54:26 +02:00
Jacob Tanenbaum 901bbee2fd Add 'kubectl set limit'
Add a way to set resource limits/requests on running pods

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

I squashed the commits to make rebasing easier
Change log:

- fixed a typo that caused the command to be run with kubectl set set instead of the correct kubectl set limit

- added a ResourcesWithPodTemplates to pkg/kubectl/cmd/util/factory.go
     instead of hardcoding these resources move there description all in one place

- Fixing some of the flow control in kubectl set limit

- update the help info

- changed the name of ResourcesWithPodTemplates to ResourcesWithPodSpecs to more accuratly describe what it is doing
    and changed the variable names to lower case to conform to go's variable naming convention

- changing the name of the command from 'set limit' to 'set resources'

- Adding the new file pkg/kubectl/cmd/set/set_resources.go

- changes to the test cases to reflect the change from 'kubectl set limit' to 'kubectl set resources'

- comment removed

- adding the man page to the git repository attempting to fix Jenkins tests

- adding the user guide

- fixed a few typos

- typo in hack/cmd-test.sh

- implamenting suggestions for command help text

- adding the dry-run flag

- removing the "remove" option in favor of zeroing out request/limits in order to remove them

- changed limits/requests to requests/limit

- changing ResourcesWithPodSpec

- updated generated docs and removed whitespace

- change priint on success message from "resource limits/requests updated" to "resource requirements updated"

- minor rebasing issues - 'hack/test-cmd.sh' now passes

- cmdutil.PrintSuccess added another argument

- fixing mungedocs failure

- removed whitespace from hack/make-rules/test-cmd.sh and an erroneous entry from pkg/cloudprovider/providers/openstack/MAINTAINERS.md

- fixed typo in Short: field of the cobra command

- rebased

- Creating a new factory in the ResourcesWithPodSpecs() so that the testing will pass

- changing ResourcesWithPodSpecs, it doesn't need to be a method of factory
2016-10-14 08:35:32 -04:00
Ivan Shvedunov 096ff3bf93 Fix misspellings of 'receive' 2016-10-14 14:54:01 +03:00
Kubernetes Submit Queue f73afdc5c2 Merge pull request #34779 from yujuhong/status_logging
Automatic merge from submit-queue

Log more information on pod status updates

Also bump the logging level to V2 so that we can see them in a non-test
cluster.
2016-10-14 04:22:32 -07:00
Kubernetes Submit Queue 4f36c2394a Merge pull request #34730 from colemickens/colemickens-azure-specify-availabilityset
Automatic merge from submit-queue

azure: lower log priority for skipped nic update message

**What this PR does / why we need it**: Very minor, just wanted to remove some log noise I introduced in #34526.

I chose `V(3)` since it aligns with the other nicupdate message printed out here, and will be hidden for the usual default of `--v=2`.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
NONE
```
2016-10-14 04:22:21 -07:00
Kubernetes Submit Queue 9adbbf2324 Merge pull request #34587 from resouer/stringflag
Automatic merge from submit-queue

Merge string flag into util flag

Continuing my work on https://github.com/kubernetes/kubernetes/issues/15634

This refactoring is expected to be completely finished and then I will add a verify scripts in `hack`
2016-10-14 04:22:11 -07:00
Ivan Shvedunov 27d51f09a7 Remove duplicate code from kubectl describe 2016-10-14 12:39:34 +03:00
Kubernetes Submit Queue 95ccabdf46 Merge pull request #31921 from grahamhayes/openstack-loadbalancer-security-groups
Automatic merge from submit-queue

Security Group support for OpenStack Load Balancers

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**Add Security Group Support for OpenStack Load Balancers**:

fixes #29745
adds OpenStack support to the work done in #20392

**Release note**:

```
This allows security groups to be created and attached to the neutron
port that the load balancer is using on the subnet.

The security group ID that is assigned to the nodes needs to be
provided, to allow for traffic from the load balancer to the nodePort
to be reflected in the rules.

This adds two config items to the LoadBalancer options -

ManageSecurityGroups (bool)
NodeSecurityGroupID  (string)
```
2016-10-14 02:29:59 -07:00
Kubernetes Submit Queue 0b74e39864 Merge pull request #34786 from davidopp/master
Automatic merge from submit-queue

Make NodeController recognize deletion tombstones

cc/ @lavalamp @gmarek
2016-10-14 01:47:59 -07:00
Kubernetes Submit Queue ca9688218d Merge pull request #34556 from deads2k/api-24-initialization
Automatic merge from submit-queue

split genericapiserver configuration apart so that you can run withou…

…t flag options

@dims Take a look at this re-slicing of the `genericapiserver.Config` creation.   I think this helps composers overall and resolves the chicken/egg problem you were having.
2016-10-14 01:09:05 -07:00
Kubernetes Submit Queue 5f76741ae6 Merge pull request #34434 from asalkeld/set_image_err
Automatic merge from submit-queue

Assign options.Err in "set image"

**What this PR does / why we need it**:
There is a usage of options.Err in a Printf, but this option is never set.
This patch passes the stderr into the command and assigns the option correctly.

**Which issue this PR fixes**
fixes #34433 

**Special notes for your reviewer**:
None

**Release note**:
```release-note
```
2016-10-14 00:29:36 -07:00
Ivan Shvedunov 5c229f386d Remove duplicated code in kubectl portforward test 2016-10-14 10:10:45 +03:00
David Oppenheimer cd5779a2b1 Make NodeController recognize deletion tombstones. 2016-10-13 23:36:22 -07:00
Kubernetes Submit Queue d7c0eb322c Merge pull request #34276 from freehan/cri-runtime-config
Automatic merge from submit-queue

add UpdateRuntimeConfig interface

Expose UpdateRuntimeConfig interface in RuntimeService for kubelet to pass a set of configurations to runtime. Currently it only takes PodCIDR.

The use case is for kubelet to pass configs to runtime. Kubelet holds some config/information which runtime does not have, such as PodCIDR. I expect some of kubelet configurations will gradually move to runtime, but I believe cases like PodCIDR, which dynamically assigned by k8s master, need to stay for a while.
2016-10-13 23:10:42 -07:00
Brendan Burns d9d06f6680 Add some checking for the presence of the same key twice. 2016-10-13 21:58:44 -07:00
Kubernetes Submit Queue 64f52a2725 Merge pull request #32485 from jsafrane/e2e-provisioning-class
Automatic merge from submit-queue

Add e2e tests for storageclass

- test pd-ssd and pd-standard on GCE,
- test all four volume types and encryption on AWS
- test just the default volume type on OpenStack (right now, there is no API
  to get list of them)

These tests are quite slow, e.g. there are two tests on AWS that has to run mkfs.ext4 on 500 GB magnetic drive with low IOPS, which takes ~3-4 minutes each.
2016-10-13 21:51:27 -07:00
Joshua Carp b48deebc7a Run gofmt. 2016-10-14 00:35:44 -04:00
Jess Frazelle db33b491cc
update generated protobuf
Signed-off-by: Jess Frazelle <acidburn@google.com>
2016-10-13 21:22:59 -07:00
Jess Frazelle 20db0ad0ab
fix unit test for TLS and linted packages
Signed-off-by: Jess Frazelle <acidburn@google.com>
2016-10-13 21:19:18 -07:00
Jess Frazelle d51962e1bb
vet fixes
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-10-13 21:12:15 -07:00
Angus Salkeld ea1063a263 Assign options.Err in "set image"
There is a usage of options.Err in a Printf, but this option is never set.
This patch passes the stderr into the command and assigns the option correctly.
2016-10-14 11:17:03 +10:00
Kubernetes Submit Queue 786cc3ef6c Merge pull request #32142 from juanvallejo/jvallejo_bugfix/remove-compinit-call-zsh-completions
Automatic merge from submit-queue

remove call to compinit in zsh completion output

**Release note**:
```release-note
release-note-none
```

Fixes: https://github.com/kubernetes/kubernetes/issues/32029
Fixes:
https://github.com/kubernetes/kubernetes/issues/27538#issuecomment-238574035

The zsh completion output makes a call to "compinit" which causes the
zsh completion system to re-initialize every time `<root_cmd> completion zsh`
is sourced, overwriting any settings already applied to other commands.
This in-turn caused other commands' completions to break (such as git,
gcloud, vim) causing an error "function definition file not found" to
be returned any time a tab-completion was attempted.

This patch removes the call to `compinit` in the zsh completion output,
causing no behavioral changes to the existing `completion` command, but
fixing any issues that were caused after sourcing its output.
2016-10-13 16:33:09 -07:00
Chao Xu af944c4cc8 add import restrictions 2016-10-13 16:10:24 -07:00
Chao Xu 3be2411c7a cleanup the remaining 2016-10-13 16:10:24 -07:00
Chao Xu fbd187af45 move the retry util out of pkg/client/unversioned 2016-10-13 16:10:24 -07:00
Chao Xu 834de10774 convert replicatset util to use clientset 2016-10-13 16:10:24 -07:00
Graham Hayes ac205183d4 Security Group support for OpenStack Load Balancers
This allows security groups to be created and attached to the neutron
port that the loadbalancer is using on the subnet.

The security group ID that is assigned to the nodes needs to be
provided, to allow for traffic from the loadbalancer to the nodePort
to be refelected in the rules.

This adds two config items to the LoadBalancer options -

ManageSecurityGroups (bool)
NodeSecurityGroupID  (string)
2016-10-13 15:42:01 -07:00
Kubernetes Submit Queue a944748ccb Merge pull request #34341 from apprenda/kubeadm-require-root
Automatic merge from submit-queue

kubeadm implement preflight checks

Checks that user running kubeamd init and join is root and will only execute
command if user is root. Moved away from using kubectl error handling to
having kubeadm handle its own errors. This should allow kubeadm to have
more meaningful errors, exit codes, and logging for specific kubeadm use
cases.

fixes #33908
2016-10-13 15:02:53 -07:00
Ivan Shvedunov 2b427f7d59 Fix typos 2016-10-14 00:29:50 +03:00
Yu-Ju Hong 47c49fc77c Log more information on pod status updates
Also bump the logging level to V2 so that we can see them in a non-test
cluster.
2016-10-13 14:07:09 -07:00
juanvallejo 4bf980967a remove call to compinit in zsh completion output
Fixes: https://github.com/kubernetes/kubernetes/issues/32029
Fixes:
https://github.com/kubernetes/kubernetes/issues/27538#issuecomment-238574035

The zsh completion output makes a call to "compinit" which causes the
zsh completion system to re-initialize every time `<root_cmd> completion zsh`
is sourced, overwriting any settings already applied to other commands.
This in-turn caused other commands' completions to break (such as git,
gcloud, vim) causing an error "function definition file not found" to
be returned any time a tab-completion was attempted.

This patch removes the call to `compinit` in the zsh completion output,
causing no behavioral changes to the existing `completion` command, but
fixing any issues that were caused after sourcing its output.
2016-10-13 16:47:20 -04:00
Avesh Agarwal 5bb2cb8249 Added new unit tests. 2016-10-13 13:15:19 -04:00
Avesh Agarwal b902f857c6 Add support for admission controller based on namespace node selectors.
This work is to upstream openshift's project node selectors based admission controller.

Addresses #17151.
2016-10-13 13:14:19 -04:00
deads2k fbd5032da2 split genericapiserver configuration apart so that you can run without flag options 2016-10-13 13:09:53 -04:00
Kubernetes Submit Queue f2ca99ed2c Merge pull request #32104 from lojies/usededentforcompletion
Automatic merge from submit-queue

Use dedent for completion.go
2016-10-13 10:07:54 -07:00
Cole Mickens c7237c8624 azure: lower log priority for skipped nic update message 2016-10-13 08:35:12 -07:00
Kubernetes Submit Queue dd529f3c4a Merge pull request #34551 from deads2k/api-23-remove-legacy-prefixy
Automatic merge from submit-queue

Change legacy API resource registration

Updates the legacy API resource registration to emphasize its different-ness and to simplify supporting objects.  The option has to remain in the genericapiserverconfig for multiple prefixes to enable cases where composers/extenders had composed additional groupless APIs. See OpenShift as an example.

However this is now transparent to "normal" composers.

@ncdc since sttts is out.
2016-10-13 08:23:35 -07:00
Kubernetes Submit Queue 9b3ca2fb0d Merge pull request #33180 from AdoHe/refactory_interface
Automatic merge from submit-queue

refact kubectl Factory make it interface

refactor kubectl to make Factory interface. @kubernetes/kubectl
2016-10-13 07:44:05 -07:00
Wojciech Tyczynski 2298e1746c Increase buffer sizes in cacher for watchers interested in all/many objects. 2016-10-13 16:40:33 +02:00
Devan Goodwin 4231c046dd Fix errors and improve output in kubeadm pre-flight checks.
Add skip-preflight-checks to known flags.
Fix bug with preflight checks not returning system is-active as errors.
Fix error handling to use correct function.
2016-10-13 11:10:19 -03:00
Kubernetes Submit Queue afa709b8dc Merge pull request #34662 from yujuhong/sandbox_logs
Automatic merge from submit-queue

Add more log messages for sandbox restarts
2016-10-13 07:05:08 -07:00
Jan Safranek c9c1147270 Add e2e tests for storageclass
- test pd-ssd and pd-standard on GCE,
- test all four volume types on AWS
- test just the default volume type on OpenStack (right now, there is no API
  to get list of them)
2016-10-13 15:37:08 +02:00
Derek McQuay 16b159c12b kubeadm implement preflight checks
Includes checks for verifying services exist and are enabled, ports are
open, directories do not exist or are empty, and required binaries are
in the path.

Checks that user running kubeamd init and join is root and will only execute
command if user is root. Moved away from using kubectl error handling to
having kubeadm handle its own errors. This should allow kubeadm to have
more meaningful errors, exit codes, and logging for specific kubeadm use
cases.
2016-10-13 10:09:36 -03:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
AdoHe dfae1a27c2 add fake factories for test 2016-10-13 20:57:14 +08:00
AdoHe 593d8e0d7c refactor Factory make it interface 2016-10-13 20:57:14 +08:00
Kubernetes Submit Queue 06c1f2ba2c Merge pull request #34707 from gmarek/master
Automatic merge from submit-queue

Bump log level in case of Node eviction
2016-10-13 05:37:10 -07:00
Kubernetes Submit Queue 1c65d1df86 Merge pull request #34694 from gmarek/deleted_final_state_unknown
Automatic merge from submit-queue

Handle DeletedFinalStateUnknown in NodeController

Fix #34692

```release-note
Fix panic in NodeController caused by receiving DeletedFinalStateUnknown object from the cache.
```

cc @davidopp
2016-10-13 04:58:06 -07:00
deads2k e1638f11a3 run authorization from a cache 2016-10-13 07:53:40 -04:00
deads2k 2c4e618be1 add rbac shared informers 2016-10-13 07:50:02 -04:00
deads2k ceaf026881 slim down authorization listing interfaces 2016-10-13 07:50:01 -04:00
gmarek 41278b4c6b Bump log level in case of Node eviction 2016-10-13 13:26:16 +02:00
Kubernetes Submit Queue ca75b47657 Merge pull request #32555 from pweil-/admission-authorizer
Automatic merge from submit-queue

WantsAuthorizer admission plugin support

The next step of PSP admission is to be able to limit the PSPs used based on user information.  To do this the admission plugin would need to make authz checks for the `user.Info` in the request.  This code allows a plugin to request the injection of an authorizer to allow it to make the authz checks.

Note:  this could be done with a SAR, however since admission is running in the api server using the SAR would incur an extra hop vs using the authorizer directly.

@deads2k @derekwaynecarr
2016-10-13 03:40:11 -07:00
Michail Kargakis 212a26dc95 controller: set minReadySeconds in deployment's replica sets
* Estimate available pods for a deployment by using minReadySeconds on
the replica set.
* Stop requeueing deployments on pod events, superseded by following the
replica set status.
* Cleanup redundant deployment utilities
2016-10-13 12:27:47 +02:00
Kubernetes Submit Queue 5496d22733 Merge pull request #34456 from kargakis/revert-29808
Automatic merge from submit-queue

Revert "Error out when any RS has more available pods then its spec r…

Reverts https://github.com/kubernetes/kubernetes/pull/29808

The PR is wrong because we can have more available pods than desired every time we scale down.

@kubernetes/deployment ptal
2016-10-13 03:01:47 -07:00
gmarek 8b7e9d303c Handle DeletedFinalStateUnknown in NodeController 2016-10-13 11:31:04 +02:00
Kubernetes Submit Queue 3b787c9b3d Merge pull request #34526 from colemickens/colemickens-azure-specify-availabilityset
Automatic merge from submit-queue

azure: filter load balancer backend nodes to PrimaryAvailabilitySet (if set)

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
- Adds a new field (`PrimaryAvailabilitySetName`) to the Azure CloudProvider config struct
- If the field is set, only machines who are in that availabilitySet are added to the load balancer backend pool.

This is required to:
- Support more than 100 nodes in Azure (only can have 100 nodes per availability set)
- Support multiple availability sets per cluster (An Azure L4 LoadBalancer can only be pointed at nodes in a single availability set)

Without this PR, or if the field is **not** set in a cluster that contains two availabilitysets, then the following is observed:
- Azure resources are created (LB, LB rules, NSG rules, public IP)
- Azure throws errors when trying to add nodes from the "other" availability set
- The service winds up exposed to the outside world (if you manually retrieve the public ip from Azure API)
- Kubernetes controller-manager's service loop keeps retrying forever because it never finishes fully successfully
- The "external ip" property field is never updated.

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

**Unknowns**:
- Naming convention: `LoadBalancedAvailabilitySet` might be more descriptive than `PrimaryAvailabilitySet`, but is also a misnomer since `kube-proxy` will still end up routing requests to all relevant nodes.
- Is it worth trying to be "smart" about it in the case the user hasn't set this field in the config? Save the first availability set name and try not to add any nodes that aren't also in that one? It may simply be better to just let this fail so the user has to choose the right setting for their use-case.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
azure: add PrimaryAvailabilitySet to config, only use nodes in that set in the loadbalancer pool
```

CC: @brendandburns, @anhowe
2016-10-13 02:23:21 -07:00
Kubernetes Submit Queue 523fce990a Merge pull request #32781 from lukaszo/ready_ds
Automatic merge from submit-queue

Add ReadyScheduled to DaemonSet status

Fixes #25605

cc @bgrant0607 @mikedanese
2016-10-13 00:25:56 -07:00
Kubernetes Submit Queue b8b7f9ffc0 Merge pull request #32722 from juanvallejo/jvallejo_return-err-on-oc-get-empty-list
Automatic merge from submit-queue

return warning on empty list result in kubectl get

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

The current default behavior of `kubectl get` is to return an empty
output when there are no resources to display. This patch improves
usability by returning a warning through stderr in the case of an empty
list.

##### Before
`$ kubectl get pods`
  - *empty output*

##### After
`$ kubectl get pods`
```
There are no resources to display.
```
2016-10-12 23:48:01 -07:00
Kubernetes Submit Queue a0624835ac Merge pull request #34669 from yujuhong/get_netns
Automatic merge from submit-queue

Allow kuberuntime to get network namespace for not ready sandboxes

Kubelet calls TearDownPod to clean up the network resources for a pod sandbox.
TearDownPod relies on GetNetNS to retrieve network namespace, and the current
implementation makes this impossible for not-ready sandboxes. This change
removes the unnecessary filter to fix this issue.
2016-10-12 23:09:08 -07:00
Minhan Xia 480bcb9760 add UpdateRuntimeConfig interface 2016-10-12 22:33:58 -07:00
Kubernetes Submit Queue f20e1cc4d0 Merge pull request #31911 from aveshagarwal/master-rhbz-1372425
Automatic merge from submit-queue

Send a pod event if preStop hook did not complete in time.

Fixes https://github.com/kubernetes/kubernetes/issues/31902
@kubernetes/rh-cluster-infra @derekwaynecarr
2016-10-12 21:45:47 -07:00
Kubernetes Submit Queue adfbe8d952 Merge pull request #33629 from mbohlool/o2
Automatic merge from submit-queue

Generate unique Operation IDs for root OpenAPI spec

This PR adds a customization method GetOperationID to OpenAPI spec generation and then use it to make sure root spec has unique operation IDs by mostly adding GroupVersion to the start of operation ID.
2016-10-12 21:06:24 -07:00
Kubernetes Submit Queue a0d4878ea9 Merge pull request #30145 from markturansky/limit_range_pvc
Automatic merge from submit-queue

Add PVC storage to LimitRange

This PR adds the ability to add a LimitRange to a namespace that enforces min/max on `pvc.Spec.Resources.Requests["storage"]`.

@derekwaynecarr @abhgupta @kubernetes/sig-storage 

Examples forthcoming. 

```release-note
pvc.Spec.Resources.Requests min and max can be enforced with a LimitRange of type "PersistentVolumeClaim" in the namespace
```
2016-10-12 20:26:59 -07:00
Kubernetes Submit Queue d236b84b4f Merge pull request #34555 from mikedanese/conversion
Automatic merge from submit-queue

kubeadm: fix conversion macros and add kubeadm to round trip testing

Tests are probably broken but I'll fix. @jbeda this probably fixes your change unless we decide we need generated deep copies or conversions.

@kubernetes/sig-cluster-lifecycle
2016-10-12 19:47:58 -07:00
Yu-Ju Hong 43368ff7b9 Allow kuberuntime to get network namespace for not ready sandboxes
Kubelet calls TearDownPod to clean up the network resources for a pod sandbox.
TearDownPod relies on GetNetNS to retrieve network namespace, and the current
implementation makes this impossible for not-ready sandboxes. This change
removes the unnecessary filter to fix this issue.
2016-10-12 18:05:40 -07:00
Yu-Ju Hong 2202688eef Add more log messages for sandbox restarts 2016-10-12 17:16:55 -07:00
ymqytw c27f99b89e improve edit experience 2016-10-12 17:12:41 -07:00
Cole Mickens 113c5e3475 azure: filter load balancer backend nodes to PrimaryAvailabilitySet if set 2016-10-12 15:01:17 -07:00
mbohlool 5ba06cf2bc Make Kubernetes OpenAPI operation IDs unique 2016-10-12 14:54:12 -07:00
juanvallejo 63e0279d93
add --dry-run flag to `kubectl apply`
Related StackOverflow:
http://stackoverflow.com/questions/38824409/validate-openshift-objects-defined-in-yaml-before-actually-applying-or-executing

This patch adds a `--dry-run` flag to the `apply` command in order to
allow validation of objects, without actually creating them. If a
`--dry-run` flag is present and no validation errors are found, the
command will exit before patching or creating any objects.

It also adds a `--dry-run` option to the `kubectl create` root command.
2016-10-12 16:48:20 -04:00
Mike Danese 25e4dccefe kubeadm: fix conversion macros and add kubeadm to round trip testing 2016-10-12 13:26:23 -07:00
mbohlool 221a620a14 Move Trie to util package 2016-10-12 12:57:50 -07:00
deads2k 6406aacb59 remove legacy API prefix from generic 2016-10-12 15:32:27 -04:00
Kubernetes Submit Queue b99a9094cc Merge pull request #34380 from Random-Liu/fix-cri-image
Automatic merge from submit-queue

CRI: Image pullable support in dockershim

For #33189.

The new test `ImageID should be set to the manifest digest (from RepoDigests) when available` introduced in #33014 is failing, because:
1) `docker-pullable://` conversion is not supported in dockershim;
2) `kuberuntime` and `dockershim` is using `ListImages with image name filter` to check whether image presents. However, `ListImages` doesn't support filter with `digest`.

This PR:
1) Change `kuberuntime.IsImagePresent` to use `runtime.ImageStatus` and `dockershim.InspectImage` instead. ***Notice an API change: `ImageStatus` should return `(nil, nil)` for non-existing image.***
2) Add `docker-pullable://` support.
3) Fix `RemoveImage` in dockershim https://github.com/kubernetes/kubernetes/pull/29316.

I've tried myself, the test can pass now.

@yujuhong @feiskyer @yifan-gu 
/cc @kubernetes/sig-node
2016-10-12 12:25:37 -07:00
Phu Kieu 6f9fd4431a Use same SSH tunnel as kubelet 2016-10-12 11:54:47 -07:00
Kubernetes Submit Queue 44337ba8c2 Merge pull request #33176 from gluke77/allow-pod-prefix-for-kubectl-exec
Automatic merge from submit-queue

Allow 'pod/' prefix in pod name for 'kubectl exec'

This PR adds ability to provide pod name with 'pod/' prefix for 'kubectl exec' command. Pod names without 'pod/' prefix are still allowed.

Fixes #24225
2016-10-12 10:15:42 -07:00
pweil- 5c66dcb526 inject authorizer when admission controller requests it 2016-10-12 13:05:34 -04:00
Mike Danese d9cc8119ef allow apigroups to opt out of proto round trip testing 2016-10-12 10:01:38 -07:00
Random-Liu afa3414779 * Add docker pullable support.
* Fix inspect image bug.
* Fix remove image bug.
2016-10-12 09:21:10 -07:00
Marcin Wielgus 859077b701 Make "Unschedulable" reason a constant in api 2016-10-12 17:43:24 +02:00
Illia Khudoshyn ea12b32d6a Allow 'pod/' prefix in pod name for 'kubectl exec'
Fixes #24225

This PR adds ability to provide pod name with 'pod/' prefix for 'kubectl exec' command. Pod names without 'pod/' prefix are still allowed.
2016-10-12 17:42:31 +03:00
Łukasz Oleś 4ebe1f666a Generated part for NumberReady 2016-10-12 15:36:01 +02:00
Łukasz Oleś 5d2e215652 Add NumberReady to DaemonSet status
Fixes #25605
2016-10-12 15:15:10 +02:00
Piotr Szczesniak bd3c11df8a Merge pull request #34608 from deads2k/controller-10-really-fix-it
fix unfiltered comparison in controller test
2016-10-12 14:59:45 +02:00
Kubernetes Submit Queue f9e8ee8fe8 Merge pull request #33905 from kargakis/replica-set-conditions
Automatic merge from submit-queue

Replica set conditions API

Partially addresses https://github.com/kubernetes/kubernetes/issues/32863

@kubernetes/sig-apps
2016-10-12 05:10:45 -07:00