Commit Graph

669 Commits (e0ecb09fda0a015a11d29a16649a082f57a3e74a)

Author SHA1 Message Date
Clayton Coleman acb4c00b39
EnableGarbageCollection should be a struct member on RESTOptions
Not a global. Now that we have RESTOptions this was an easy change.
2016-09-15 00:09:28 -04:00
Matthew Wong 25e9b9dcf9 Revert "Use PV shared informer in PV controller" 2016-09-13 10:12:34 -04:00
deads2k 8fac64b43f add localSAR 2016-09-13 08:54:23 -04:00
deads2k 519c13745f convert rest of kubectl to generated clients 2016-09-12 08:22:34 -04:00
Kubernetes Submit Queue ae839ffc44 Merge pull request #31543 from deads2k/rbac-06-change-role-ref
Automatic merge from submit-queue

Change rbac roleref to reflect the information we want

@liggitt @ericchiang This is a version of https://github.com/kubernetes/kubernetes/pull/31359 which updates the `RoleRef` to be (I think) the type that we want, with a group, resource, and name.

This is **not** backwards compatible with any existing data.  I'm ok with doing this since rbac was considered alpha, but its something to consider.

If we want this instead, I'll close the previous pull (or update it with this content).
2016-09-12 02:01:49 -07:00
Kubernetes Submit Queue 60b63b7cda Merge pull request #31767 from asalkeld/bad-context-error
Automatic merge from submit-queue

Add a check in ConfirmUsable() to validate the contextName

**What this PR does / why we need it**:
When a context name is provided, but can't be found (miss spelling), it currently
uses the defaults. This PR will cause the command to fail, to prevent unexpected side effects
of using the wrong configuration.

**Which issue this PR fixes**
fixes #21062

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Error if a contextName is provided but not found in the kubeconfig.
```
2016-09-11 02:00:34 -07:00
Kubernetes Submit Queue 17f82069bb Merge pull request #30825 from wongma7/pv-controller-informer
Automatic merge from submit-queue

Use PV shared informer in PV controller

Use the PV shared informer, addressing (partially) https://github.com/kubernetes/kubernetes/issues/26247 . Using the PVC shared informer is not so simple because sometimes the controller wants to `Requeue` and...
2016-09-10 12:40:30 -07:00
deads2k 8c788233e7 change rbac roleref type 2016-09-09 09:55:51 -04:00
Daniel Smith 2d6dd159d2 add more details to failure 2016-09-08 17:14:59 -07:00
Kubernetes Submit Queue 7a4d81ea43 Merge pull request #31271 from deads2k/self-sar
Automatic merge from submit-queue

add selfsubjectaccessreview API

Exposes the REST API for self subject access reviews.  This allows a user to see whether or not they can perform a particular action.

@kubernetes/sig-auth
2016-09-08 01:29:48 -07:00
deads2k cd5b6cc491 move StorageClass to its own group 2016-09-06 08:41:17 -04:00
Kubernetes Submit Queue ac7fbf502a Merge pull request #31925 from nikhiljindal/freshDebugNs
Automatic merge from submit-queue

Adding namespaces/finalizer subresource to federation apiserver

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

cc @kubernetes/sig-cluster-federation @mwielgus 


Verified manually that I can delete federation namespaces now.
Will update federation-namespace e2e test to verify that namespace is deleted fine
2016-09-02 19:30:25 -07:00
nikhiljindal 274487da87 Adding namespaces/finalizer subresource to federation apiserver 2016-09-02 15:30:32 -07:00
Wojciech Tyczynski 41518feb0a Fix TestServiceAlloc flake 2016-09-01 14:27:25 +02:00
Kubernetes Submit Queue 2a28917e0a Merge pull request #31756 from lavalamp/logmore
Automatic merge from submit-queue

Log useful information on 500's; include error message in error (!!)

Diagnose #31728
2016-08-31 20:31:45 -07:00
Angus Salkeld e9cad12e5f Add a check in ConfirmUsable() to validate the contextName 2016-09-01 11:35:11 +10:00
Daniel Smith 1a23f5a79f Log useful information on 500's
* include error message in error (!!)
* add test verifying error message is correct for service ip allocation
2016-08-31 13:46:40 -07:00
jianhuiz 893f499fb8 test Metadata.ClusterName not saved into etcd 2016-08-31 08:12:41 -07:00
Davanum Srinivas b06a6bfbb1 Fix make test-integration under OSX
Just throw in a doc.go so there's something compilable in the
test/integration/metrics directory.

Fixes #31587
2016-08-29 13:50:44 -04:00
deads2k 97529e3687 add selfsubjectaccessreview API 2016-08-29 09:51:54 -04:00
Chao Xu 9ac91e5172 debugging gc 2016-08-26 15:58:33 -07:00
Matthew Wong 1d6dbdd9d2 Use PV shared informer in PV controller 2016-08-25 21:55:23 -04:00
Chao Xu 67b7c7290a Allow per-resource default garbage collection behavior 2016-08-22 11:37:04 -07:00
Jordan Liggitt 387f9ea952
Fix data race in PVC Run/Stop methods 2016-08-21 15:15:33 -04:00
Kubernetes Submit Queue 7979801e54 Merge pull request #28860 from ericchiang/separate-apiserver-authz-options
Automatic merge from submit-queue

pkg/genericapiserver/options: don't import pkg/apiserver

Refactor the authorization options for the API server so
pkg/apiserver isn't directly imported by the options package.

Closes #28544

cc @smarterclayton

@madhusudancs, @nikhiljindal I've updated `federation/cmd/federation-apiserver/app/server.go` to include the RBAC options with this change. I don't know if this was intentionally left out in the first place but would like your feedback.
2016-08-21 09:49:14 -07:00
Kubernetes Submit Queue 5898f87722 Merge pull request #30233 from mbohlool/swagger2
Automatic merge from submit-queue

OpenAPI / Swagger2 spec generation

This is alpha version of OpenAPI spec generation. Generated "/swagger.json" file (accessible on api server) is a valid OpenAPI spec with some warnings that will be fixed in next versions of spec generation. Currently it is possible to generate a client using this spec though I did not test the clients.

reference: #13414

**Release note**:

```release-note
Alpha support for OpenAPI (aka. Swagger 2.0) specification serves on /swagger.json 
```
2016-08-19 04:21:48 -07:00
Kubernetes Submit Queue c19e9cc89d Merge pull request #26044 from smarterclayton/multiversion_encode
Automatic merge from submit-queue

Guarantee that Encode handles nested objects again
2016-08-18 21:10:55 -07:00
mbohlool c5f1d63d6f Generates OpenAPI (aka Swagger 2.0) Spec on /swagger.json path 2016-08-18 15:32:04 -07:00
Eric Chiang b4eaf625a0 pkg/genericapiserver/options: don't import pkg/apiserver
Refactor the authorization options for the API server so
pkg/apiserver isn't directly imported by the options package.
2016-08-18 13:01:50 -07:00
Timothy St. Clair d6606a6aa9 etcd3 validation showed that several unit tests that depend on apiserver being fully
stood up should be integration tests, not unit tests.
2016-08-18 14:12:24 -05:00
Clayton Coleman 12a5eeea17
Introduce GroupVersioner for capturing desired target version
Convert single GV and lists of GVs into an interface that can handle
more complex scenarios (everything internal, nothing supported). Pass
the interface down into conversion.
2016-08-18 14:45:00 -04:00
Kubernetes Submit Queue 9d2a5fe5e8 Merge pull request #29006 from jsafrane/dynprov2
Automatic merge from submit-queue

Implement dynamic provisioning (beta) of PersistentVolumes via StorageClass

Implemented according to PR #26908. There are several patches in this PR with one huge code regen inside.

* Please review the API changes (the first patch) carefully, sometimes I don't know what the code is doing...

* `PV.Spec.Class` and `PVC.Spec.Class` is not implemented, use annotation `volume.alpha.kubernetes.io/storage-class`

* See e2e test and integration test changes - Kubernetes won't provision a thing without explicit configuration of at least one `StorageClass` instance!

* Multiple provisioning volume plugins can coexist together, e.g. HostPath and AWS EBS. This is important for Gluster and RBD provisioners in #25026

* Contradicting the proposal, `claim.Selector` and `volume.alpha.kubernetes.io/storage-class` annotation are **not** mutually exclusive. They're both used for matching existing PVs. However, only `volume.alpha.kubernetes.io/storage-class` is used for provisioning, configuration of provisioning with `Selector` is left for (near) future.

* Documentation is missing. Can please someone write some while I am out?

For now, AWS volume plugin accepts classes with these parameters:

```
kind: StorageClass
metadata:
  name: slow
provisionerType: kubernetes.io/aws-ebs
provisionerParameters:
  type: io1
  zone: us-east-1d
  iopsPerGB: 10
```

* parameters are case-insensitive
* `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details
* `iopsPerGB`: only for `io1` volumes. I/O operations per second per GiB. AWS volume plugin multiplies this with size of requested volume to compute IOPS of the volume and caps it at 20 000 IOPS (maximum supported by AWS, see AWS docs).
* of course, the plugin will use some defaults when a parameter is omitted in a `StorageClass` instance (`gp2` in the same zone as in 1.3).

GCE:

```
apiVersion: extensions/v1beta1
kind: StorageClass
metadata:
  name: slow
provisionerType: kubernetes.io/gce-pd
provisionerParameters:
  type: pd-standard
  zone: us-central1-a
```

* `type`: `pd-standard` or `pd-ssd`
* `zone`: GCE zone
* of course, the plugin will use some defaults when a parameter is omitted in a `StorageClass` instance (SSD in the same zone as in 1.3 ?).


No OpenStack/Cinder yet

@kubernetes/sig-storage
2016-08-18 09:56:16 -07:00
Jan Safranek bb5d562f37 Restore alpha behavior 2016-08-18 10:36:50 +02:00
Jan Safranek 6e4d95f646 Dynamic provisioning V2 controller, provisioners, docs and tests. 2016-08-18 10:36:49 +02:00
Rodrigo Campos 568f4c2e63 Add mode permission bits to configmap, secrets and downwardAPI
This implements the proposal in:
docs/proposals/secret-configmap-downwarapi-file-mode.md

Fixes: #28317.

The mounttest image is updated so it returns the permissions of the linked file
and not the symlink itself.
2016-08-17 14:44:41 -04:00
Timothy St. Clair 730fc70107 Update etcd default ports for v3, and validate tests 2016-08-17 07:49:19 -05:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

<!--
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.
-->

```release-note
```

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
Hongchao Deng d0938094d9 move new etcd storage into cacher 2016-08-12 18:40:20 -07:00
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Chao Xu 41572cb22d add metrics to gc 2016-08-10 12:45:06 -07:00
Chao Xu 4d2350632c only store typeMeta and objectMeta in the gc store 2016-08-08 17:23:13 -07:00
Kubernetes Submit Queue 10121b4c4b Merge pull request #28116 from jsafrane/integration-startup
Automatic merge from submit-queue

Add integration test for volume controller startup.

Tests #28002 with real etcd (unit tests have a fake one with different behavior).

@kubernetes/sig-storage
2016-08-08 15:07:14 -07:00
Kubernetes Submit Queue 711b63e78b Merge pull request #28104 from ping035627/ping035627-patch-4
Automatic merge from submit-queue

SchedulerExtender: add failedPredicateMap in Filter() returns

Fix #25797. modify extender.Filter for adding extenders information to “failedPredicateMap” in findNodesThatFit.
When all the filtered nodes that passed "predicateFuncs" don’t pass the extenders filter, the failedPredicateMap hasn’t the extenders information, should add it, I think. So when the length of the “filteredNodes.Items” is 0, we can know the integral information. (The length of the “filteredNodes.Items” is 0, may be because the extenders filter failed.)
2016-08-06 20:50:33 -07:00
deads2k 32920b5617 add subjectaccessreviews resource 2016-08-05 11:20:56 -04:00
Kubernetes Submit Queue e7d01097dc Merge pull request #29971 from caesarxuchao/fix-kubectl-rolling-update-with-gc
Automatic merge from submit-queue

[GarbageCollector] Fix kubectl rolling-update to work with GC

This changes the order of the [Rename()](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532) function. After the change, Rename() first deletes the old RC and orphans its pods, then creates the new RC, which will then have a chance to adopt the orphaned pods.

This also fixes the "should support rolling-update to same image" [test](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/kubectl.go#L915) when the garbage collector is on.

Here is the detailed explanation on why the test would have failed:
`kubectl rolling-update` will [rename](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532-L546) the RC. It first creates the an identical RC (including spec.selectors) with the new name, then it deletes the existing RC. When GC is turned on, the newly created RC cannot adopt the existing pod, because it has a controllerRef pointing to the exising RC, so the new RC will create new pods and expect to see the creation. However, the new RC and the old RC have the same selector, so sometimes the old RC, instead of the new RC, has its [expectation lowered](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346-L362), the new RC's expectation will stuck forever. The e2e test then times out when executing `kubectl delete newRC`, because there is the new RC will not scale down as its expectation is not fulfilled.

A side-note, we should fix [rm.getPodController()](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346) to respect pod's controllerref, that will prevent similar bugs.

Also note that an old version `kubectl rolling-update` will not work with the GC. We cannot fix that.
2016-08-04 20:48:10 -07:00
Kubernetes Submit Queue 42a12a4cd6 Merge pull request #29978 from hodovska/sharedInformer-fixup
Automatic merge from submit-queue

SharedInformerFactory: usage and fixes

Follow-up for #26709
2016-08-04 09:00:23 -07:00
Dominika Hodovska 816f6d32ca Collapse duplicate informer creation paths 2016-08-04 09:02:13 +02:00
PingWang 4106eb70b0 modify extends.Filter
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Add docs

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

add docs for ExtenderFilterResult.FailedNodes in types.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Modify the extender.Filter test.

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Update extender_test.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

modify the comments

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

gofmt -s scheduler_interface.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update the comments

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-04 14:03:32 +08:00
Kubernetes Submit Queue 544851a19f Merge pull request #29796 from deads2k/token-review
Automatic merge from submit-queue

Token review endpoint

Unrevert of #28788, which was rolled back because of https://github.com/kubernetes/kubernetes/issues/29375


@cjcullen @wojtek-t I'd like to remerge if possible.  Have we gotten the field checking mentioned here relaxed? https://github.com/kubernetes/kubernetes/pull/28788#discussion_r71918442
2016-08-03 20:48:31 -07:00
Chao Xu 96c84303bd fix kubectl rolling-update when GC is enabled 2016-08-03 15:57:03 -07:00
Chao Xu ed091e8fe0 fix 29992 2016-08-03 13:36:53 -07:00
Kubernetes Submit Queue 92cb46c303 Merge pull request #27942 from jsafrane/integration-modify
Automatic merge from submit-queue

integration test: Modify PVs/PVCs during binding.

Previous volume binder code was not able to cope with PVs or PVCs getting modified during the binding process. Current one should be resilient to these changes, so let's test it.

It makes the test approximately twice as long as before, from ~2 seconds to ~4-5.

@kubernetes/sig-storage 

Marking as 1.3 target, however it does not really matter here, it's just a test.
2016-08-03 11:18:38 -07:00
deads2k 60dd4a5d26 interesting changes to add tokenreviews endpoint to implement webhook 2016-08-03 08:37:45 -04:00
k8s-merge-robot 50e3ee287e Merge pull request #29798 from caesarxuchao/fix-29451
Automatic merge from submit-queue

Fix 29451

Fix #29451. I've also checked other tests in that file to make sure they don't have similar problems.

The issue is P0 and will block the submit queue, so I marked this PR as P0.
2016-07-29 17:25:23 -07:00
Chao Xu 7797ff2ead fix 29451 2016-07-29 13:15:27 -07:00
childsb f5bd7d471e API Changes for StorageClass 2016-07-28 19:01:01 -04:00
deads2k aa3db4d995 make the resource prefix in etcd configurable for cohabitation 2016-07-27 07:51:40 -04:00
Wojciech Tyczynski e21b7109e1 Integration tests for ReplicaSet OwnerRef 2016-07-21 11:36:52 +02:00
Wojciech Tyczynski 4d0d115690 Revert "add tokenreviews endpoint to implement webhook" 2016-07-21 09:40:35 +02:00
deads2k 2c4a9f2e8d interesting changes to add tokenreviews endpoint to implement webhook 2016-07-20 15:11:56 -04:00
Davanum Srinivas ee8507a5ae Use Infof/Warningf when appropriate
When we use a format string, we should use Infof/Warningf instead
of Info/Warning
2016-07-19 12:10:53 -04:00
k8s-merge-robot 8d46d9b0c7 Merge pull request #28281 from nhlfr/authorize-return-bool
Automatic merge from submit-queue

Return (bool, error) in Authorizer.Authorize()

Before this change, Authorize() method was just returning an error, regardless of whether the user is unauthorized or whether there is some other unrelated error. Returning boolean with information about user authorization and error (which should be unrelated to the authorization) separately will make it easier to debug.

Fixes #27974
2016-07-18 21:40:26 -07:00
Chao Xu 519b57484c wait for the podInformer to observe the pod creation in the rc's TestAdoption test 2016-07-18 11:26:58 -07:00
k8s-merge-robot fa174bcdaf Merge pull request #29042 from dims/fixup-imports
Automatic merge from submit-queue

Use Go canonical import paths

Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-18 07:23:38 -07:00
Michal Rostecki fa0dd46ab7 Return (bool, error) in Authorizer.Authorize()
Before this change, Authorize() method was just returning an error,
regardless of whether the user is unauthorized or whether there
is some other unrelated error. Returning boolean with information
about user authorization and error (which should be unrelated to
the authorization) separately will make it easier to debug.

Fixes #27974
2016-07-18 12:06:54 +02:00
k8s-merge-robot 156205523d Merge pull request #28852 from deads2k/use-user
Automatic merge from submit-queue

authorize based on user.Info

Update the `authorization.Attributes` to use the `user.Info` instead of discrete getters for each piece.

@kubernetes/sig-auth
2016-07-16 20:12:43 -07:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
Chao Xu 11a341de67 let RC manager utilize the GC 2016-07-14 19:59:31 -07:00
deads2k f6f1ab34aa authorize based on user.Info 2016-07-14 07:48:42 -04:00
Jan Safranek 36c607b1b0 Add integration test for volume controller startup.
Tests #28002 with real etcd (unit tests have a fake one with different
behavior).
2016-07-11 15:56:33 +02:00
Jan Safranek 8d0cebd4af integration test: Modify PVs/PVCs during binding.
Previous volume binder code was not able to cope with PVs or PVCs getting
modified during the binding process. Current one should be resilient to
these changes, so let's test it.

It makes the test approximately twice as long as before, from ~2 seconds to
~4-5.
2016-07-11 15:55:24 +02:00
Dr. Stefan Schimanski 1f9046471c Compile fixes for master_benchmark_test.go 2016-07-08 08:02:04 +02:00
Mike Danese 13f36d5117
delete some dead code
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-07-07 00:54:19 -07:00
Mike Danese f3de21bdf0
move integration tests into individual pacakges
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-07-07 00:54:15 -07:00
Wojciech Tyczynski 4fa3aba0c2 Get rid of DeleteAllEtcdKeys 2016-07-05 22:10:47 +02:00
Wojciech Tyczynski 122f97d29b Migrate remaining integration tests 2016-07-05 13:34:27 +02:00
Wojciech Tyczynski c2126f6820 Migrate garbage collection integration tests 2016-07-05 13:34:27 +02:00
Wojciech Tyczynski 3c9b68698d Migrate scheduler integration tests 2016-07-05 13:34:26 +02:00
Wojciech Tyczynski 13b2387c0c Migrate PersistentVolume integration tests 2016-07-05 13:34:26 +02:00
Wojciech Tyczynski 925ba42507 Avoid annoying logs in integration tests 2016-07-04 16:52:55 +02:00
Wojciech Tyczynski 0523e54ea6 Cleanup integration auth tests 2016-07-04 16:38:22 +02:00
Wojciech Tyczynski bee29b59d2 Cleanup integration RunAMaster 2016-07-04 15:53:56 +02:00
Wojciech Tyczynski ac270b66b7 Move first few integration tests to use dedicated namespaces 2016-07-04 13:21:26 +02:00
Wojciech Tyczynski 08f17fef27 Unify DeleteAllEtcdKeys in integration tests. 2016-07-04 12:01:09 +02:00
k8s-merge-robot d06359d6a0 Merge pull request #28409 from saad-ali/moveVolumeController
Automatic merge from submit-queue

Reorganize volume controllers and manager

* Move both PV and attach/detach volume controllers to `controllers/volume` (closes #26222)
* Rename `kubelet/volume` to `kubelet/volumemanager`
* Add/update OWNER files
2016-07-02 00:41:02 -07:00
saadali 0dd17fff22 Reorganize volume controllers and manager 2016-07-01 18:50:25 -07:00
Hongchao Deng e270ccf543 integration: cleanup unused API 2016-07-01 16:26:17 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 065217e4d7 Merge pull request #27350 from jsafrane/integration-deleteetcd
Automatic merge from submit-queue

Remove duplicate deleteAllEtcdKeys() from integration tests.
2016-06-28 15:18:55 -07:00
k8s-merge-robot 32eccd413f Merge pull request #25562 from gtank/certificates-api-v9
Automatic merge from submit-queue

TLS bootstrap API group (alpha)

This PR only covers the new types and related client/storage code- the vast majority of the line count is codegen. The implementation differs slightly from the current proposal document based on discussions in design thread (#20439). The controller logic and kubelet support mentioned in the proposal are forthcoming in separate requests.

I submit that #18762 ("Creating a new API group is really hard") is, if anything, understating it. I've tried to structure the commits to illustrate the process.

@mikedanese @erictune @smarterclayton @deads2k

```release-note-experimental
An alpha implementation of the the TLS bootstrap API described in docs/proposals/kubelet-tls-bootstrap.md.
```

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-28 13:25:22 -07:00
George Tankersley 56a2cf40e6 tests: add certificates to existing test infrastructure 2016-06-28 12:05:40 -07:00
k8s-merge-robot eb4b402d2e Merge pull request #28025 from ncdc/refactor-master-bootstrap-controller
Automatic merge from submit-queue

Add EndpointReconcilerConfig to master Config

Add EndpointReconcilerConfig to master Config to allow downstream integrators to customize the reconciler and reconciliation interval when starting a customized master

@kubernetes/sig-api-machinery @deads2k @smarterclayton @liggitt @kubernetes/rh-cluster-infra
2016-06-28 08:07:41 -07:00
Jordan Liggitt f45d9dc2f8 Convert service account token controller to use a work queue 2016-06-27 13:01:24 -04:00
Andy Goldstein b55cede866 Add EndpointReconcilerConfig to master Config
Add EndpointReconcilerConfig to master Config to allow downstream integrators to customize the reconciler
and reconciliation interval when starting a customized master.
2016-06-27 09:22:30 -04:00
Jan Safranek 2d24d981c0 Remove duplicate deleteAllEtcdKeys(). 2016-06-27 10:16:02 +02:00
k8s-merge-robot 41b5bbdd1c Merge pull request #27569 from wongma7/pvc-selector-expression
Automatic merge from submit-queue

Add integration test for binding PVs using label selectors

Adds an integration test for persistent volume claim 'MatchExpressions' label selector.
2016-06-22 02:06:22 -07:00
k8s-merge-robot 482a7bee2f Merge pull request #27426 from soltysh/scheduledjob_test_reapply
Automatic merge from submit-queue

Reapply ScheduledJob tests (2ab885a53a)

Re-applied the ScheduledJob tests (#25737) which were reverted due to an integration test error in #27184.
The problem was in `TestBatchGroupBackwardCompatibility` which is testing backwards compatibility for storing jobs (`extensions/v1beta1` vs `batch/v1`), which is not needed for `batch/v2alpha1`. I've added a skip to aforementioned test for that group. See `test/integration/master_test.go` for the actual fix.

@caesarxuchao @mikedanese ptal
@piosz @jszczepkowski @erictune fyi

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-21 10:31:54 -07:00
k8s-merge-robot 9f06e0f1a6 Merge pull request #27665 from iamthemuffinman/master
Automatic merge from submit-queue

Fix spelling errors
2016-06-21 09:54:07 -07:00
Maciej Szulik feb43c5e6d Reapply ScheduledJob tests (2ab885a53a) 2016-06-21 14:55:00 +02:00
Wojciech Tyczynski fe14beb980 Move Patch, AtomicPut and MasterService tests to test/integration. 2016-06-20 20:50:25 +02:00
k8s-merge-robot a19728c3a1 Merge pull request #27182 from wojtek-t/move_integration_tests
Automatic merge from submit-queue

Migrate some integration tests from cmd/integration to test/integration to use framework

Ref #25940
2016-06-20 11:48:28 -07:00
Robert Deusser cd1450b3ec Fix spelling errors
More spelling fixes
2016-06-20 11:36:11 -04:00
gmarek 9bbcb5e3b8 Remove dependency on test/integration from kubemark 2016-06-20 16:20:51 +02:00
wongma7 d61594b842 Add integration test for binding PVs using label selectors 2016-06-20 10:15:29 -04:00
k8s-merge-robot 6de1ba5dc4 Merge pull request #27034 from jsafrane/integration-parallel
Automatic merge from submit-queue

Add possibility to run integration tests in parallel

- add env. variable with etcd URL to intergration tests
- update documentation with example how to use it to find flakes
2016-06-20 03:25:30 -07:00
k8s-merge-robot d244a34747 Merge pull request #27458 from wongma7/pvc-selector
Automatic merge from submit-queue

Add integration test for binding PVs using label selectors

Adds an integration test for persistent volume claim label selector.
2016-06-20 02:46:17 -07:00
Jan Safranek a114df7d59 integration tests: add env. variable for etcd URL.
Many integration tests delete all keys in etcd as part of their cleanup.
To run these tests in parallel we must run several etcd daemons, each on
different port and pass etcd url to the test suite.
2016-06-20 10:40:49 +02:00
markturansky 16ec36c591 added toggle to disable dynamic provisioning 2016-06-20 01:15:23 -04:00
k8s-merge-robot 6fbf99b11a Merge pull request #26753 from ericchiang/rbac-authorizer-tests
Automatic merge from submit-queue

add unit and integration tests for rbac authorizer

This PR adds lots of tests for the RBAC authorizer. 

The plan over the next couple days is to add a lot more test cases.

Updates #23396

cc @erictune
2016-06-19 19:19:08 -07:00
k8s-merge-robot 185ca0035c Merge pull request #27119 from jsafrane/integration-provisioning
Automatic merge from submit-queue

Add integration test for provisioning/deleting many PVs.

The test is configurable by KUBE_INTEGRATION_PV_OBJECTS for load tests, 100 objects are created by default.

@kubernetes/sig-storage
2016-06-18 18:34:10 -07:00
Paul Morie f0ead64881 Fix typo in GC integration tests 2016-06-17 10:20:49 -04:00
k8s-merge-robot 8a89ea6058 Merge pull request #27568 from lavalamp/faster
Automatic merge from submit-queue

Make unit tests faster
2016-06-16 16:11:05 -07:00
Daniel Smith 8af08f90b5 remove unused prefix code, fix comment 2016-06-16 14:29:40 -07:00
Jan Safranek 26f90d2099 Add integration test for provisioning/deleting of many PVs.
The test is configurable by KUBE_INTEGRATION_PV_OBJECTS for load tests,
100 objects are created by default.
2016-06-16 10:14:49 +02:00
Matthew Wong 327210c2a3 Add integration test for binding PVs using label selectors 2016-06-15 14:34:34 -04:00
saadali 542f2dc708 Introduce new kubelet volume manager
This commit adds a new volume manager in kubelet that synchronizes
volume mount/unmount (and attach/detach, if attach/detach controller
is not enabled).

This eliminates the race conditions between the pod creation loop
and the orphaned volumes loops. It also removes the unmount/detach
from the `syncPod()` path so volume clean up never blocks the
`syncPod` loop.
2016-06-15 09:34:08 -07:00
Eric Chiang d13e351028 add unit and integration tests for rbac authorizer 2016-06-14 11:07:48 -07:00
Wojciech Tyczynski 80d1ae7642 Fix panic in TestUnschedulableNodes 2016-06-14 11:05:07 +02:00
k8s-merge-robot 913241c721 Merge pull request #27271 from jsafrane/integration-flake-2
Automatic merge from submit-queue

volume integration: wait for PVs before creating PVCs

The test should wait until all volumes are processed by volume controller (i.e. in the controller cache) before creating a PVC.

Without that, the "best" matching PV could not be in the cache and controller might bind the PVC to suboptiomal one.

This fixes integration test flake "Bind mismatch! Expected pvc-2 capacity 50000000000 but got pvc-2 capacity 52000000000".

Fixes #27179 (together with #26894)
2016-06-13 09:02:59 -07:00
k8s-merge-robot 1ed5342b35 Merge pull request #26894 from jsafrane/fix-integration-pv-flake
Automatic merge from submit-queue

Fix integration pv flakes

There are two fixes in this PR:
- run tests in separarate functions and use objects with different names, otherwise events from the beginning of the function are caught later when we watch for events of a different PV/PVC
- don't set PV.Spec.ClaimRef.UID of pre-bound PVs. PVs with UID set are considered as bound and they are deleted/recycled when appropriate PVC does not exists yet.

Fixes #26730 and probably also ~~#26894~~ #26256
2016-06-13 09:02:54 -07:00
Jan Safranek 248b4c3350 volume integration: wait for PVs before creating PVCs
The test should wait until all volumes are processed by volume controller (i.e.
in the controller cache) before creating a PVC.

Without that, the "best" matching PV could not be in the cache and controller
might bind the PVC to suboptiomal one.

This fixes integration test flake "Bind mismatch! Expected pvc-2 capacity
50000000000 but got pvc-2 capacity 52000000000".
2016-06-13 14:43:49 +02:00
Daniel Smith 6e6ae452e5 Make each integration test use different prefix 2016-06-12 13:33:31 -07:00
k8s-merge-robot 9a2ad73cee Merge pull request #22568 from abhgupta/abhgupta-dev
Automatic merge from submit-queue

Considering all nodes for the scheduler cache to allow lookups

Fixes the actual issue that led me to create https://github.com/kubernetes/kubernetes/issues/22554

Currently the nodes in the cache provided to the predicates excludes the unschedulable nodes using field level filtering for the watch results. This results in the above issue as the `ServiceAffinity` predicate uses the cached node list to look up the node metadata for a peer pod (another pod belonging to the same service). Since this peer pod could be currently hosted on a node that is currently unschedulable, the lookup could potentially fail, resulting in the pod failing to be scheduled.

As part of the fix, we are now including all nodes in the watch results and excluding the unschedulable nodes using `NodeCondition`

@derekwaynecarr PTAL
2016-06-11 12:22:46 -07:00
Wojciech Tyczynski 67ddac041f Move SelfLink test 2016-06-10 14:26:14 +02:00
Wojciech Tyczynski 43485a4eef Move APIVersions test 2016-06-10 14:24:08 +02:00
Wojciech Tyczynski cfd8173f92 Revert "Add a custom main instead of the standard test main, to reduce stack …" 2016-06-10 11:49:42 +02:00
k8s-merge-robot dd345fbf89 Merge pull request #26494 from caesarxuchao/enable-watchCache-integration-tests
Automatic merge from submit-queue

Enable WatchCache in test/integration/ tests

We already run cmd/integration/ with watch cache on. We should also run tests in test/integration/ with watch cache on.

@wojtek-t @lavalamp
2016-06-09 04:55:47 -07:00
k8s-merge-robot c80f650b70 Merge pull request #26188 from brendandburns/test_main
Automatic merge from submit-queue

Add a custom main instead of the standard test main, to reduce stack …

Adds a custom test main handler (see: `TestMain` in https://golang.org/pkg/testing/ for details)

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

This does the standard timeout, but strips non-kubernetes stacks out of the stack trace (e.g. it filters things like:

```
goroutine 466 [IO wait, 7 minutes]:
net.runtime_pollWait(0x7fd74c4672c0, 0x72, 0xc821614000)
	/usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc8215c21b0, 0x72, 0x0, 0x0)
	/usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8215c21b0, 0x0, 0x0)
	/usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8215c2150, 0xc821614000, 0x1000, 0x1000, 0x0, 0x7fd74c491050, 0xc820014058)
	/usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc820a5a090, 0xc821614000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/net.go:172 +0xe4
net/http.noteEOFReader.Read(0x7fd74c465258, 0xc820a5a090, 0xc8215f0068, 0xc821614000, 0x1000, 0x1000, 0x405773, 0x0, 0x0)
	/usr/local/go/src/net/http/transport.go:1687 +0x67
net/http.(*noteEOFReader).Read(0xc8215ae1a0, 0xc821614000, 0x1000, 0x1000, 0xc82159ad1d, 0x0, 0x0)
	<autogenerated>:284 +0xd0
bufio.(*Reader).fill(0xc8202a2b40)
	/usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc8202a2b40, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8215f0000)
	/usr/local/go/src/net/http/transport.go:1073 +0x177
created by net/http.(*Transport).dialConn
	/usr/local/go/src/net/http/transport.go:857 +0x10a6
```

We may want to get even more aggressive in the future.

@kubernetes/sig-testing
2016-06-09 04:11:01 -07:00
Abhishek Gupta f12f7c51ce Modifying scheduler integration test for unschedulable nodes 2016-06-08 14:44:09 -07:00
k8s-merge-robot e79f046990 Merge pull request #27041 from wojtek-t/unschedulable_nodes
Automatic merge from submit-queue

Extend logging for UnschedulableNodes

Ref #25845
2016-06-08 14:25:32 -07:00
Wojciech Tyczynski 2777c8ddc6 Extend logging for UnschedulableNodes 2016-06-08 15:00:08 +02:00
Chao Xu 965aadac39 shorten gc stress test 2016-06-07 15:58:30 -07:00
Brendan Burns 94b24351da Add a custom main instead of the standard test main, to reduce stack spew. 2016-06-06 13:40:09 -07:00
Jan Safranek 51c218ea7d Fix volume integration test flake
When we create a PV, we should created it withoud Spec.ClaimRef.UID.

In rare cases, when 'PV added' event with UID is processed before 'PVC
added' (created by for loop few lines above), the controller does not know
a PVC with this UID and considers the PV as released. Reclaim policy is
then executed and the PV is deleted and it's never bound.


With UID="", the controller waits for the PVC to get created and binds
it.
2016-06-06 16:14:40 +02:00
Jan Safranek acc2d22765 Split TestPersistentVolumeRecycler into three tests
Different tests should use different objects and watchers - I noticed
sometimes an event from old tests leaked into subsequent test in the
same function.

And add some logs.
2016-06-06 16:12:11 +02:00
k8s-merge-robot 707cc2bbb8 Merge pull request #26493 from caesarxuchao/fix-gc-flake
Automatic merge from submit-queue

Fixes 25890 flake. Let GC convert ListOptions to v1 before passing it to the dynamic client

GC's ListWatcher directly passed the api.ListOptions to the dynamic client, but the parameter codec of dynamic client converts the options to queries based on the tags in the struct, which are not present in api.ListOptions, so the queries are not sent to the server. As a result, the Watch request was sent without a resourceVersion, causing missed events. Flake #25890 is caused by the missed deletion events.

This PR converts the api.ListOptions to v1.ListOptions before the GC passes it to the dynamic codec. The flaky test has successfully passed 79 times ([log](https://00e9e64bacd064560a027fbee9c5a373a1614f3a56e652ae40-apidata.googleusercontent.com/download/storage/v1_internal/b/kubernetes-jenkins/o/pr-logs%2Fpull%2F25923%2Fkubernetes-pull-test-unit-integration%2F28364%2Fbuild-log.txt?qk=AD5uMEv72OjSUqDyk5i-ZLurcmM4i7gket1c7WaqR7yuIYz7WhPYT7ewVBafijV0ymnPTYqxRYt1kp6S9YQv7chPwC-3UtrKetKfhYnvAFrPGXAIBxHytTmpFohRAYgsARN1B6j1f9vyK5lM-8jyzRGhCK3sCRsAPnbDBWIWFlbH4b1n3vUET3P71QamHrF5itYyaqRU5pMZV3Cwwr81X8q7h5hCzm3Ip78RpMzfjEqTG0RcM2TLGccUrlkWVBLh4hn0NFpUIkzVFugFA5ooJffo-0AdJnO3mGWEOnXNVFWftJbK8cKnTns0DISrYFOyH_PlOe_YHCxgIXIT-dW8G-nbqoUjn5SBqunr36rcpaYCIwe2va4W_AcLCT43xiEAezRER_U9AuIqi_22KMd6SuHTyljhmWFPvPk8-gpjthLWXhcE7LPO5dV41hnZHnbI4n_9eI1nSVm7q9XdSvX1sWKV1GCwn8oj017AnxVvl9bScultko_0dTC747UqJ6UTFakLuFcHFe-F5Tz7ItDWlBVPoXeC7gTpyuicFKLsdqGlW9F5X6kIwNrBRj9uRsS-QuzSER-fVkQCn4dUTcokttRH_0bYvyfr9oqiDXmywMgOp-L0sKayk8JOVynh2q0Tju9sdkvFr0PxoAjhofomfIC1SZ_JkOzwAT1TUW8dLjPHluMct34xW_-qna1AmkoxM4bZQLhllap96NTC-0IdtzeKDrTul8p7u3WXSJjjEMSijibTNMlnkB0AluT1_RNO94OnzuFv4YlcV24FPhJzchhbyKREkOb_wzgcnSbRwGHjIcfRgkX-IzoXHVBcMYFUrPmsXrnRcfad4XwjkUOgvivkURW2_EwnzgrLDh-IKek51_0FpT1MnFCSG0gQbVSs_iMVPr6UXNAw62LGbKVtl3ZMXyapEpcO8azNbn6Wvd550R704JXxYlU)).

@lavalamp @krousey @smarterclayton
2016-06-04 01:52:31 -07:00
Chao Xu 06f49f7ca7 Let the dynamic client take a customized parameter codec for List, Watch, and DeleteCollection.
Let the gc's ListWatcher use api.ParameterCodec. Fixes 25890.
2016-06-03 11:22:51 -07:00
Jan Safranek 1cfc984b70 volume controller: add configurable integration test to stress the binder
The test tries to bind configured nr. of PVs to the same nr. of PVCs.
'100' is used by default, which should take ~1-3 seconds (depends on log level).
Periodic sync is needed in rare cases, which may add another 10 seconds. - cache
from #25881 will help here and sync should not be needed at all.

The test is configurable and may be reused to measure binder performance.
Set KUBE_INTEGRATION_PV_* env. variables as described in
persistent_volume_test.go and run the tests:

# compile
$ cd test/integration
$ godep go test -tags 'integration no-docker' -c

# run the tests
$ KUBE_INTEGRATION_PV_SYNC_PERIOD=10s KUBE_INTEGRATION_PV_OBJECTS=1000 time ./integration.test -test.run TestPersistentVolumeMultiPVsPVCs -v 2

Log level '2' is useful to get timestamps of various events like
'TestPersistentVolumeMultiPVsPVCs: start' and 'TestPersistentVolumeMultiPVsPVCs:
claims are bound'.
2016-06-03 12:52:32 +02:00
Jan Safranek 23d8451d61 Stabilize persistent volume itegration tests
- add more logs
- wait both for volume and claim to get bound

When binding volumes to claims the controller saves PV first and PVC right
after that. In theory, this saved PV could cause waitForPersistentVolumePhase
to finish and PVC could be checked in the test before the controller saves it.
So, wait for both PVC and PV to get bound and check the results only after
that. This is only a theory, there are no usable logs in integration tests.
2016-06-01 13:46:09 +02:00
Chao Xu d03fe34114 enable watchCache in test/integration/ tests 2016-05-28 15:46:12 -07:00
k8s-merge-robot e543bd6452 Merge pull request #26007 from smarterclayton/watch_opt
Automatic merge from submit-queue

Additional optimizations to the encode/decode paths

Builds on top of #25983 with a number of other optimizations.
2016-05-28 06:27:00 -07:00
k8s-merge-robot 04bdd37bc4 Merge pull request #25972 from luxas/remove_arch_constants
Automatic merge from submit-queue

Use pause image depending on the server's platform when testing

Removed all pause image constant strings, now the pause image is chosen by arch. Part of the effort of making e2e arch-agnostic.

The pause image name and version is also now only in two places, and it's documented to bump both
Also removed "amd64" constants in the code. Such constants should be replaced by `runtime.GOARCH` or by looking up the server platform

Fixes: #22876 and #15140
Makes it easier for: #25730
Related: #17981

This is for `v1.3`
@ixdy @thockin @vishh @kubernetes/sig-testing @andyzheng0831 @pensu
2016-05-28 04:48:59 -07:00
Alex Mohr edda837142 Merge pull request #25599 from caesarxuchao/orphaning-finalizer
Add orphaning finalizer logic to GC
2016-05-26 13:19:19 -07:00
Alex Mohr 6f919dc6fc Merge pull request #25634 from ericchiang/rbac_api_group
Add RBAC authorization API group and authorizer
2016-05-26 12:36:53 -07:00
Lucas Käldström 79ca1911e1 Removed all pause image constant strings, now the pause image is chosen by arch. Part of the effort of making e2e arch-agnostic 2016-05-26 19:16:43 +03:00
k8s-merge-robot 9aace460a7 Merge pull request #26262 from jsafrane/integration-error-checks
Automatic merge from submit-queue

Add error checks to volume integration tests

We need to know what's going on when a test fails, like in #26256
2016-05-26 06:15:19 -07:00
k8s-merge-robot bda0dc88aa Merge pull request #25457 from saad-ali/expectedStateOfWorldDataStructure
Automatic merge from submit-queue

Attach Detach Controller Business Logic

This PR adds the meat of the attach/detach controller proposed in #20262.

The PR splits the in-memory cache into a desired and actual state of the world.
2016-05-26 00:41:54 -07:00
Eric Chiang 323e804f39 add rbac for tests and kubectl 2016-05-25 14:25:56 -07:00
Jan Safranek e760353b6f Add error checks to volume integration tests 2016-05-25 12:59:02 +02:00
saadali 92500a20d7 Attach detach controller business logic added
Split controller cache into actual and desired state of world.
Controller will only operate on volumes scheduled to nodes that
have the "volumes.kubernetes.io/controller-managed-attach" annotation.
2016-05-24 23:01:16 -07:00
Chao Xu 1665546d2d add finalizer logics to the API server and the garbage collector; handling DeleteOptions.OrphanDependents in the API server 2016-05-24 13:07:28 -07:00
k8s-merge-robot adf44ea190 Merge pull request #26025 from liggitt/auth-test-flake
Automatic merge from submit-queue

Fix panic in auth test failure

I got a spurious failure in the webhook integration test, but couldn't see the error returned because a panic was hit that assumed a body was always returned with the response
2016-05-23 13:19:49 -07:00
Clayton Coleman c6961d6fd6
Remove runtime.Typer, reduce to ObjectKinds(1) (3)
Remove the unnecessary variants, which avoids allocations in several
core paths.
2016-05-21 23:55:42 -04:00
Jordan Liggitt 22649a19d0 Fix panic in auth test failure 2016-05-21 16:48:00 -04:00
k8s-merge-robot 346f965871 Merge pull request #25694 from cjcullen/authncache
Automatic merge from submit-queue

Cache Webhook Authentication responses

Add a simple LRU cache w/ 2 minute TTL to the webhook authenticator.

Kubectl is a little spammy, w/ >= 4 API requests per command. This also prevents a single unauthenticated user from being able to DOS the remote authenticator.
2016-05-21 10:48:38 -07:00
k8s-merge-robot e484f142d6 Merge pull request #25216 from rootfs/pv-integration-test
Automatic merge from submit-queue

Add PV test to persistent volume integration test

This is a follow-up to #25120

@kubernetes/sig-storage
2016-05-21 01:34:06 -07:00
Daniel Smith 785f1c31a6 emergency gc test fix--be extra safe 2016-05-19 22:04:50 -07:00
Daniel Smith 8e7b7a2f9a emergency gc test fix 2016-05-19 21:44:31 -07:00
Huamin Chen cc45f48bb7 persistent volume integration tests:
- create 100 PV, ranging from 0 to 99GB; create 1 PVC to claim 50GB. Verify only one PV is bound and rest are pending
- create 2 PVs with different access modes (RWM, RWO), 1 PVC to claim RWM PV. Verify RWM is bound and RWO is not bound.

Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-05-19 13:22:59 +00:00
k8s-merge-robot c63ac4e664 Merge pull request #24331 from jsafrane/devel/refactor-binder
Automatic merge from submit-queue

Refactor persistent volume controller

Here is complete persistent controller as designed in https://github.com/pmorie/pv-haxxz/blob/master/controller.go

It's feature complete and compatible with current binder/recycler/provisioner. No new features, it *should* be much more stable and predictable.

Testing
--
The unit test framework is quite complicated, still it was necessary to reach reasonable coverage (78% in `persistentvolume_controller.go`). The untested part are error cases, which are quite hard to test in reasonable way - sure, I can inject a VersionConflictError on any object update and check the error bubbles up to appropriate places, but the real test would be to run `syncClaim`/`syncVolume` again and check it recovers appropriately from the error in the next periodic sync. That's the hard part.

Organization
---
The PR starts with `rm -rf kubernetes/pkg/controller/persistentvolume`. I find it easier to read when I see only the new controller without old pieces scattered around.
[`types.go` from the old controller is reused to speed up matching a bit, the code looks solid and has 95% unit test coverage].

I tried to split the PR into smaller patches, let me know what you think.

~~TODO~~
--

* ~~Missing: provisioning, recycling~~.
* ~~Fix integration tests~~
* ~~Fix e2e tests~~

@kubernetes/sig-storage

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24331)
<!-- Reviewable:end -->

Fixes #15632
2016-05-19 03:06:46 -07:00
CJ Cullen 57f96a932f Add expiration LRU cache for webhook token authenticator. 2016-05-18 11:58:11 -07:00
Jan Safranek 79b91b9ee0 Refactor persistent volume initialization
There should be only one initialization function, shared by the real
controller and unit tests.
2016-05-18 10:06:51 +02:00
Jan Safranek 440b4bc6ba Fix integration tests. 2016-05-18 10:06:51 +02:00
Chao Xu 0cda99b8d7 fixing TestCascadingDeletion flake 2016-05-17 13:48:37 -07:00
Chao Xu 21706384f7 use garbage queue drained instead of a watch 2016-05-16 00:14:51 -07:00
Chao Xu c73406bcfe the garbage collector controller 2016-05-15 16:04:19 -07:00
Matt Liggett f5e8d41431 Finish implementing policy API.
Registry implementation and addition to the master.
2016-05-13 17:27:58 -07:00
k8s-merge-robot 0ef4c6407b Merge pull request #24902 from cjcullen/webhookAuthn
Automatic merge from submit-queue

Webhook Token Authenticator

Add a webhook token authenticator plugin to allow a remote service to make authentication decisions.
2016-05-11 22:08:58 -07:00
k8s-merge-robot 7e7465e2d4 Merge pull request #25423 from caesarxuchao/dynamic-listoptions
Automatic merge from submit-queue

Let the dynamic client take runtime.Object instead of v1.ListOptions

so that I can pass whatever version of ListOptions to the List/Watch/DeleteCollection methods.

cc @krousey
2016-05-11 10:59:21 -07:00
derekwaynecarr fc3e71894d Improve quota integration test to not use events, reduce number of pods provisioned 2016-05-10 19:50:36 -04:00
Chao Xu c7d111280f let dynamic client take runtime.Object instead of v1.ListOptions 2016-05-10 16:05:31 -07:00
CJ Cullen eb3b0e78b4 Add a webhook token authenticator plugin. 2016-05-10 14:54:35 -07:00
derekwaynecarr e842f12c8c Quota integration test needs to stop controllers 2016-05-10 12:31:35 -04:00
k8s-merge-robot 1a1229e206 Merge pull request #24795 from deads2k/use-all-attributes
Automatic merge from submit-queue

enable resource name and service account cases for impersonation

Adds the resource name check since that attribute was added for authorization.  Also adds a check against a separate resource for service accounts.  Allowing impersonation of service accounts to use a different resource check places control of impersonation with the same users to have the power to get the SA tokens directly.

@kubernetes/kube-iam 
@sgallagher FYI
2016-05-09 04:58:19 -07:00
k8s-merge-robot d4b1b6776a Merge pull request #24557 from swagiaal/attacher-interface
Automatic merge from submit-queue

 Abstract node side functionality of attachable plugins

- Create PhysicalAttacher interface to abstract MountDevice and
  WaitForAttach.
- Create PhysicalDetacher interface to abstract WaitForDetach and
  UnmountDevice.
- Expand unit tests to check that Attach, Detach, WaitForAttach,
  WaitForDetach, MountDevice, and UnmountDevice get call where
  appropriet.

Physical{Attacher,Detacher} are working titles suggestions welcome. Some other thoughts:
- NodeSideAttacher or NodeAttacher.
- AttachWatcher
- Call this Attacher and call the Current Attacher CloudAttacher.
- DeviceMounter (although there are way too many things called Mounter right now :/)

This is to address: https://github.com/kubernetes/kubernetes/pull/21709#issuecomment-192035382

@saad-ali
2016-05-08 14:04:44 -07:00
k8s-merge-robot f40fe7173b Merge pull request #24304 from cjcullen/cacheauth
Automatic merge from submit-queue

Support persisting config from kubecfg AuthProvider plugins

Plumbs through an interface to the plugin that can persist a `map[string]string` config for just that plugin. Also adds `config` to the AuthProvider serialization type, and `Login()` to the AuthProvider plugin interface.
Modified the gcp AuthProvider to cache short-term access tokens in the kubecfg file.

Builds on #23066 
@bobbyrullo @deads2k @jlowdermilk @erictune
2016-05-08 13:27:57 -07:00
k8s-merge-robot 8a04506546 Merge pull request #23009 from uluyol/c-pause
Automatic merge from submit-queue

Reimplement 'pause' in C - smaller footprint all around

Statically links against musl. Size of amd64 binary is 3560 bytes.

I couldn't test the arm binary since I have no hardware to test it on, though I assume we want it to work on a raspberry pi.

This PR also adds the gcc5/musl cross compiling image used to build the binaries.

@thockin
2016-05-08 09:29:32 -07:00
CJ Cullen 13a7d92d0f Add a ConfigPersister for AuthProvider plugins in kubectl/clients. 2016-05-07 18:15:18 -07:00
Kevin 82ba4f077e implement inter pod topological affinity and anti-affinity 2016-05-06 06:46:23 +00:00
Clayton Coleman e0ebcf4216
Split the storage and negotiation parts of Codecs
The codec factory should support two distinct interfaces - negotiating
for a serializer with a client, vs reading or writing data to a storage
form (etcd, disk, etc). Make the EncodeForVersion and DecodeToVersion
methods only take Encoder and Decoder, and slight refactoring elsewhere.

In the storage factory, use a content type to control what serializer to
pick, and use the universal deserializer. This ensures that storage can
read JSON (which might be from older objects) while only writing
protobuf. Add exceptions for those resources that may not be able to
write to protobuf (specifically third party resources, but potentially
others in the future).
2016-05-05 12:08:23 -04:00
Muhammed Uluyol f3690e2d5e
build/pause: write in C
Builds statically against glibc. References to the old pause
image have been updated.
2016-05-04 21:45:52 -04:00
Sami Wagiaalla 71e7dba845 Abstract node side functionality of attachable plugins
- Expand Attacher/Detacher interfaces to break up work more
  explicitly.
- Add arguments to all functions to avoid having implementers store
  the data needed for operations.
- Expand unit tests to check that Attach, Detach, WaitForAttach,
  WaitForDetach, MountDevice, and UnmountDevice get call where
  appropriet.
2016-05-04 10:18:39 -04:00
k8s-merge-robot 926ee5b90f Merge pull request #24641 from caesarxuchao/pods-test
Automatic merge from submit-queue

move pods.go to pods_test.go

fix #24635
2016-05-02 13:16:20 -07:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
k8s-merge-robot 11298d02e0 Merge pull request #24455 from hongchaodeng/fl
Automatic merge from submit-queue

Provide flags to use etcd3 backed storage

ref: #24405

What's in this PR?
- Add a new flag "storage-backend" to choose "etcd2" or "etcd3". By default (i.e. empty), it's "etcd2".
- Take out etcd config code into a standalone package and let it create etcd2 or etcd3 storage backend given user input.
2016-04-29 08:49:04 -07:00
Chao Xu 6ceebe72b9 move pods.go to pods_test.go 2016-04-28 15:39:28 -07:00
k8s-merge-robot d0b887e4e0 Merge pull request #24595 from zhouhaibing089/httpserverclose
Automatic merge from submit-queue

Uncomment the code that caused by #19254

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

@lavalamp
2016-04-28 01:41:16 -07:00
Hongchao Deng c0071a1595 add flags to enable etcd3 2016-04-28 09:48:16 +08:00
k8s-merge-robot af71fa72e7 Merge pull request #23574 from deads2k/add-extra
Automatic merge from submit-queue

add user.Info.GetExtra

I found myself wanting this field (or something like it), when trying to plumb the information about which scopes a particular token has.

Only the token authenticators have that information and I don't want tokens to leak past the authenticator.  I thought about extending the `authenticator.Token` interface to include scopes (`[]string`), but that felt a little specific for what I wanted to do.  I came up with this as an alternative.

It allows the token authenticator to fill in the information and authorizers already get handed the `user.Info`.  It means that implementors can choose to tie the layers together if they wish, using whatever data they think is best.  

@kubernetes/kube-iam
2016-04-26 21:14:53 -07:00
deads2k e8ce9852e1 deflake quota master init order 2016-04-26 16:37:56 -04:00
deads2k b4ebfd47c5 add user.Info.GetExtra 2016-04-26 15:08:34 -04:00
deads2k 622932422d enable resource name and service account cases for impersonation 2016-04-26 09:31:43 -04:00
zhouhaibing089 bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08:00
deads2k d3c6363093 use single writer to improve quota performance 2016-04-25 10:42:26 -04:00
Clayton Coleman 3111985564 Handle streaming serializers more consistently
Add tests to watch behavior in both protocols (http and websocket)
against all 3 media types. Adopt the
`application/vnd.kubernetes.protobuf;stream=watch` media type for the
content that comes back from a watch call so that it can be
distinguished from a Status result.
2016-04-22 11:07:24 -04:00
deads2k 6670b73b18 make storage enablement, serialization, and location orthogonal 2016-04-21 08:18:55 -04:00
deads2k 3be4b690ea create a negotiating serializer that wraps a single serializer 2016-04-21 07:51:59 -04:00
Prashanth Balasubramanian 0ac10c6cc2 PetSet type, apps apigroup 2016-04-20 18:49:31 -07:00
deads2k f0c33d65b6 start sharing the pod cache and list/watch 2016-04-18 08:51:55 -04:00
k8s-merge-robot a275a045d1 Merge pull request #23914 from sky-uk/make-etcd-cache-size-configurable
Automatic merge from submit-queue

Make etcd cache size configurable

Instead of the prior 50K limit, allow users to specify a more sensible size for their cluster.

I'm not sure what a sensible default is here. I'm still experimenting on my own clusters. 50 gives me a 270MB max footprint. 50K caused my apiserver to run out of memory as it exceeded >2GB. I believe that number is far too large for most people's use cases.

There are some other fundamental issues that I'm not addressing here:
- Old etcd items are cached and potentially never removed (it stores using modifiedIndex, and doesn't remove the old object when it gets updated)
- Cache isn't LRU, so there's no guarantee the cache remains hot. This makes its performance difficult to predict. More of an issue with a smaller cache size.
- 1.2 etcd entries seem to have a larger memory footprint (I never had an issue in 1.1, even though this cache existed there). I suspect that's due to image lists on the node status.

This is provided as a fix for #23323
2016-04-17 00:06:31 -07:00