Commit Graph

19805 Commits (38055983e053351f9fa7664639c8de8cb2d69486)

Author SHA1 Message Date
Kubernetes Submit Queue 47320fd3f0 Merge pull request #42938 from enisoc/orphan-race
Automatic merge from submit-queue

GC: Fix re-adoption race when orphaning dependents.

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

The GC expects that once it sees a controller with a non-nil
DeletionTimestamp, that controller will not attempt any adoption.
There was a known race condition that could cause a controller to
re-adopt something orphaned by the GC, because the controller is using a
cached value of its own spec from before DeletionTimestamp was set.

This fixes that race by doing an uncached quorum read of the controller
spec just before the first adoption attempt. It's important that this
read occurs after listing potential orphans. Note that this uncached
read is skipped if no adoptions are attempted (i.e. at steady state).

**Which issue this PR fixes**:

Fixes #42639

**Special notes for your reviewer**:

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

cc @kubernetes/sig-apps-pr-reviews
2017-03-20 01:30:11 -07:00
Kubernetes Submit Queue 7bc86d84c1 Merge pull request #43116 from dchen1107/master
Automatic merge from submit-queue (batch tested with PRs 42828, 43116)

Apply taint tolerations for NoExecute for all static pods.

Fixed https://github.com/kubernetes/kubernetes/issues/42753


**Release note**:
```
Apply taint tolerations for NoExecute for all static pods.
```

cc/ @davidopp
2017-03-17 18:14:29 -07:00
Kubernetes Submit Queue 9497139cb6 Merge pull request #42828 from janetkuo/ds-types
Automatic merge from submit-queue

Update field descriptions of DaemonSet rolling udpate

@kargakis @lukaszo @kubernetes/sig-apps-bugs
2017-03-17 17:54:14 -07:00
Anthony Yeh b4b8fdbca3 GC: Fix re-adoption race when orphaning dependents.
The GC expects that once it sees a controller with a non-nil
DeletionTimestamp, that controller will not attempt any adoption.
There was a known race condition that could cause a controller to
re-adopt something orphaned by the GC, because the controller is using a
cached value of its own spec from before DeletionTimestamp was set.

This fixes that race by doing an uncached quorum read of the controller
spec just before the first adoption attempt. It's important that this
read occurs after listing potential orphans. Note that this uncached
read is skipped if no adoptions are attempted (i.e. at steady state).
2017-03-17 15:39:26 -07:00
Kubernetes Submit Queue 4b00d5e42a Merge pull request #43307 from gnufied/fix-aws-legacy-tagging
Automatic merge from submit-queue (batch tested with PRs 43313, 43257, 43271, 43307)

Fix AWS untagged instances

To revert to 1.5 behaviour we need to consider untagged
instances if no clusterID has been specified or found.

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

cc @justinsb
2017-03-17 15:12:35 -07:00
Kubernetes Submit Queue eb43cd5eb3 Merge pull request #43271 from liggitt/affinity-namespace
Automatic merge from submit-queue (batch tested with PRs 43313, 43257, 43271, 43307)

Remove 'all namespaces' meaning of empty list in PodAffinityTerm

Removes the distinction between `null` and `[]` for the PodAffinityTerm#namespaces field (option 4 discussed in https://github.com/kubernetes/kubernetes/issues/43203#issuecomment-287237992), since we can't distinguish between them in protobuf (and it's a less than ideal API)

Leaves the door open to reintroducing "all namespaces" function via a dedicated field or a dedicated token in the list of namespaces

Wanted to get a PR open and tests green in case we went with this option.

Not sure what doc/release-note is needed if the "all namespaces" function is not present in 1.6
2017-03-17 15:12:33 -07:00
Janet Kuo 263d605112 Auto-generate 2017-03-17 14:42:37 -07:00
Kubernetes Submit Queue f37cffcf4e Merge pull request #43239 from enisoc/kubectl-controller-ref
Automatic merge from submit-queue

kubectl: Use v1.5-compatible ownership logic when listing dependents.

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

This restores compatibility between kubectl 1.6 and clusters running Kubernetes 1.5.x. It introduces transitional ownership logic in which the client considers ControllerRef when it exists, but does not require it to exist.

If we were to ignore ControllerRef altogether (pre-1.6 client behavior), we would introduce a new failure mode in v1.6 because controllers that used to get stuck due to selector overlap will now make progress. For example, that means when reaping ReplicaSets of an overlapping Deployment, we would risk deleting ReplicaSets belonging to a different Deployment that we aren't about to delete.

This transitional logic avoids such surprises in 1.6 clusters, and does no worse than kubectl 1.5 did in 1.5 clusters. To prevent this when kubectl 1.5 is used against 1.6 clusters, we can cherrypick this change.

**Which issue this PR fixes**:

Fixes #43159

**Special notes for your reviewer**:

**Release note**:
```release-note
```
2017-03-17 14:25:38 -07:00
Janet Kuo bca3691029 Use json field names instead of go field names 2017-03-17 14:24:21 -07:00
Janet Kuo 4cebc865dc Update description of fields for DaemonSet rolling udpate 2017-03-17 14:12:00 -07:00
Dawn Chen d419efbe71 Fix unittest reflecting the default taint tolerations change for static
pods.
2017-03-17 14:06:34 -07:00
Hemant Kumar 1de4c5bbe0 Fix AWS untagged instances
To revert to 1.5 behaviour we need to consider untagged
instances if no clusterID has been specified or found.
2017-03-17 14:05:52 -04:00
Kubernetes Submit Queue fe08925805 Merge pull request #42869 from better88/patch-1
Automatic merge from submit-queue

Fix revision when SetDeploymentRevision

When some oldRSs be deleted or cleared(eg. revisionHistoryLimit set 0), the revision for  SetDeploymentRevision is incorrect
2017-03-17 10:55:29 -07:00
Dawn Chen d26e906191 Apply taint tolerations for NoExecute for all static pods. 2017-03-17 09:50:27 -07:00
better88 6c13a02026 Fix revision when SetDeploymentRevision 2017-03-17 23:23:41 +08:00
Kubernetes Submit Queue 8abb3ae7b2 Merge pull request #43269 from smarterclayton/fix_staging
Automatic merge from submit-queue

protobuf generation modifies types.go, which needs to be copied out

This was broken when we moved to the build container, but no one
noticed. Made it so that we get a test error if a field in a registered type has a json tag with no protobuf tag.

Fixes #35486
2017-03-17 00:10:25 -07:00
Kubernetes Submit Queue cdcec3f32b Merge pull request #43235 from caesarxuchao/tolerator-tpr-monitor-failure
Automatic merge from submit-queue

construction of GC should not fail for restmapper error caused by tpr

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

The issue is that GC will fail its initialization due to an RESTMapper error cause by tpr. This PR lets GC log the error instead of failing.
2017-03-16 23:23:31 -07:00
Kubernetes Submit Queue c119c254d6 Merge pull request #43259 from thockin/nodeport-allocation-polarity
Automatic merge from submit-queue

Fix polarity of a test in NodePort allocation

The result of this was that an update to a Service would release the
NodePort temporarily (the repair loop would fix it in a minute).  During
that window, another Service could get allocated that Port.

Fixes #43233
2017-03-16 22:39:30 -07:00
Jordan Liggitt 46b0da4320
generated files 2017-03-17 00:32:38 -04:00
Jordan Liggitt 8fda1c716b
Remove 'all namespaces' meaning of empty list in PodAffinityTerm 2017-03-17 00:32:07 -04:00
Clayton Coleman 6d2a3bdd60
Add a test that verifies all structs have protobuf tags 2017-03-17 00:29:14 -04:00
Kubernetes Submit Queue 4dffb61772 Merge pull request #42509 from caesarxuchao/comment
Automatic merge from submit-queue (batch tested with PRs 43254, 43255, 43184, 42509)

Update comment on the default DeletionPropagationPolicy

This is fixing the API doc, so apply the 1.6 milestone.

I'll run update-all.sh before merge.
2017-03-16 19:02:28 -07:00
Tim Hockin cb95c479cb Fix polarity of a test in NodePort allocation
The result of this was that an update to a Service would release the
NodePort temporarily (the repair loop would fix it in a minute).  During
that window, another Service could get allocated that Port.
2017-03-16 17:19:26 -07:00
Kubernetes Submit Queue a10c8f49ff Merge pull request #42931 from piosz/annotation-fix
Automatic merge from submit-queue

Setup fluentd-ds-ready label in startup script not in kubelet

fix #42840

``` release-note
TBD
```
2017-03-16 16:10:12 -07:00
Chao Xu 2378d39771 update-all.sh 2017-03-16 15:58:30 -07:00
Chao Xu 80686e67aa update comment on the default DeletionPropagationPolicy 2017-03-16 15:43:05 -07:00
Anthony Yeh de92f90f12 Deployment: Clear obsolete OverlapAnnotaiton.
This ensures old clients will not assume the Deployment is blocked.
2017-03-16 14:52:01 -07:00
Chao Xu 33da82bc67 construction of GC should not fail for restmapper error caused by tpr 2017-03-16 14:19:17 -07:00
Anthony Yeh fa23729a6d kubectl: Use v1.5-compatible ownership logic when listing dependents.
In particular, we should not assume ControllerRefs are necessarily set.
However, we can still use ControllerRefs that do exist to avoid
interfering with controllers that do use it.
2017-03-16 12:28:38 -07:00
Anthony Yeh 725ec0cc5e kubectl: Check for Deployment overlap annotation in reaper.
This effectively reverts the client-side changes in
cec3899b96.
We have to maintain the old behavior on the client side to support
version skew when talking to old servers that set the annotation.

However, the new server-side behavior is still to NOT set the
annotation.
2017-03-16 12:28:28 -07:00
Seth Jennings 753484d073 kubectl: fall back to computing QoS class if server does not populate 2017-03-16 12:24:59 -05:00
Piotr Szczesniak 9bd05bdee4 Setup fluentd-ds-ready label in startup script not in kubelet 2017-03-16 13:18:31 +01:00
Kubernetes Submit Queue 754effe332 Merge pull request #42949 from wenlxie/master
Automatic merge from submit-queue

recycle pod can't get the event since channel closed

What this PR does / why we need it:
We create a   hostPath type  PV with "Recycle" persistentVolumeReclaimPolicy,  and bind a PVC to it, but after deleted the PVC, the PV cannot become to available status. This is happened after we upgrade etcd to 3.0. The reason is:
If the channel used to get the pod message and events been abnormal closed(for example, the event channel maybe closed because of "required revision has been compacted" error), the function internalRecycleVolumeByWatchingPodUntilCompletion will stuck in a loop, and the recycle pod will not been deleted, the PV can not become into available status

Special notes for your reviewer:
None
Release note:
2017-03-16 02:41:11 -07:00
Kubernetes Submit Queue 2bec20ce55 Merge pull request #43122 from liggitt/protobuf-default
Automatic merge from submit-queue

Prevent protobuf storage with etcd2

Prevents accidentally storing protobuf content in etcd2 when upgrading to 1.6

c.f. https://github.com/kubernetes/kubernetes/issues/42976#issuecomment-286537139

```release-note
if kube-apiserver is started with `--storage-backend=etcd2`, the media type `application/json` is used.
```
2017-03-15 22:07:03 -07:00
Kubernetes Submit Queue ba25afd278 Merge pull request #40964 from tanshanshan/kubelet-unit-test
Automatic merge from submit-queue (batch tested with PRs 40964, 42967, 43091, 43115)

Improve code coverage for pkg/kubelet/status/generate.go

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

Improve code coverage for pkg/kubelet/status/generate.go  from #39559

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-03-15 16:08:23 -07:00
Jordan Liggitt 87e32c7532
Force etcd2 to use application/json, add base64-wrapper decoder as fallback 2017-03-15 11:24:12 -04:00
Kubernetes Submit Queue 0afdcfcaf6 Merge pull request #43114 from enisoc/deployment-upgrade-test
Automatic merge from submit-queue

Fix Deployment upgrade test.

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

When the upgrade test operates on Deployments in a pre-1.6 cluster (i.e. during the Setup phase), it needs to use the v1.5 deployment/util logic. In particular, the v1.5 logic does not filter children to only those with a matching ControllerRef.

**Which issue this PR fixes**:

Fixes #42738

**Special notes for your reviewer**:

**Release note**:
```release-note
```
cc @kubernetes/sig-apps-pr-reviews
2017-03-15 07:03:19 -07:00
Kubernetes Submit Queue df97434e8a Merge pull request #43110 from caesarxuchao/fix-42952
Automatic merge from submit-queue (batch tested with PRs 43106, 43110)

Wait for garbagecollector to be synced in test

Fix #42952

Without the `cache.WaitForCacheSync` in the test, it's possible for the GC to get a merged event of RC's creation and its update (update to deletionTimestamp != 0), before GC gets the creation event of the pod, so it's possible the GC will handle the foreground deletion of the RC before it adds the Pod to the dependency graph, thus the race.

With the `cache.WaitForCacheSync` in the test, because GC runs a single thread to process graph changes, it's guaranteed the Pod will be added to the dependency graph before GC handles the foreground deletion of the RC.

Note that this pull fixes the race in the test. The race described in the first point of #26120 still exists.
2017-03-15 06:14:21 -07:00
Kubernetes Submit Queue 222f69cf3c Merge pull request #43030 from yujuhong/rm_corrupted_checkpoint
Automatic merge from submit-queue (batch tested with PRs 42747, 43030)

dockershim: remove corrupted sandbox checkpoints

This is a workaround to ensure that kubelet doesn't block forever when
the checkpoint is corrupted.

This is a workaround for #43021
2017-03-14 22:56:20 -07:00
Kubernetes Submit Queue 1b4433d4c3 Merge pull request #42747 from dcbw/iptables-proxy-optimize
Automatic merge from submit-queue (batch tested with PRs 42747, 43030)

kube-proxy/iptables: optimize endpoint map creation by excluding invalid endpoints earlier

We don't need to do as much work as we were doing, if we exclude invalid endpoints earlier in the endpoints processing.

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

@freehan @liggitt @thockin if you could review this with a fine-toothed comb...  I can't immediately think of why invalid endpoints would be useful for the HealthChecker, and this PR prevents the HC from seeing these endpoints.
2017-03-14 22:56:18 -07:00
Kubernetes Submit Queue 792a24ac01 Merge pull request #43118 from yujuhong/sync_checkpoint
Automatic merge from submit-queue

dockershim: call sync() after writing the checkpoint

This ensures the checkpoint files are persisted.

This fixes #43021
2017-03-14 21:12:49 -07:00
Kubernetes Submit Queue fea42bade0 Merge pull request #42854 from vladimirvivien/scaleio-k8s-fix-readOnly
Automatic merge from submit-queue (batch tested with PRs 42854, 43105, 43090)

Update ScaleIO volume plugin default readOnly value

This commit updates the code to set readOnly attribute to be set to false.

**What this PR does / why we need it**:
This PR is a minor fix that updates the default value of `readOnly` attribute to `false`.

**Release note**:

```release-note
NONE
```
2017-03-14 18:44:18 -07:00
Yu-Ju Hong 48afc7d4e0 dockershim: call sync() after writing the checkpoint
This ensures the checkpoint files are persisted.
2017-03-14 18:36:51 -07:00
Anthony Yeh 0c015927c4 Fix Deployment upgrade test.
When the upgrade test operates on Deployments in a pre-1.6 cluster
(i.e. during the Setup phase), it needs to use the v1.5 deployment/util
logic. In particular, the v1.5 logic does not filter children to only
those with a matching ControllerRef.
2017-03-14 17:39:29 -07:00
Chao Xu 0605ba7a6d wait for garbagecollector to be synced in test 2017-03-14 16:19:33 -07:00
Kubernetes Submit Queue f8dd2569a1 Merge pull request #42991 from jsafrane/fix-default-beta
Automatic merge from submit-queue (batch tested with PRs 42775, 42991, 42968, 43029)

Remove 'beta' from default storage class annotation

I forgot to update default storage class annotation in my storage.k8s.io/v1beta1 -> v1 PRs. Let's fix it before 1.6 is released.

I consider it as a bugfix, in #40088 I already updated the release notes to include non-beta annotation  `storageclass.kubernetes.io/is-default-class`

```release-note
NONE
```


@kubernetes/sig-storage-pr-reviews 
@msau42, please help with merging.
2017-03-14 13:52:41 -07:00
Kubernetes Submit Queue c11498a34d Merge pull request #42775 from gyliu513/kubectl-taint
Automatic merge from submit-queue (batch tested with PRs 42775, 42991, 42968, 43029)

`kubectl taint` update for `NoExecute`.

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

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

**Special notes for your reviewer**:
Fixes #42774
**Release note**:

```release-note
```
2017-03-14 13:52:39 -07:00
Kubernetes Submit Queue a8d8542fc7 Merge pull request #42765 from janetkuo/ds-update-validation-fix
Automatic merge from submit-queue

Add DaemonSet templateGeneration validation and tests, and fix a bunch of validation test errors

For DaemonSet update:
1. Validate that templateGeneration is increased when and only when template is changed
1. Validate that templateGeneration is never decreased
1. Added validation tests for templateGeneration 
1. Fix a bunch of errors in validate tests
   - fake tests: almost all validation test error cases failed on "missing resource version", "name changes", "missing update strategy", "selector/template labels mismatch", not on the real validation we wanted to test
   - some error cases should be success cases

@kargakis @lukaszo @kubernetes/sig-apps-bugs 

*I've verified locally that all DaemonSet e2e tests pass with this change.*
2017-03-14 12:54:49 -07:00
Vladimir Vivien 0715b32439 Update ScaleIO volume plugin default readOnly value
This commit updates the code to set the default value of the readOnly attribute to false.
It also updates the example docs to add full list of supported plugin attributes and doc.
2017-03-14 14:19:48 -04:00
Kubernetes Submit Queue 70b3848bce Merge pull request #42935 from yifan-gu/fix_flock
Automatic merge from submit-queue (batch tested with PRs 42942, 42935)

pkg/util/flock: Fix the flock so it actually locks.

With this PR, the second call to `Acquire()` will block unless the lock is released (process exits).
Also removed the memory mutex in the previous code since we don't need `Release()` here so no need to save and protect the local fd.

Fix #42929.
2017-03-14 10:19:18 -07:00