Commit Graph

78 Commits

Author SHA1 Message Date
k8s-merge-robot
a52eb5d433 Merge pull request #21268 from jsafrane/devel/recycle-provisioned
Auto commit by PR queue bot
2016-02-20 15:26:28 -08:00
k8s-merge-robot
eb45154996 Merge pull request #21348 from caesarxuchao/generate-fake-for-1-2
Auto commit by PR queue bot
2016-02-18 23:02:05 -08:00
Chao Xu
ad46715f51 generate fake client for release_1_2 2016-02-17 16:10:02 -08:00
laushinka
7ef585be22 Spelling fixes inspired by github.com/client9/misspell 2016-02-18 06:58:05 +07:00
Jan Safranek
6088369227 Delete provisioned volumes without claim.
There is a race in dynamic provisioning:

1. User creates a claim to dynamically provision a volume.
2. Kubernetes start provisioning the volume.
3. User deletes the claim before 2. is finished.
4. Kubernetes finished provisioning the volume.

The volume is in Pending state. This volume should be deleted instead of
moving to Available state.
2016-02-15 16:38:35 +01:00
k8s-merge-robot
315a509340 Merge pull request #20900 from jsafrane/devel/volume-names
Auto commit by PR queue bot
2016-02-13 17:58:29 -08:00
k8s-merge-robot
ad7ed67904 Merge pull request #20213 from jsafrane/devel/pv-reload
Auto commit by PR queue bot
2016-02-12 06:49:29 -08:00
k8s-merge-robot
678958a706 Merge pull request #19868 from jsafrane/devel/syncclaim-twice
Auto commit by PR queue bot
2016-02-12 06:21:21 -08:00
Jan Safranek
1d0b1c227b Add PV.Name into names of generated GCE/AWS/OSP volumes.
Volume names have now format <cluster-name>-dynamic-<pv-name>.

pv-name is guaranteed to be unique in Kubernetes cluster, adding
<cluster-name> ensures we don't conflict with any running cluster
in the cloud project (kube-controller-manager --cluster-name=XXX).

'kubernetes' is the default cluster name.
2016-02-12 09:46:59 +01:00
Tim Hockin
7cab7bd472 fix a few go-vet errors 2016-02-09 13:20:31 -08:00
k8s-merge-robot
e3c58293b9 Merge pull request #20197 from markturansky/check_pv_by_pvc_uid
Auto commit by PR queue bot
2016-02-05 21:06:16 -08:00
Chao Xu
184440f8ef rename release_1_2 to internalclientset 2016-02-05 14:02:28 -08:00
Jan Safranek
76b6449715 Retry recycle or delete operation on failure.
Recycle controller tries to recycle or delete a PV several times.
It stores count of failed attempts and timestamp of the last attempt in
annotations of the PV.

By default, the controller tries to recycle/delete a PV 3 times in
10 minutes interval. These values are configurable by
kube-controller-manager --pv-recycler-maximum-retry=X --pvclaimbinder-sync-period=Y
arguments.
2016-02-05 17:02:13 +01:00
gmarek
0c191e787b Split controller flags between controllers 2016-02-05 12:17:51 +01:00
Chao Xu
1b047f8e67 rename legacy to core 2016-02-04 14:26:56 -08:00
Chao Xu
f9f5736b01 grep sed 2016-02-03 13:06:07 -08:00
Jan Safranek
1edf34a4e5 Fixed persistent volume claim controllers processing an old claim.
Fixes #19860 (it may be easier to look at the issue to see exact sequence
to reproduce the bug and understand the fix).

When PersistentVolumeProvisionerController.reconcileClaim() is called with the
same claim in short succession (e.g. the claim is created by an user and
at the same time periodic check of all claims is scheduled), the second
reconcileClaim() call gets an old copy of the claim as its parameter.

The method should always reload the claim to get a fresh copy with all
annotations, possibly added by previous reconcileClaim() call.


The same applies to PersistentVolumeClaimBinder.syncClaim().


Also update all the test to store claims in "fake" API server before calling
syncClaim and reconcileClaim.
2016-02-02 13:52:07 +01:00
Jan Safranek
e2826626b1 Fixed persistent volume claim controllers processing an old volume
We should always load the newest version of the volume from APIserver before
processing it.

When PersistentVolumeProvisionerController.reconcileVolume() is called with the
same volume in short succession (e.g. the volume is created by a provisioner
and at the same time periodic check of all volumes is scheduled), the second
reconcileVolume() call gets an old copy of the volume as its parameter and
it does not see annotations updated by the previous call.

This may result in one volume being provisioned several times, creating orphan
volumes in the cloud.

The same error is in PersistentVolumeClaimBinder.syncVolume().
2016-02-01 10:44:31 +01:00
Chao Xu
c72d234bbf replacing handwritten client in several controllers 2016-01-31 15:42:02 -08:00
Fabio Yeon
7205a160ac Remove all instances of "/tmp" from unit tests and replace with a common
tmp directory creator. Exception is documented.
2016-01-27 16:11:22 -08:00
markturansky
1ad2df6b61 verify UID when releasing and binding volumes 2016-01-27 08:43:18 -05:00
k8s-merge-robot
52cb4c1d9d Merge pull request #18445 from resouer/fix-emptydir
Auto commit by PR queue bot
2016-01-26 02:45:54 -08:00
harry
0fa5b6c4f7 Add e2e test for wrapper volumes
Use git server in e2e and refactor wrapper builder

Update e2e test to use a fake git server
2016-01-24 16:57:44 +08:00
Clayton Coleman
33085c0cf2 Update tests to handle codec changes 2016-01-22 13:27:26 -05:00
Alex Mohr
12845ba9a5 Merge pull request #18877 from markturansky/fix_18830
Trigger syncClaim after PV provisioning to reduce wait
2016-01-21 15:06:46 -08:00
k8s-merge-robot
6cf3a4b5f0 Merge pull request #18957 from jsafrane/devel/pv-name-tag
Auto commit by PR queue bot
2016-01-21 05:55:12 -08:00
Jan Safranek
8c48250a55 Add an integration test for volume tags. 2016-01-08 19:09:29 +01:00
Jan Safranek
400ebf87a1 Add PV.Name to volume tags.
We add claim.Name and claim.Namespace as tags to AWS EBS / GCE PD / OpenStack
Cinder volumes created by Kubernetes. To easily match Kubernetes volumes and
cloud volumes, let's add also PV.Name.
2016-01-04 12:28:02 +01:00
markturansky
50d83f3851 added missing return statements 2016-01-03 13:54:09 -05:00
markturansky
66b5844841 trigger syncClaim after pv provisioning to reduce wait 2015-12-17 21:35:10 -05:00
deads2k
9fda7f1812 update StatusDetails to handle Groups 2015-12-17 09:14:12 -05:00
k8s-merge-robot
9b106f5bc9 Merge pull request #18083 from markturansky/fail_if_no_recycler
Auto commit by PR queue bot
2015-12-16 19:35:49 -08:00
Saad Ali
3968a5e63c Merge pull request #18601 from pmorie/devel/provisioner-aws
Dynamic provisioner for AWS EBS
2015-12-16 10:51:35 -08:00
markturansky
4aacb76149 added cast checks to controllers to prevent nil panics 2015-12-15 11:34:03 -05:00
Jan Safranek
6ff5286df9 Implement Creater and Deleter interfaces for AWS EBS.
Also mark the created EBS volumes with tags, so the admin knows
who/what created the volumes.
2015-12-15 10:22:49 +01:00
Wojciech Tyczynski
960808bf08 Switch to versioned ListOptions in client. 2015-12-14 14:26:09 +01:00
markturansky
4fc1bf1f23 Added PersistentVolumeController 2015-12-11 10:33:30 -05:00
markturansky
34c063cfe1 attempt recycling once, fail pv permanently 2015-12-10 18:23:45 -05:00
Phillip Wittrock
c67ce887f2 Volume Metrics Interface and base implementation.
- Add volume.MetricsProvider function to Volume interface.
- Add volume.MetricsDu for providing metrics via executing "du".
- Add volulme.MetricsNil for unsupported Volumes.
2015-12-09 16:06:24 -08:00
Wojciech Tyczynski
b0fcb5adef Pass ListOptions to List in ListWatch. 2015-12-07 11:53:53 +01:00
Wojciech Tyczynski
6dcb689d4e Simplify List() signature in clients. 2015-12-03 09:54:07 +01:00
k8s-merge-robot
8a8639d7af Merge pull request #17863 from wojtek-t/only_list_options_in_watch
Auto commit by PR queue bot
2015-12-02 06:28:28 -08:00
Wojciech Tyczynski
8343c8ce6c Pass ListOptions to List() methods. 2015-12-01 15:00:36 +01:00
Wojciech Tyczynski
d2dfc912e6 Simplify Watch() signature in clients. 2015-12-01 14:19:26 +01:00
Phillip Wittrock
6b358e43dd Merge pull request #17747 from saad-ali/fixErrorCreatingPDTry2
Refactor GCE wrapper library to allow execution from E2E test suite
2015-11-25 15:57:42 -08:00
k8s-merge-robot
7f2f7aa091 Merge pull request #16432 from markturansky/recycler_race
Auto commit by PR queue bot
2015-11-25 11:54:06 -08:00
saadali
42b200a0a0 Refactor GCE wrapper library to allow execution from E2E test suite
This reverts commit 147b6911f5, reversing
changes made to 6fd986065b.
2015-11-25 11:48:06 -08:00
Wojciech Tyczynski
b6ef62af24 Use unversioned.ListOptions in clients. 2015-11-24 16:52:09 +01:00
Jerzy Szczepkowski
8a922e22be Revert "Refactor GCE wrapper library to allow execution from E2E test suite" 2015-11-23 09:24:32 +01:00
saadali
882469dd7b Refactor GCE wrapper library to allow execution from E2E test suite 2015-11-20 11:41:10 -08:00