Commit Graph

20487 Commits (d77378a68833ee534c0a814720b57c3dbbafc3f1)

Author SHA1 Message Date
Kubernetes Submit Queue d86a01570b Merge pull request #44439 from kargakis/fix-saturation-check
Automatic merge from submit-queue (batch tested with PRs 44741, 44853, 44572, 44797, 44439)

controller: fix saturation check in Deployments

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

@kubernetes/sig-apps-bugs 

I'll cherry-pick this back to 1.6 and 1.5
2017-04-25 01:56:42 -07:00
Kubernetes Submit Queue 9dde8ec68c Merge pull request #44572 from rickypai/rpai/tests_for_managed_etc_hosts_content
Automatic merge from submit-queue (batch tested with PRs 44741, 44853, 44572, 44797, 44439)

add tests for managed hosts file content

**What this PR does / why we need it**: a tiny refactor to separate concerns host file content from the logic ensuring that the file exists, and also adds unit test.

This is to prepare extending the host file logic to include customized entries described in https://github.com/kubernetes/kubernetes/issues/43632. I'm wary of changing that logic in absence of any unit tests.

**Release note**:
```release-note
NONE
```
2017-04-25 01:56:39 -07:00
Kubernetes Submit Queue 82cde2182f Merge pull request #44741 from MrHohn/esipp-validation-refine
Automatic merge from submit-queue

Refine ESIPP validation logic in validation.go

Separated from #41162.

The previous ESIPP validation logic in validation.go has a huge overlap with [function healthCheckNodePortUpdate in service/rest.go](870585e8e1/pkg/registry/core/service/rest.go (L283-L373)), in which we reject any invalid modifications on ESIPP annotations.

This PR removes the overlap, and make validation.go only check if values are legal and whether user mixes different API versions (alpha & beta).

We are indeed removing the alpha annotation support, but it is kept in the codes for the ease of transiting the same logic onto beta/GA.

/assign @thockin @freehan 

**Release note**:

```release-note
NONE
```
2017-04-25 00:46:03 -07:00
Kubernetes Submit Queue 9ac111c5f9 Merge pull request #44825 from rata/remove-unused-abstraction
Automatic merge from submit-queue (batch tested with PRs 40060, 44860, 44865, 44825, 44162)

Remove unused chmod/chown abstractions

**What this PR does / why we need it**: Simplifies the code

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-24 23:07:44 -07:00
Kubernetes Submit Queue badd785839 Merge pull request #40060 from justinsb/remove_unused_zone
Automatic merge from submit-queue (batch tested with PRs 40060, 44860, 44865, 44825, 44162)

servicecontroller: remove unused zone field

The zone field was unused, and this complicated e.g. #39996

```release-note
NONE
```
2017-04-24 23:07:38 -07:00
Kubernetes Submit Queue f4b1968b91 Merge pull request #44207 from shiywang/hotfix
Automatic merge from submit-queue

Add --all support for view-last-applied 

Fixes https://github.com/kubernetes/kubernetes/issues/44195
sorry for my careless, and thanks for the review, @ymqytw ptal
2017-04-24 20:25:48 -07:00
Kubernetes Submit Queue 6c8cb33fb3 Merge pull request #42101 from Dmitry1987/feature/hpa-upscale-downscale-delay-configurable
Automatic merge from submit-queue (batch tested with PRs 44862, 42241, 42101, 43181, 44147)

Feature/hpa upscale downscale delay configurable

**What this PR does / why we need it**:
Makes "upscale forbidden window" and "downscale forbidden window"  duration configurable in arguments of kube-controller-manager. Those are options of horizontal pod autoscaler.

**Special notes for your reviewer**:
Please have a look @DirectXMan12 , the PR as discussed in Slack.

**Release note**:
```
Make "upscale forbidden window" and "downscale forbidden window"  duration configurable in arguments of kube-controller-manager. Those are options of horizontal pod autoscaler. Right now are hardcoded 3 minutes for upscale, and 5 minutes to downscale.  But sometimes cluster administrator might want to change this for his own needs.
```
2017-04-24 19:39:42 -07:00
Kubernetes Submit Queue 390e98721f Merge pull request #42241 from xiangpengzhao/shortname-np
Automatic merge from submit-queue (batch tested with PRs 44862, 42241, 42101, 43181, 44147)

Add short name "netpol" for networkpolicies

**What this PR does / why we need it**:
Add short name for `networkpolicies` in kubectl command for good user experience.

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

**Special notes for your reviewer**:
None

**Release note**:

```release-note
Add short name "netpol" for networkpolicies
```
2017-04-24 19:39:40 -07:00
Kubernetes Submit Queue ed539fb76f Merge pull request #39404 from adohe/refactor_edit
Automatic merge from submit-queue

add EditOptions to make edit reusable

FYI. Added `EditOptions` to decouple edit implementation from cobra command, thus make edit reusable. Once this get merged, we can refactor `create` commands to put them in their own package. @kubernetes/sig-cli-misc please give a quick review, and I would like to get this merged asap.
2017-04-24 16:20:39 -07:00
Ricky Pai e21da839e5 extract content-generation concern from `ensureHostsFile`
add tests to assert the output of `ensureHostsFile`
2017-04-24 12:33:45 -07:00
Kubernetes Submit Queue f0ce5bd8d8 Merge pull request #44672 from kargakis/update-deployment-completeness
Automatic merge from submit-queue (batch tested with PRs 43575, 44672)

Update deployment and daemonset completeness checks

maxUnavailable being taken into account for deployment completeness has caused a lot of confusion (https://github.com/kubernetes/kubernetes/issues/44395, https://github.com/kubernetes/kubernetes/issues/44657, https://github.com/kubernetes/kubernetes/issues/40496, others as well I am sure) so I am willing to just stop using it and require all of the new Pods for a Deployment to be available for the Deployment to be considered complete (hence both `rollout status` and ProgressDeadlineSeconds will not be successful in cases where a 1-pod Deployment never becomes successful because its Pod never transitions to ready).

@kubernetes/sig-apps-api-reviews thoughts?
```release-note
Deployments and DaemonSets are now considered complete once all of the new pods are up and running - affects `kubectl rollout status` (and ProgressDeadlineSeconds for Deployments)
```
Fixes https://github.com/kubernetes/kubernetes/issues/44395
2017-04-24 10:34:00 -07:00
Kubernetes Submit Queue 902d53d5e7 Merge pull request #43575 from dcbw/iptables-restore-lock
Automatic merge from submit-queue (batch tested with PRs 43575, 44672)

util/iptables: check for and use new iptables-restore 'wait' argument

iptables-restore did not previously perform any locking, meaning that
when callers (like kube-proxy) asked iptables-restore to write large
numbers of rules, the iptables-restore process might run in parallel
with other 'iptables' invocations in kubelet (hostports), docker,
and other software.  This causes errors like:

"CNI request failed with status 400: 'Failed to ensure that nat chain
POSTROUTING jumps to MASQUERADE: error checking rule: exit status 4:
iptables: Resource temporarily  unavailable."

or from Docker:

"Failed to allocate and map port 1095-1095: iptables failed:
iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 1095
-j DNAT --to-destination 10.1.0.2:1095 ! -i lbr0: iptables:
Resource temporarily unavailable.\n (exit status 4)"

iptables-restore "wait" functionality was added in iptables git
commit 999eaa241212d3952ddff39a99d0d55a74e3639e which
is not yet in a release.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1417234

@eparis @knobunc @kubernetes/rh-networking @kubernetes/sig-network-misc @freehan @thockin @brendandburns
2017-04-24 10:33:58 -07:00
Kubernetes Submit Queue 260e213f26 Merge pull request #44845 from zhangxiaoyu-zidif/fix-configmap-test
Automatic merge from submit-queue

configmap.go: add one initialization symbol
2017-04-24 07:56:09 -07:00
Kubernetes Submit Queue c90faa8071 Merge pull request #44779 from enj/enj/r/etcd_default_name_copy
Automatic merge from submit-queue (batch tested with PRs 44837, 44779, 44492)

Default ObjectNameFunc for all REST Stores

All `Store`s in Kubernetes follow the same logic for determining the name of an object.  This change makes it so that `CompleteWithOptions` defaults the `ObjectNameFunc` if it is not specified.  Thus a user does not need to remember to use `ObjectMeta.Name`.  Using the wrong field as the name can lead to an object which has a name that bypasses normal object name validation.

Signed-off-by: Monis Khan <mkhan@redhat.com>

cc @liggitt @soltysh for review

**Release note**:

```
NONE
```
2017-04-24 07:55:59 -07:00
Kubernetes Submit Queue b26d902070 Merge pull request #43517 from zjj2wry/007
Automatic merge from submit-queue

unit test for kubectl config set

**What this PR does / why we need it**:
unit test for kubectl config set

**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**:
think you

**Release note**:

```release-note
```
2017-04-24 06:27:52 -07:00
zhangxiaoyu-zidif b5c1aa5210 configmap.go: add one initialization symbol 2017-04-24 21:26:32 +08:00
Kubernetes Submit Queue d59cf76a61 Merge pull request #41384 from xilabao/support-create-subresource
Automatic merge from submit-queue

support subresource when running kubectl create role

```
#kubect create role foo --verb=get,list,watch --resource=pods/status
the server doesn't have a resource type "pods/status"
```
2017-04-24 05:39:38 -07:00
Kubernetes Submit Queue 56ea95fa83 Merge pull request #44745 from justinsb/lb_recognize_16_unschedulable
Automatic merge from submit-queue

Exclude master from LoadBalancer / NodePort

The servicecontroller documents that the master is excluded from the
LoadBalancer / NodePort, but this is broken for clusters where we are
using taints for the master (as introduced in 1.6), instead of marking
the master as unschedulable.

This restores the desired documented behaviour, by excluding nodes that
are labeled as masters with the new 1.6 labels, even if they use the new
1.6 taints.

Fix #33884

```release-note
Exclude nodes labeled as master from LoadBalancer / NodePort; restores documented behaviour
```
2017-04-23 21:37:42 -07:00
Kubernetes Submit Queue ce2f0b1937 Merge pull request #44387 from jamiehannaford/fix-port-allocation
Automatic merge from submit-queue

Use provided VipPortID for OpenStack LB

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

When creating an OpenStack LoadBalancer, Kubernetes will search through the tenant trying to match the LB's VIP with a port. This is problematic because multiple ports may have the same fixed IP, therefore leading to routing inconsistencies. We should use the port ID provided by the LB's response body instead.

**Which issue this PR fixes**:

https://github.com/kubernetes/kubernetes/issues/43909

**Special notes for your reviewer**:

Since this involves non-deterministic testing, it'd be best if we can run this in a staging environment for a few days before merging (say until early next week).

**Release note**:
```release-note
Fixes issue during LB creation where ports where incorrectly assigned to a floating IP
```
2017-04-23 20:50:49 -07:00
xilabao 19217bc4a2 support subresource when running kubectl create role 2017-04-24 10:05:47 +08:00
Rodrigo Campos 2eb1583e4b Remove unused chmod/chown abstractions
These abstractions have not been used since I first hacked into
kubernetes, so let's just remove them and add them back if it's needed
later.
2017-04-23 20:25:23 -03:00
Kubernetes Submit Queue 35159f9c45 Merge pull request #41763 from dhilipkumars/ImproveSrvCodeCov
Automatic merge from submit-queue

Improve Service controller's code coverage a little bit

**What this PR does / why we need it**:
Improves the code coverage for Service Controller
Before
```
go test --cover ./pkg/controller/service
ok      k8s.io/kubernetes/pkg/controller/service        0.101s  coverage: 23.4% of statements
```
After
```
go test --cover ./pkg/controller/service/
ok      k8s.io/kubernetes/pkg/controller/service        0.094s  coverage: 62.0% of statements
```

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

**Special notes for your reviewer**:

**Release note**: 

```release-note
NONE
```
2017-04-23 14:29:34 -07:00
Kubernetes Submit Queue e7ca665a0d Merge pull request #43896 from CaoShuFeng/list-meta
Automatic merge from submit-queue

Reorganize the output of "kubectl get -o json"

"resourceVersion" and "selfLink" are members of "metadata" rather than
the list. This change reorganize the struct to provide consistency with
other places.

Before this change:
```json
    "kind": "List",
    "metadata": {},
    "resourceVersion": "",
    "selfLink": ""
```
After this change:
```json
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
```

Reference:
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go#L57



**Release note**:

```release-note
NONE
```
2017-04-23 10:14:41 -07:00
Łukasz Oleś b9611b95f4 Skip pods and replica sets marked for deletion
Fixes #44144
2017-04-23 00:29:48 +02:00
Łukasz Oleś bbedf9e71e Add unit tests for ClaimPods 2017-04-23 00:29:45 +02:00
Kubernetes Submit Queue c289286647 Merge pull request #42612 from CaoShuFeng/create_role_trival
Automatic merge from submit-queue

add "bind" to validResourceVerbs in "create role" cli 

"bind" and "impersonate" are also a legal verbs according this:
https://github.com/kubernetes/kubernetes.github.io/pull/2771/files
**Release note**:

```NONE
```
2017-04-22 12:18:00 -07:00
dhilipkumars fadb275a9a Improve Service controller code coverage a little bit 2017-04-22 22:25:46 +05:30
Michail Kargakis f1e8356265
Deployments complete only when all desired pods are available
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-04-22 17:18:10 +02:00
Michail Kargakis 0a59f6c487
Revert respecting maxUnavailable for DaemonSets
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-04-22 17:18:09 +02:00
Michail Kargakis 1923cc60c9
Revert "kubectl: respect deployment strategy parameters for rollout status"
This reverts commit d20ac8766e.
2017-04-22 17:18:06 +02:00
Kubernetes Submit Queue e0ba40b67c Merge pull request #39716 from zhouhaibing089/etcd-health-check
Automatic merge from submit-queue

etcd component status check should include credentials

- [x] Add TLS credentials into `pkg/genericapiserver.Backend`.
- [x] Add TLS credentials into `pkg/registry/core/componentstatus.Server`.
- [x] `pkg/probe/http.httpProber` should accept the TLS credentials.

Now it is working.

```console
$ kubectl get cs
NAME                 STATUS    MESSAGE              ERROR
scheduler            Healthy   ok
controller-manager   Healthy   ok
etcd-0               Healthy   {"health": "true"}
```

Fixes https://github.com/kubernetes/kubernetes/issues/27343.
2017-04-22 07:30:30 -07:00
Kubernetes Submit Queue 12c6b0c23b Merge pull request #44547 from ketkulka/icmp-reject
Automatic merge from submit-queue

Reject Rules for ExternalIP and svc port if no ep

- Install ICMP Reject Rules for externalIP and svc port
  if no endpoints are present
- Includes Unit Test case
- Fixes #44516 



**What this PR does / why we need it**:
Explained in issue #44516 
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
`Fixes #44516`

**Special notes for your reviewer**:
Similar to #43415 
Feedback welcome. Will be happy to improve the patch. 
Unit Test done and passing. 

**Release note**:

```release-note
```
2017-04-21 18:58:38 -07:00
Ketan Kulkarni ac7c026ee7 Reject Rules for ExternalIP and svc port if no ep
- Install ICMP Reject Rules for externalIP and svc port
  if no endpoints are present
- Includes Unit Test case
- Fixes #44516
2017-04-21 16:48:24 -07:00
Kubernetes Submit Queue f11f72ece8 Merge pull request #42486 from jcbsmpsn/certificate-manager-bootstrap
Automatic merge from submit-queue

Add bootstrap support to certificate manager.

Adds configuration options to certificate manager for using bootstrap cert/key
pairs to handle the scenario where new nodes are initialized using a generic
cert/key pair. Bootstrap cert/key pairs are quickly rotated, independent of
duration remaining, so that each kubelet has a unique cert/key pair.
2017-04-21 16:37:44 -07:00
Kubernetes Submit Queue 3317957a33 Merge pull request #44730 from kow3ns/fix-44229
Automatic merge from submit-queue (batch tested with PRs 44625, 43594, 44756, 44730)

Check for terminating Pod prior to launching successor in StatefulSet

Modifies sync loop for StatefulSet controller to check if a Pod is terminating before launching its successor. Fixes #44229. Should be cherry picked into 1.6 branch.

**Which issue this PR fixes**
fixes #44229 

```release-note
NONE
```
2017-04-21 13:49:06 -07:00
Kubernetes Submit Queue 2af498a056 Merge pull request #44756 from wojtek-t/faster_kube_proxy_2
Automatic merge from submit-queue (batch tested with PRs 44625, 43594, 44756, 44730)

Don't rebuild service map in iptables kube-proxy all the time

A sibling PR to https://github.com/kubernetes/kubernetes/pull/44494 (doing pretty much the same for services that we did for endpoints).
2017-04-21 13:49:03 -07:00
Kubernetes Submit Queue a061d072ac Merge pull request #44625 from liggitt/token-controller
Automatic merge from submit-queue (batch tested with PRs 44625, 43594, 44756, 44730)

Retry secret reference addition on conflict

* Tolerates leading or trailing etcd reads when fetching liveServiceAccount - fixes #25416
* Tolerates conflicts when updating the service account with the secret reference (does RetryOnConflict before deleting token and completely restarting the flow) - fixes #44054
2017-04-21 13:48:59 -07:00
Monis Khan ed35deb69d
Default ObjectNameFunc for all REST Stores
All Stores in Kubernetes follow the same logic for determining the name
of an object.  This change makes it so that CompleteWithOptions defaults
the ObjectNameFunc if it is not specified.  Thus a user does not need to
remember to use ObjectMeta.Name.  Using the wrong field as the name can
lead to an object which has a name that bypasses normal object name
validation.

Signed-off-by: Monis Khan <mkhan@redhat.com>
2017-04-21 15:47:25 -04:00
Kubernetes Submit Queue b19589df31 Merge pull request #44642 from supereagle/fix-comment-error
Automatic merge from submit-queue (batch tested with PRs 42202, 40784, 44642, 44623, 44761)

fix comment error for network plugin

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-21 11:52:07 -07:00
Kubernetes Submit Queue af57b82bfc Merge pull request #40784 from adamreese/fix/clientcache-threadsafe
Automatic merge from submit-queue (batch tested with PRs 42202, 40784, 44642, 44623, 44761)

make kubectl clientcache thread safe

**What this PR does / why we need it**:
Prevent panics when accessing kubectl client cache concurrently.

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

https://github.com/kubernetes/helm/issues/1879
2017-04-21 11:52:05 -07:00
Kubernetes Submit Queue 0acb7210ac Merge pull request #42202 from squeed/update-cni
Automatic merge from submit-queue (batch tested with PRs 42202, 40784, 44642, 44623, 44761)

Update CNI plugin to newest version; support ConfigLists

**What this PR does / why we need it**: Updates the CNI network plugin to use the newest version of CNI. This brings with it plugin chaining and support for multiple versions.

**Special notes for your reviewer**: This libcni change is backwards-compatible - older plugins will work without any changes needed.

**Release note**:
```release-note
This adds support for CNI ConfigLists, which permit plugin chaining.
```
2017-04-21 11:52:02 -07:00
Kubernetes Submit Queue f613e66ad6 Merge pull request #44543 from xilabao/fix-warning-in-auth
Automatic merge from submit-queue

remove warning infomation when using '*'

```
#kubectl auth can-i "*" "*"
Warning: the server doesn't have a resource type '*'
yes
```
2017-04-21 10:12:56 -07:00
Kubernetes Submit Queue 25ec2607dd Merge pull request #44763 from ncdc/fix-replication-controller-log-ptr-check
Automatic merge from submit-queue

More RC/RS controller logging updates

We were comparing the address of the old and new RC.spec.replicas and we
have to compare the values. This only affects logging.

Update RS controller to match RC controller to log when spec.replicas
changes, not status.replicas.

@kargakis @janetkuo @sttts @liggitt
2017-04-21 09:22:27 -07:00
Kenneth Owens 7d22e64284 StatefulSet should not launch Pod i, if a Pod in the sequence [0,i) has its
DeletionTimestamp set. Fixes 44229.
Rename isTerminated to isTerminating
Adds a test case for at the unit level to prevent regression
2017-04-21 08:38:21 -07:00
Kubernetes Submit Queue 3559c067c6 Merge pull request #41571 from php-coder/fix_comments
Automatic merge from submit-queue

Minor cleanups

Minor improvements:
- `ValidateNoNewFinalizers`: remove unused const
- Mention that mutation of `spec.initContainers[*].image` field is allowed
- Improve godoc comments
2017-04-21 08:34:07 -07:00
Kubernetes Submit Queue 8e3d32b141 Merge pull request #44710 from xiangpengzhao/describe-print-rc-rs-conditions
Automatic merge from submit-queue

Print conditions of RC/RS in 'kubectl describe' command

**What this PR does / why we need it**:
If conditions of RC/RS exist, print them in 'kubectl describe' command.

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

**Special notes for your reviewer**:


**Release note**:

```release-note
Print conditions of RC/RS in 'kubectl describe' command.
```
2017-04-21 07:47:29 -07:00
Kubernetes Submit Queue 910c9d1ec7 Merge pull request #44729 from liggitt/non-resource-url-test
Automatic merge from submit-queue

Add nonResourceURL wildcard coverage tests

Ensure `*` covering all paths is tested
2017-04-21 06:10:26 -07:00
Kubernetes Submit Queue 4d26abdfbb Merge pull request #44755 from humblec/gluster-var
Automatic merge from submit-queue

Replace variable name to be more go friendly.
2017-04-21 06:10:13 -07:00
Wojciech Tyczynski a0418d01ac Merge pull request #44760 from tsmetana/issue44757
Fix issue #44757: Flaky Test_AttachDetachControllerRecovery
2017-04-21 14:36:06 +02:00
Andy Goldstein 4a47c47650 More RC/RS controller logging updates
We were comparing the address of the old and new RC.spec.replicas and we
have to compare the values. This only affects logging.

Update RS controller to match RC controller to log when spec.replicas
changes, not status.replicas.
2017-04-21 08:07:18 -04:00