Commit Graph

15615 Commits (09e42764483ecd1c1a71863518beba5b98241f71)

Author SHA1 Message Date
Kubernetes Submit Queue f9dd76564c Merge pull request #33686 from ymqytw/format_json_printer_for_runtime.Unknown
Automatic merge from submit-queue

formatting json printer for runtime.Unknown

Formatting JSONPrinter.
It prints everything in one single line before.
Now it prints in well-formatted way.
2016-09-30 06:13:17 -07:00
Kubernetes Submit Queue e05d568b40 Merge pull request #33810 from feiskyer/portforward
Automatic merge from submit-queue

Fake docker portfoward for in-process docker CRI integration

This is necessary to pass e2e tests for in-process docker CRI integration.

This is part of #31459.

cc/ @Random-Liu @kubernetes/sig-node
2016-09-30 00:52:34 -07:00
Kubernetes Submit Queue a2cd107e14 Merge pull request #32373 from nebril/petset-count-test-master
Automatic merge from submit-queue

PetSet replica count status test

**What this PR does / why we need it**: It adds a test for PetSet status replica count. It should fail now, but will pass when https://github.com/kubernetes/kubernetes/pull/32117 is merged.

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

**Special notes for your reviewer**: It will need to be rebased after #32117 is merged in, don't need detailed review before that.

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

Added fakeKubeClient and other fake types needed to test what is sent to
API when replica count is updated. These fakes can be extended for
other tests.
2016-09-29 23:37:18 -07:00
Kubernetes Submit Queue a180864173 Merge pull request #33709 from yifan-gu/add_dns_opt
Automatic merge from submit-queue

CRI: Add dns option, rename DNSOption to DNSConfig.

Today, the DNS opt string is hardcoded in multiple places [[1]](https://github.com/kubernetes/kubernetes/blob/v1.5.0-alpha.0/pkg/kubelet/rkt/rkt.go#L117) [[2]](https://github.com/kubernetes/kubernetes/blob/v1.5.0-alpha.0/pkg/kubelet/dockertools/docker_manager.go#L88), we'd probably move the default to kubelet, and pass down to runtimes.

/cc @kubernetes/sig-node @kubernetes/sig-rktnetes @feiskyer @thockin
2016-09-29 22:59:27 -07:00
Kubernetes Submit Queue 8f918d361b Merge pull request #33809 from Random-Liu/fix-mount-issue-in-dockershim
Automatic merge from submit-queue

CRI: Fix mount issue in dockershim.

For https://github.com/kubernetes/kubernetes/issues/33189.

The test `Container Runtime Conformance Test container runtime conformance blackbox test when starting a container that exits should report termination message if TerminationMessagePath is set` flakes a lot. (see https://k8s-testgrid.appspot.com/google-node#kubelet-cri-gce-e2e&width=5)

After some investigation, I found the problem is that we are using pointer of iterator.

This fixes the flake.

@yujuhong @feiskyer
2016-09-29 21:44:07 -07:00
Pengfei Ni dd14f6368a Fake docker portfoward for in-process docker CRI integration 2016-09-30 11:30:45 +08:00
Kubernetes Submit Queue 6a46bf1bd3 Merge pull request #33274 from nebril/headless-lb
Automatic merge from submit-queue

Disallow headless Services with LB type

**What this PR does / why we need it**: It adds new validation rule for Services, to ensure that creating LoadBalancer type service with cluster IP set to "None" fails.

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

**Release note**:
```release-note
Creating LoadBalancer Service with "None" ClusterIP is no longer possible
```
2016-09-29 20:28:55 -07:00
Random-Liu ab502f32a7 Fix mount issue in dockershim. 2016-09-29 20:13:39 -07:00
Kubernetes Submit Queue cfb833e86a Merge pull request #33628 from mbohlool/co2
Automatic merge from submit-queue

Add OpenAPI specs to source tree

Similar to swagger spec, adding openapi specs in a separate folder api/openapi-spec

To make sure we generate a consistent spec, parameters need to be sorted first.
2016-09-29 19:52:32 -07:00
mbohlool 1809f06a2c Generated openapi-spec 2016-09-29 17:03:31 -07:00
mbohlool 35b5174bf1 Generate and verify openapi specs in source tree at api/openapi-spec 2016-09-29 17:03:31 -07:00
Kubernetes Submit Queue 47e611b989 Merge pull request #33581 from hongchaodeng/r1
Automatic merge from submit-queue

revert #32012 (Unshare cluster in each test suite)

revert https://github.com/kubernetes/kubernetes/pull/32012

Since #33393 is merged, the bug should have been fixed.
2016-09-29 15:12:41 -07:00
Kubernetes Submit Queue a1b1a1a728 Merge pull request #33512 from deads2k/api-15-move-core-reststorage
Automatic merge from submit-queue

move core storage out of master.go

Moves the core resource creation out of master.go and makes it more congruent to the other storages.

WIP because I haven't run tests yet, but I figured I'd see what breaks in the morning.
2016-09-29 14:35:20 -07:00
Yifan Gu 44ca3ea5e0 CRI: Add dns option, rename DNSOption to DNSConfig. 2016-09-29 13:46:32 -07:00
deads2k 5080a575ad add anytoken authenticator 2016-09-29 14:14:06 -04:00
deads2k 1123f6788b move third party resource tests 2016-09-29 13:52:20 -04:00
Kubernetes Submit Queue d187997c94 Merge pull request #32386 from liggitt/anonymous-authenticated-groups
Automatic merge from submit-queue

Allow anonymous API server access, decorate authenticated users with system:authenticated group

When writing authorization policy, it is often necessary to allow certain actions to any authenticated user. For example, creating a service or configmap, and granting read access to all users

It is also frequently necessary to allow actions to any unauthenticated user. For example, fetching discovery APIs might be part of an authentication process, and therefore need to be able to be read without access to authentication credentials.

This PR:
* Adds an option to allow anonymous requests to the secured API port. If enabled, requests to the secure port that are not rejected by other configured authentication methods are treated as anonymous requests, and given a username of `system:anonymous` and a group of `system:unauthenticated`. Note: this should only be used with an `--authorization-mode` other than `AlwaysAllow`
* Decorates user.Info returned from configured authenticators with the group `system:authenticated`.

This is related to defining a default set of roles and bindings for RBAC (https://github.com/kubernetes/features/issues/2). The bootstrap policy should allow all users (anonymous or authenticated) to request the discovery APIs.

```release-note
kube-apiserver learned the '--anonymous-auth' flag, which defaults to true. When enabled, requests to the secure port that are not rejected by other configured authentication methods are treated as anonymous requests, and given a username of 'system:anonymous' and a group of 'system:unauthenticated'. 

Authenticated users are decorated with a 'system:authenticated' group.

NOTE: anonymous access is enabled by default. If you rely on authentication alone to authorize access, change to use an authorization mode other than AlwaysAllow, or or set '--anonymous-auth=false'.
```

c.f. https://github.com/kubernetes/kubernetes/issues/29177#issuecomment-244191596
2016-09-29 10:47:49 -07:00
Kubernetes Submit Queue 8dd83ddbe6 Merge pull request #33733 from wojtek-t/fix_http2
Automatic merge from submit-queue

Use multiple clients in load test to avoid "no cached connections" er…

Fix #33711
2016-09-29 09:21:24 -07:00
ymqytw d74704254d formatting json printer for runtime.Unknown 2016-09-29 08:45:08 -07:00
Kubernetes Submit Queue 5a59f3bbcc Merge pull request #33626 from lojies/changeport
Automatic merge from submit-queue

use len(params["port"]) > 0 to replace port > 0

**What this PR does / why we need it**:
port also needs to be passed to server when port is negative or zero.
this is an omission of pr https://github.com/kubernetes/kubernetes/pull/29605

**Which issue this PR fixes**: 

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-09-29 07:52:38 -07:00
Wojciech Tyczynski df8f83fd51 Use multiple clients in load test to avoid "no cached connections" errors. 2016-09-29 16:32:57 +02:00
Kubernetes Submit Queue 10239c983d Merge pull request #32850 from m1093782566/m109-disruption
Automatic merge from submit-queue

fix disruption controller hotloop

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


Fix disruption controller hotloop on unexpected API server rejections.

**Which issue this PR fixes** 

Related issue is #30629

**Special notes for your reviewer**:

@deads2k @derekwaynecarr PTAL.
2016-09-29 07:10:15 -07:00
deads2k 1c667e4fc5 move core storage out of master.go 2016-09-29 09:39:23 -04:00
Kubernetes Submit Queue 24031f50d6 Merge pull request #33735 from jszczepkowski/hpa-pending-fix
Automatic merge from submit-queue

Fixes in HPA: consider only running pods; proper denominator in avg.

Fixes in HPA: consider only running pods; proper denominator in avg request calculations.
2016-09-29 04:48:51 -07:00
mbohlool 15fbbacc33 Sort OpenAPI operation and path parameters 2016-09-29 03:10:48 -07:00
Jerzy Szczepkowski 0f0a9b6d61 Fixes in HPA: consider only running pods; proper denominator in avg calculations.
Fixes in HPA: consider only running pods; proper denominator in avg calculations.
2016-09-29 11:20:53 +02:00
Kubernetes Submit Queue 50e12ff5a2 Merge pull request #33575 from sttts/sttts-defaulted-config
Automatic merge from submit-queue

Decouple genericapiserver setDefault from New()
2016-09-29 01:52:46 -07:00
Maciej Kwiek 9e1c886a80 Validate None Service ClusterIP against LB type
If the Service is a Load Balancer, it should not have None Cluster IP.
If it does, Service validation fails.
2016-09-29 10:17:29 +02:00
Maciej Kwiek caf2411f88 PetSet replica count status test 2016-09-29 10:07:14 +02:00
Kubernetes Submit Queue 5d218f938a Merge pull request #33242 from dims/fix-cors-hander-issue-33231
Automatic merge from submit-queue

Support Access-Control-Expose-Headers in CORS Handler

Our typical HTTP Response has a "Date" Header, if we don't add an
additional http header "Access-Control-Expose-Headers: Date" then
the browser based clients cannot use the Date HTTP Header.

Fixes #33231

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
When CORS Handler is enabled, we now add a new HTTP header named "Access-Control-Expose-Headers" with a value of "Date". This allows the "Date" HTTP header to be accessed from XHR/JavaScript.
```
2016-09-29 00:49:04 -07:00
Kubernetes Submit Queue b840605197 Merge pull request #33677 from juanvallejo/jvallejo/add-linebreak-between-resource-groups
Automatic merge from submit-queue

add linebreak between resource groups

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

Printing multiple groups via `kubectl get all` can produce output that is
hard to read in cases where there are a lot of resource types to display
/ some resource types contain varying column amounts.

This patch adds a linebreak above each group of resources only when
there is more than one group to display, and always omitting the
linebreak above the first group. This makes for slightly improved
output.

Linebreaks are printed to stderr, and honor the `--no-headers` option.

**Before**

```
$ kubectl get all
NAME                     READY     STATUS    RESTARTS   AGE
po/database-1-u9m9l      1/1       Running   3          5d
po/idling-echo-1-9fmz6   2/2       Running   8          5d
po/idling-echo-1-gzb0v   2/2       Running   4          5d
NAME               DESIRED   CURRENT   READY     AGE
rc/database-1      1         1         1         6d
rc/idling-echo-1   2         2         2         6d
NAME              CLUSTER-IP       EXTERNAL-IP   PORT(S)
AGE
svc/database      172.30.11.104    <none>        5434/TCP
6d
svc/frontend      172.30.196.217   <none>        5432/TCP
6d
svc/idling-echo   172.30.115.67    <none>        8675/TCP,3090/UDP
6d
svc/kubernetes    172.30.0.1       <none>        443/TCP,53/UDP,53/TCP
6d
svc/mynodeport    172.30.81.254    <nodes>       8080/TCP
5d
svc/mynodeport1   172.30.198.193   <nodes>       8080/TCP
5d
svc/mynodeport2   172.30.149.48    <nodes>       8080/TCP
5d
svc/mynodeport3   172.30.195.235   <nodes>       8080/TCP
5d
```

**After**

```
$ kubectl get all
NAME                     READY     STATUS    RESTARTS   AGE
po/database-1-u9m9l      1/1       Running   3          5d
po/idling-echo-1-9fmz6   2/2       Running   8          5d
po/idling-echo-1-gzb0v   2/2       Running   4          5d

NAME               DESIRED   CURRENT   READY     AGE
rc/database-1      1         1         1         6d
rc/idling-echo-1   2         2         2         6d

NAME              CLUSTER-IP       EXTERNAL-IP   PORT(S)
AGE
svc/database      172.30.11.104    <none>        5434/TCP
6d
svc/frontend      172.30.196.217   <none>        5432/TCP
6d
svc/idling-echo   172.30.115.67    <none>        8675/TCP,3090/UDP
6d
svc/kubernetes    172.30.0.1       <none>        443/TCP,53/UDP,53/TCP
6d
svc/mynodeport    172.30.81.254    <nodes>       8080/TCP
5d
svc/mynodeport1   172.30.198.193   <nodes>       8080/TCP
5d
svc/mynodeport2   172.30.149.48    <nodes>       8080/TCP
5d
svc/mynodeport3   172.30.195.235   <nodes>       8080/TCP
5d
```

cc @fabianofranz @liggitt
2016-09-28 23:13:07 -07:00
Dr. Stefan Schimanski 6f781625db Make genericapiserver Config.Complete type safe 2016-09-29 08:09:39 +02:00
Dr. Stefan Schimanski 61409c821b Turn embedding into composition: master.Config.{Config -> GenericConfig} 2016-09-29 08:09:39 +02:00
Kubernetes Submit Queue faac71c0dc Merge pull request #31818 from juanvallejo/jvallejo_suggest-explain-cmd-in-kube-get
Automatic merge from submit-queue

suggest use of `kube explain <resource>` in kube get output

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

This patch improves usability flow, making it easier for a user to
discover the command `kube explain <resource>` through `kube get` output.

##### After
```
$ kube get
You must specify the type of resource to get. Valid resource types include:
   * componentstatuses (aka 'cs')
   * configmaps (aka 'cm')
   * daemonsets (aka 'ds')
   * deployments (aka 'deploy')
   * events (aka 'ev')
   * endpoints (aka 'ep')
   * horizontalpodautoscalers (aka 'hpa')
   * ingress (aka 'ing')
   * jobs
   * limitranges (aka 'limits')
   * nodes (aka 'no')
   * namespaces (aka 'ns')
   * petsets (alpha feature, may be unstable)
   * pods (aka 'po')
   * persistentvolumes (aka 'pv')
   * persistentvolumeclaims (aka 'pvc')
   * quota
   * resourcequotas (aka 'quota')
   * replicasets (aka 'rs')
   * replicationcontrollers (aka 'rc')
   * secrets
   * serviceaccounts (aka 'sa')
   * services (aka 'svc')
error: Required resource not specified.
Use "kubectl explain <resource>" for a detailed description of that resource (e.g. kubectl explain pods).
See 'kubectl get -h' for help and examples.
```
2016-09-28 21:59:29 -07:00
Kubernetes Submit Queue baa4bf763c Merge pull request #27832 from wu8685/k8s-inotify
Automatic merge from submit-queue

kubelet detects pod manifest files in the directory using inotify #27137
2016-09-28 20:45:50 -07:00
Kubernetes Submit Queue 7dcae5edd8 Merge pull request #25260 from duglin/minion
Automatic merge from submit-queue

Change minion to node

Continuation of #1111

I tried to keep this PR down to just a simple search-n-replace to keep
things simple.  I may have gone too far in some spots but its easy to
roll those back if needed - just let me know.

I avoided renaming `contrib/mesos/pkg/minion` because there's already
a `contrib/mesos/pkg/node` dir and fixing that will require a bit of work
due to a circular import chain that pops up. So I'm saving that for a
follow-on PR.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-09-28 20:08:59 -07:00
Kubernetes Submit Queue 50e438a3c1 Merge pull request #33705 from yujuhong/add_owners
Automatic merge from submit-queue

Add fewer more owners for packages in kubelet
2016-09-28 18:49:52 -07:00
Kubernetes Submit Queue 80123cb680 Merge pull request #31684 from nebril/refactor-docker-manager-test
Automatic merge from submit-queue

Pod creation moved outside of docker manager tests

**What this PR does / why we need it**:
It cleans up docker manager tests a little.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: related to #31550

**Special notes for your reviewer**:
I don't claim that working on this issue is finished, I cleaned up the tests just a bit
**Release note**:
```release-note
NONE
```
2016-09-28 18:10:26 -07:00
Yu-Ju Hong 2c64a29de1 Add fewer more owners for packages in kubelet 2016-09-28 17:57:24 -07:00
Kubernetes Submit Queue f70ac7da2d Merge pull request #33516 from yifan-gu/immutable_sandbox_config
Automatic merge from submit-queue

CRI: Add more docs abount pod sandbox config in CreateContainerRequest.

Makes it clear that the config will not change during the pod lifecycle.
The field is only for convenience.
2016-09-28 16:47:08 -07:00
Davanum Srinivas 1b67df90fa Support Access-Control-Expose-Headers in CORS Handler
Our typical HTTP Response has a "Date" Header, if we don't add an
additional http header "Access-Control-Expose-Headers: Date" then
the browser based clients cannot use the Date HTTP Header.

Fixes #33231
2016-09-28 19:32:25 -04:00
Kubernetes Submit Queue 9b1e2069a6 Merge pull request #33490 from sttts/sttts-requestinfo-via-context
Automatic merge from submit-queue

Store RequestInfo in Context instead of RequestInfoResolver dependency injection

**Depends on https://github.com/kubernetes/kubernetes/pull/33478**

The `RequestInfoResolver` is used in the proxy handler and in the authorization code. It is passed through half of the apiserver code base to be available at those locations. This PR uses the context instead, which is our natural dependency injection mechanism in the handlers.

`RequestInfo` and all tooling around is moved to `pkg/apiserver/request` temporarily to avoid dependency cycles. This is necessary as long as `pkg/apiserver` implements the proxy and other handlers. Those might move to `pkg/apiserver/handlers` probably later.
2016-09-28 16:09:42 -07:00
juanvallejo 0988f967f0 add check to NewCmdExec before printing suggestion
checks that the "describe" command and a parent command path exist
before printing suggestion to use the describe command to list
containers in a pod.
2016-09-28 18:02:33 -04:00
Kubernetes Submit Queue a6f9e7eadd Merge pull request #33425 from ZTE-PaaS/zhangke-patch-051
Automatic merge from submit-queue

Use abstract cache.NewListWatchFromClient to make the code clean
2016-09-28 14:54:27 -07:00
Dr. Stefan Schimanski 8391a19b57 Decouple defaulting from genericapiserver and master 2016-09-28 23:16:09 +02:00
juanvallejo 48370b2802 suggest use of `kube explain <resource>` in kube get output
This patch improves usability flow, making it easier for a user to
discover the command `kube explain <resource>` through `kube get`
output.
2016-09-28 14:54:15 -04:00
juanvallejo 735fbf9c09
add linebreak between resource groups
Printing multiple groups via `kubectl get all` can produce output that is
hard to read in cases where there are a lot of resource types to display
/ some resource types contain varying column amounts.

This patch adds a linebreak above each group of resources only when
there is more than one group to display, and always omitting the
linebreak above the first group. This makes for slightly improved
output.

Linebreaks are printed to stderr, and honor the `--no-headers` option.

**Before**

```
$ kubectl get all
NAME                     READY     STATUS    RESTARTS   AGE
po/database-1-u9m9l      1/1       Running   3          5d
po/idling-echo-1-9fmz6   2/2       Running   8          5d
po/idling-echo-1-gzb0v   2/2       Running   4          5d
NAME               DESIRED   CURRENT   READY     AGE
rc/database-1      1         1         1         6d
rc/idling-echo-1   2         2         2         6d
NAME              CLUSTER-IP       EXTERNAL-IP   PORT(S)
AGE
svc/database      172.30.11.104    <none>        5434/TCP
6d
svc/frontend      172.30.196.217   <none>        5432/TCP
6d
svc/idling-echo   172.30.115.67    <none>        8675/TCP,3090/UDP
6d
svc/kubernetes    172.30.0.1       <none>        443/TCP,53/UDP,53/TCP
6d
svc/mynodeport    172.30.81.254    <nodes>       8080/TCP
5d
svc/mynodeport1   172.30.198.193   <nodes>       8080/TCP
5d
svc/mynodeport2   172.30.149.48    <nodes>       8080/TCP
5d
svc/mynodeport3   172.30.195.235   <nodes>       8080/TCP
5d
```

**After**

```
$ kubectl get all
NAME                     READY     STATUS    RESTARTS   AGE
po/database-1-u9m9l      1/1       Running   3          5d
po/idling-echo-1-9fmz6   2/2       Running   8          5d
po/idling-echo-1-gzb0v   2/2       Running   4          5d

NAME               DESIRED   CURRENT   READY     AGE
rc/database-1      1         1         1         6d
rc/idling-echo-1   2         2         2         6d

NAME              CLUSTER-IP       EXTERNAL-IP   PORT(S)
AGE
svc/database      172.30.11.104    <none>        5434/TCP
6d
svc/frontend      172.30.196.217   <none>        5432/TCP
6d
svc/idling-echo   172.30.115.67    <none>        8675/TCP,3090/UDP
6d
svc/kubernetes    172.30.0.1       <none>        443/TCP,53/UDP,53/TCP
6d
svc/mynodeport    172.30.81.254    <nodes>       8080/TCP
5d
svc/mynodeport1   172.30.198.193   <nodes>       8080/TCP
5d
svc/mynodeport2   172.30.149.48    <nodes>       8080/TCP
5d
svc/mynodeport3   172.30.195.235   <nodes>       8080/TCP
5d
```
2016-09-28 14:21:46 -04:00
Doug Davis 9d5bac6330 Change minion to node
Contination of #1111

I tried to keep this PR down to just a simple search-n-replace to keep
things simple.  I may have gone too far in some spots but its easy to
roll those back if needed.

I avoided renaming `contrib/mesos/pkg/minion` because there's already
a `contrib/mesos/pkg/node` dir and fixing that will require a bit of work
due to a circular import chain that pops up. So I'm saving that for a
follow-on PR.

I rolled back some of this from a previous commit because it just got
to big/messy. Will follow up with additional PRs

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-09-28 10:53:30 -07:00
Dr. Stefan Schimanski b4c6a68036 Unify genericapiserver Config.New() and master Config.New() 2016-09-28 19:19:54 +02:00
Kubernetes Submit Queue c0826a2e7e Merge pull request #33640 from sttts/sttts-simplify-genericapiserver-tests
Automatic merge from submit-queue

Simplify genericapiserver tests

- create empty GenericApiServier object outside helper
- set default Config values everywhere because they are set anyway
2016-09-28 09:55:55 -07:00