Commit Graph

13741 Commits (12d923ed1583ac5cbec8d98003c7e08de5d1e9fd)

Author SHA1 Message Date
deads2k 2c4a9f2e8d interesting changes to add tokenreviews endpoint to implement webhook 2016-07-20 15:11:56 -04:00
deads2k bfa2ff00b9 generated code changes 2016-07-20 15:11:56 -04:00
k8s-merge-robot c09956e13f Merge pull request #29215 from ericchiang/http-probe-checker-test-dont-sr-compare-errors
Automatic merge from submit-queue

pkg/probe/http: don't compare error strings in tests

TestHTTPProbeChecker fails on the Go1.7 release candidates. The
package's history show that this was the case for Go1.5 and Go1.6
as well.

The test depend on errors holding specific string values, behavior
not guarenteed in the standard library API, and causing new test
failures every minor Go release. Just look for an error rather than
trying to inspect it using string comparison. If we feel this
impacts coverage we can add more test cases.

Fixes #15952
2016-07-20 11:51:52 -07:00
k8s-merge-robot 1ecd4efce6 Merge pull request #29169 from kevinjkj/kevinjkj-patch-4
Automatic merge from submit-queue

Add defer

Add defer?
2016-07-20 11:51:47 -07:00
k8s-merge-robot 8043baf12d Merge pull request #29071 from albatross0/fix_rbac_for_serviceaccounts
Automatic merge from submit-queue

Fix RBAC authorizer of ServiceAccount

RBAC authorizer assigns a role to a wrong service account.

How to reproduce

1.Create role and rolebinding to allow default user in kube-system namespace to read secrets in kube-system namespace.

```
# kubectl create -f role.yaml
# kubectl create -f binding.yaml
```

```yaml
# role.yaml
kind: Role
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: secret-reader
  namespace: kube-system
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "watch", "list"]
    nonResourceURLs: []
```

```yaml
# binding.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: read-secrets
  namespace: kube-system
subjects:
  - kind: ServiceAccount
    name: default
    namespace: kube-system
roleRef:
  kind: Role
  namespace: kube-system
  name: secret-reader
  apiVersion: rbac.authorization.k8s.io/v1alpha1
```

2.Set a credential of default user

```
$ kubectl config set-credentials default_user --token=<token_of_system:serviceaccount:kube-system:default>
$ kubectl config set-context default_user-context --cluster=test-cluster --user=default_user
$ kubectl config use-context default_user-context
```

3.Try to get secrets as default user in kube-system namespace

```
$ kubectl --namespace=kube-system get secrets
the server does not allow access to the requested resource (get secrets)
```

As shown above, default user could not access to secrets.
But if I have kube-system user in default namespace, it is allowed access to secrets.


4.Create a service account and try to get secrets as kube-system user in default namespace

```
# kubectl --namespace=default create serviceaccount kube-system
serviceaccount "kube-system" created
$ kubectl config set-credentials kube-system_user --token=<token_of_system:serviceaccount:default:kube-system>
$ kubectl config set-context kube-system_user-context --cluster=test-cluster --user=kube-system_user
$ kubectl config use-context kube-system_user-context
$ kubectl --namespace=kube-system get secrets
NAME                  TYPE                                  DATA      AGE
default-token-8pyb3   kubernetes.io/service-account-token   3         4d

```
2016-07-20 11:51:42 -07:00
k8s-merge-robot 10211f4df2 Merge pull request #29268 from lixiaobing10051267/masterExpected2
Automatic merge from submit-queue

Information is opposite to real meaning to express

master is not equal to expectedMaster, the meaning should be the master is unexpected:
	master, err := mesosCloud.Master(clusterName)
	if master != expectedMaster {
		t.Fatalf("Master returns the expected value: (expected: %#v, actual: %#v", expectedMaster, master)
2016-07-20 11:11:51 -07:00
k8s-merge-robot a0da4153b6 Merge pull request #29260 from lixiaobing10051267/masterErr
Automatic merge from submit-queue

Modify err output format from %s to %v

t.Errorf err output format should be %v
2016-07-20 11:11:46 -07:00
k8s-merge-robot 60f9ce8a41 Merge pull request #29253 from lixiaobing10051267/masterLBname
Automatic merge from submit-queue

format number not consistent with real variable number

glog.Infof format number not consistent with real variable number, should add %s for second var because loadBalancerName is string:
func (c *Cloud) ensureLoadBalancer(namespacedName types.NamespacedName, loadBalancerName string, ...
2016-07-20 11:11:42 -07:00
k8s-merge-robot 6df62ff39c Merge pull request #29162 from xiangpengzhao/fix_err_to_cerr
Automatic merge from submit-queue

Fix wrong variable of error

Should not log `err` but `cerr`.
2016-07-20 11:11:33 -07:00
k8s-merge-robot 7620ed4b52 Merge pull request #28963 from cdrage/better-warning-kubecontroller
Automatic merge from submit-queue

Warn when missing cloud-provider on kube controller
2016-07-20 11:11:23 -07:00
Andy Goldstein 77b0547b3d Fix Windows terminal handling
Fix some issues with Windows terminal handling with respect to TTYs that came up as part of the
code that adds support for terminal resizing.
2016-07-20 13:37:14 -04:00
k8s-merge-robot a0a0760027 Merge pull request #25307 from derekwaynecarr/set_uid_from_context
Automatic merge from submit-queue

Allow handlers earlier in a request flow to inject a UID for an object

This lets admission controllers specify a stable UID for an object prior to its creation.  That lets the admission controller then record a reference to the object on another resource using that stable UID prior to the object being created.  This would be a prerequisite for supporting quota reservations.

/cc @smarterclayton @lavalamp @deads2k
2016-07-20 09:58:51 -07:00
albatross0 d1b14e2fae Fix RBAC authorizer of ServiceAccount
RBAC authorizer assigns a role to a wrong service account.
2016-07-21 01:50:08 +09:00
Ron Lai 367a683273 Wrapping image pullers inside ImageManager 2016-07-20 09:47:11 -07:00
Ron Lai 56b9daf50f Moving image pullers to images directory 2016-07-20 09:47:11 -07:00
Jimmi Dyson 21231e1e83
Remove duplicate prometheus metrics 2016-07-20 16:00:21 +01:00
Timothy St. Clair 8cb799c789 Revert "Follow on for 1.4 to default HTTP2 on by default"
This reverts commit efe25553cd.
2016-07-20 08:47:15 -05:00
Dominika Hodovska ba40a528e1 PluginInitializer as a new part of NewFromPlugins method 2016-07-20 12:53:52 +02:00
Dominika Hodovska fc0a3c6dcb Allow shareable resources for admission control plugins 2016-07-20 12:53:52 +02:00
Wojciech Tyczynski 2794cf538c Use sharedPodInformer in ReplicaSet controller 2016-07-20 12:25:26 +02:00
lixiaobing10051267 025135de6a Information is opposite to real meaning to express 2016-07-20 16:54:19 +08:00
saadali afd8a58e5c Reduce DSW populator sleep period from 5 min to 1 2016-07-20 01:03:04 -07:00
saadali d210c2231f Check pod exist in attach controller DSW populator
Fix bug in desired_state_of_the_world_populator.go to check exists so
that it can delete pods even if the delete event is missed (or fails)
2016-07-20 01:03:04 -07:00
lixiaobing10051267 e3bff25dbb Modify err output format from %s to %v 2016-07-20 15:06:47 +08:00
k8s-merge-robot ad7ececcd0 Merge pull request #28765 from nhlfr/api-proxy-regex
Automatic merge from submit-queue

Make "attach" and "exec" rejection in proxy more explicit

```release-note
kubectl proxy changed to now allow urls to pods with "attach" or "exec" in the pod name
```

The more explicit regular expression for rejection makes a possibility of accessing pods (or any other resources) which contain "attach" or "exec" in their names via proxy API. It was not possible before.

Also, the reference for "run" resource was removed, because it doesn't exist in any of k8s APIs currently.

Fixes: #21464
2016-07-19 23:06:58 -07:00
k8s-merge-robot 8c84fae03e Merge pull request #28701 from pmorie/bandwidth-test
Automatic merge from submit-queue

Move ExtractPodBandwidthResources test into appropriate package

Found during #28511, this test is in the wrong package currently.

cc @kubernetes/sig-network
2016-07-19 21:57:30 -07:00
saadali 88d495026d Allow mounts to run in parallel for non-attachable
Allow mount volume operations to run in parallel for non-attachable
volume plugins.

Allow unmount volume operations to run in parallel for all volume
plugins.
2016-07-19 21:54:26 -07:00
k8s-merge-robot a3110dcb41 Merge pull request #28417 from kevensen/awszonefix
Automatic merge from submit-queue

AWS: Added experimental option to skip zone check

This pull request resolves #28380.  In the vast majority of cases, it is appropriate to validate the AWS region against a known set of regions.  However, there is the edge case where this is undesirable as Kubernetes may be deployed in an AWS-like environment where the region is not one of the known regions.

By adding the optional **DisableStrictZoneCheck true** to the **[Global]** section in the aws.conf file (e.g. /etc/aws/aws.conf) one can bypass the ragion validation.
2016-07-19 21:03:28 -07:00
lixiaobing10051267 6de7bc0085 format number not consistent with real variable number 2016-07-20 11:14:45 +08:00
k8s-merge-robot 411c32bc98 Merge pull request #27520 from olegshaldybin/format-apiserver-options
Automatic merge from submit-queue

Format apiserver options

Trivial change, code formatting only: it was hard to read long lines, and my editor was really slow when scrolling through them.
2016-07-19 19:58:01 -07:00
Random Liu 51184db4df Set PruneChildren when removing image. 2016-07-20 02:07:28 +00:00
k8s-merge-robot a279673de6 Merge pull request #25764 from gtank/certificates-api-controller-v3
Automatic merge from submit-queue

Certificate signing controller for TLS bootstrap (alpha)

The controller handles generating and signing certificates when a CertificateSigningRequest has the "Approved" condition. Uses cfssl to support a wide set of possible keys and algorithms. Depends on PR #25562, only the last two commits are relevant to this PR.

cc @mikedanese

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-19 18:45:31 -07:00
k8s-merge-robot a95180e06f Merge pull request #29228 from janetkuo/available-time-log
Automatic merge from submit-queue

Log the time when checking deployment's pod availability

https://github.com/kubernetes/kubernetes/issues/26834#issuecomment-233764007
2016-07-19 17:35:45 -07:00
PingWang 4daea70ad7 Optimise getAPIGroupVersion function in genericapiserver.go
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

gofmt -s -w

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-20 08:17:36 +08:00
Michael Taufen 1e13b9b2de Remove duplicate code 2016-07-19 14:51:25 -07:00
Ivan Shvedunov 02baa44948 Fix update validation for pods w/init containers. 2016-07-20 00:30:12 +03:00
Janet Kuo 07d25fdc47 Log the time when checking deployment's pod availability 2016-07-19 14:08:28 -07:00
k8s-merge-robot 9ada26d6cd Merge pull request #29219 from caesarxuchao/fix-testeventf
Automatic merge from submit-queue

Don't do string(int)

This is causing https://github.com/kubernetes/kubernetes/pull/29147 to fail the unit test, because the bug prints control character to the test log, and the grep at this [line](https://github.com/kubernetes/kubernetes/blob/master/hack/make-rules/test.sh#L190) returns `Binary file (standard input) matches` error. I don't know why this bug isn't caught before.
2016-07-19 14:06:57 -07:00
Kenneth D. Evensen d69fe11c09
Fixing gofmt errors 2016-07-19 16:50:55 -04:00
Michal Rostecki 3ed9768a51 Make "attach" and "exec" rejection in proxy more explicit
The more explicit regular expression for rejection makes a
possibility of accessing pods (or any other resources) which
contain "attach" or "exec" in their names via proxy API. It
was not possible before.

Also, the reference for "run" resource was removed, because
it doesn't exist in any of k8s APIs currently.

Fixes: #21464
2016-07-19 20:50:19 +02:00
Chao Xu 99d8868c7c don't use string(index) 2016-07-19 11:41:16 -07:00
Paul Morie d9ffcace6a Move ExtractPodBandwidthResources test into appropriate package 2016-07-19 14:34:08 -04:00
George Tankersley 9e45f62fc3 codegen: update componentconfig 2016-07-19 11:25:38 -07:00
George Tankersley 803c7ac299 certificates: implement certificates controller 2016-07-19 11:25:38 -07:00
Eric Chiang a1b310e004 pkg/probe/http: don't compare error strings in tests
TestHTTPProbeChecker fails on the Go1.7 release candidates. The
package's history show that this was the case for Go1.5 and Go1.6
as well.

The test depend on errors holding specific string values, behavior
not guarenteed in the standard library API, and causing new test
failures every minor Go release. Just look for an error rather than
trying to inspect it using string comparison. If we feel this
impacts coverage we can add more test cases.
2016-07-19 11:13:36 -07:00
k8s-merge-robot 1c5af3e72f Merge pull request #29209 from dims/fix-glog-log-with-formatting
Automatic merge from submit-queue

Use Infof/Warningf when appropriate

When we use a format string, we should use Infof/Warningf instead
of Info/Warning
2016-07-19 10:41:26 -07:00
k8s-merge-robot 1014b35065 Merge pull request #29125 from mwielgus/extra-debug-hpa
Automatic merge from submit-queue

Extra debug information in HPA events

Fixes: #29004
2016-07-19 10:41:09 -07:00
k8s-merge-robot 372fb5cd5f Merge pull request #29085 from xiangpengzhao/delete_redundant_case
Automatic merge from submit-queue

Delete redundant if condition

The case `containerStatus == nil` has already been checked just above. It's redundant here.
2016-07-19 10:41:04 -07:00
deads2k 2ea342289e use a separate queue for initial quota calculation 2016-07-19 13:38:39 -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
Euan Kemp 13dca52f3c kubelet: Log new pod ips 2016-07-19 09:09:00 -07:00
k8s-merge-robot d9fbb9f600 Merge pull request #29188 from mfojtik/retry-on-update
Automatic merge from submit-queue

Retry updating deployment only on update conflict error
2016-07-19 08:46:50 -07:00
Marcin Wielgus 75b91ff972 Extra debug information in HPA events 2016-07-19 17:00:45 +02:00
k8s-merge-robot 73a3d48dc8 Merge pull request #29196 from lixiaobing10051267/masterDiskName
Automatic merge from submit-queue

glog.Warning output content not complete, lack of string fomat "%s"
2016-07-19 07:31:24 -07:00
k8s-merge-robot d4d83adf85 Merge pull request #29191 from wojtek-t/extend_gce_logging
Automatic merge from submit-queue

Extend logging for GCE load balancer creation

For #29189 debugging.
2016-07-19 06:54:53 -07:00
k8s-merge-robot 0e9ac96368 Merge pull request #29134 from derekwaynecarr/quota_improvement
Automatic merge from submit-queue

Improve quota controller performance by eliminating unneeded list calls

Previously, when syncing quota usage, we asked each registered `Evaluator` to determine the usage it knows to track associated with a `GroupKind` even if that particular `GroupKind` had no associated resources under quota.

This fix makes it that when we sync a quota that just had only `Pod` related compute resources, we do not also calculate the usage stats for things like `ConfigMap`, `Secret`, etc. per quota.

This should be a significant performance gain when running large numbers of `Namespace`'s each with `ResourceQuota` that tracks a subset of resources.

/cc @deads2k @kubernetes/rh-cluster-infra
2016-07-19 06:54:48 -07:00
lixiaobing10051267 1a01308356 glog.Warning output content not complete, lack of string fomat "%s" 2016-07-19 20:35:52 +08:00
Wojciech Tyczynski 84f7ceb80a Extend logging for GCE load balancer creation 2016-07-19 13:38:51 +02:00
k8s-merge-robot 8c6336b12a Merge pull request #29101 from gmarek/allocator2
Automatic merge from submit-queue

Retry assigning CIDRs

Fix #28879, ref #29064

cc @bgrant0607 @bprashanth @alex-mohr
2016-07-19 04:35:23 -07:00
Michal Fojtik 3095437300 Retry updating deployment only on update conflict error 2016-07-19 13:01:06 +02:00
k8s-merge-robot 1026eecc9d Merge pull request #26012 from sitepod/third-party-resource-list-json-fix
Automatic merge from submit-queue

include metadata in third party resource list serialization

Third party resource listing does not include important metadata such as resourceVersion and apiVersion. This commit includes the missing metadata and also replaces the string templating with an anonymous struct.
2016-07-19 04:00:34 -07:00
k8s-merge-robot 0bfaae16a0 Merge pull request #29118 from xiangpengzhao/fix_reversed_var_order
Automatic merge from submit-queue

Fix reversed order of variables

The order of variables in log is reversed.
2016-07-19 02:52:25 -07:00
k8s-merge-robot be8abdabf8 Merge pull request #27157 from soltysh/scheduledjob_test_2
Automatic merge from submit-queue

Scheduledjob test cont.

This continuation of #25737.

@erictune @caesarxuchao ptal

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-19 02:52:19 -07:00
k8s-merge-robot 6c1675a5cd Merge pull request #29080 from Random-Liu/continue-cleanup-despite-of-error
Automatic merge from submit-queue

Make kubelet continue cleanup when there is noncritical error.

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

Even though there is error when cleaning up pod directory or bandwidth limits, kubelet could continue cleanup the following stuff.
However, when runtime cache or runtime returns error, cleanup should fail, because the following cleanup relies on the `runningPod`.

@yujuhong 
/cc @kubernetes/sig-node
2016-07-19 01:43:29 -07:00
k8s-merge-robot 1e9edfc5c3 Merge pull request #29045 from lixiaobing10051267/mastererrNotAcceptable
Automatic merge from submit-queue

Type define note "errNotAcceptable" should be "errUnsupportedMediaType"

In file "pkg\apiserver\errors.go", line 129:
"// errNotAcceptable indicates Content-Type is not recognized"
Here "errNotAcceptable" shuould be "errUnsupportedMediaType", thus consistent with line 131:
"type errUnsupportedMediaType struct"
2016-07-19 01:10:41 -07:00
Euan Kemp fec83a9e28 docker_manager: Correct determineContainerIP args
This could result in the network plugin not retrieving the pod ip in a
call to SyncPod when using the `exec` network plugin.
The CNI and kubenet network plugins ignore the name/namespace arguments,
so they are not impacted by this bug.

I verified the second included test failed prior to correcting the
argument order.

Fixes #29161
2016-07-18 23:29:27 -07:00
k8s-merge-robot 3786701280 Merge pull request #28865 from ronnielai/image-gc-0
Automatic merge from submit-queue

Moving event.go from kubelet/container to kubelet/events
2016-07-18 22:54:03 -07:00
k8s-merge-robot a049a97820 Merge pull request #28803 from lukaszo/ds
Automatic merge from submit-queue

Make Daemonset use GeneralPredicates

fixes: #21454 #22205
2016-07-18 22:12:14 -07: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
Kevin Wang 074dab86b9 Add defer
Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>
2016-07-19 11:53:01 +08:00
xiangpengzhao 2d7dbc2271 Fix wrong error variable 2016-07-18 22:54:05 -04:00
xiangpengzhao ca823097d2 Delete redundant if condition 2016-07-18 22:11:06 -04:00
Cindy Wang e13c678e3b Make volume unmount more robust using exclusive mount w/ O_EXCL 2016-07-18 16:20:08 -07:00
k8s-merge-robot 1d8c15ba14 Merge pull request #28755 from dubstack/remove-systemd-check
Automatic merge from submit-queue

Do not skip check for cgroup creation in the systemd mount

As soon as libcontainer dependency is update in #28410, we can skip check for cgroup creation in the systemd mount. As the latest version of libcontainer should create cgroups in the sytemd mount aswell.

This is tied to the upstream issue: #27204

@vishh PTAL
2016-07-18 15:05:51 -07:00
Yifan Gu b212662c1e rkt: Don't return if the service file doesn't exist when killing the pod.
Remove an unused logic. Also this prevents the KillPod() from failing
when the service file doesn't exist. E.g., it can be removed by garbage
collection in a rare case:

1, There are already more than `gcPolicy.MaxContainers` containers running
   on the host.
2, The new pod(A) starts to run but doesn't enter 'RUNNING' state yet.
3, GC is triggered, and it sees the pod(A) is in an inactive state (not running),
   and the it needs to remove the pod to force the `gcPolicy.MaxContainers`.
4, GC fails to remove the pod because `rkt rm` fails when the pod is running,
   but it removes the service file anyway.
5, Follow up KillPod() call will fail because it cannot find the service file
   on disk.

Also this is possible only when the pod has been in prepared state for longer
than 1 min, which sounds like another issue.
2016-07-18 14:48:13 -07:00
Random-Liu 62d2979e1b Make kubelet continue cleanup when there is noncritical error. 2016-07-18 14:43:41 -07:00
k8s-merge-robot 8eb0cf5039 Merge pull request #28871 from vishh/gce-cp
Automatic merge from submit-queue

Do not query the metadata server to find out if running on GCE.  Retry metadata server query for gcr if running on gce.

Retry the logic for determining is gcr is enabled to workaround metadata unavailability.

Note: This patch does not retry fetching registry credentials.
2016-07-18 14:32:04 -07:00
derekwaynecarr f2f65fe9c4 Improve quota controller performance by eliminating unneeded list calls 2016-07-18 17:21:24 -04:00
k8s-merge-robot 6108725869 Merge pull request #29047 from lixiaobing10051267/masterServe
Automatic merge from submit-queue

Apiserver ServeHTTP() modify

In File "pkg\apiserver\watch.go", line 123:
"// Serve serves a series of encoded events via HTTP with Transfer-Encoding: chunked"
Here "Serve" should be "ServeHTTP" because the func name is ServeHTTP:
"func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request)"
2016-07-18 12:43:04 -07:00
Maciej Szulik 647124bf5e ScheduledJob client and storage tests 2016-07-18 21:01:21 +02:00
k8s-merge-robot e72f6a892d Merge pull request #28234 from damemi/record-false-bugfix
Automatic merge from submit-queue

Make sure --record=false is acknowledged when passed to commands

```release-note
Change setting "kubectl --record=false" to stop updating the change-cause when a previous change-cause is found.
```

Ensures that when `--record=false` is explicity set that no `ChangeCauseAnnotation`s are set on the object. Previously, if `--record=true` was used then all following actions triggered a `ChangeCauseAnnotation` even if `--record=false` was set, due to the prior `ChangeCauseAnnotation` existing.

Reference to bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1351127

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-18 11:32:15 -07:00
k8s-merge-robot f50bb73ed6 Merge pull request #26136 from AdoHe/kubectl_apply_overwrite
Automatic merge from submit-queue

kubectl apply add --overwrite flag

```release-note
Add "kubectl --overwrite" flag to automatically resolve conflicts between the modified and live configuration using values from the modified configuration.
```
fixes #17238

This PR just add the `--overwrite` flag, pkg/strategicpatch has already support overwrite. @bgrant0607 @jackgr ptal.
2016-07-18 10:47:53 -07:00
gmarek 56006fac43 Retry assigning CIDRs 2016-07-18 17:06:04 +02:00
zhouhaibing089 c9495f13a0 fixes the wrong doc in package healthz 2016-07-18 22:46:09 +08: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
xiangpengzhao 48b5a5825a Fix reversed order of variables 2016-07-18 08:06:54 -04:00
k8s-merge-robot 6032494276 Merge pull request #29096 from gmarek/cidrAllocation
Automatic merge from submit-queue

Re-check assigned CIDR during update

Ref. #29064

cc @bgrant0607
2016-07-18 03:35:30 -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
Thien-Thi Nguyen 165363a834 Fix docstring: Say "flag options" instead of "flag statements" 2016-07-18 11:58:40 +02:00
k8s-merge-robot 18df451031 Merge pull request #28982 from yujuhong/rm_todos
Automatic merge from submit-queue

kubelet: remove outdated TODOs
2016-07-18 02:19:23 -07:00
gmarek 579912d9d2 Re-check assigned CIDR during update 2016-07-18 10:57:58 +02:00
k8s-merge-robot 5f766748db Merge pull request #27762 from xiangpengzhao/fix-port-range
Automatic merge from submit-queue

Fix port range checking, port should not be greater than 65535.

When passing flag `--proxy-port-range` to kube-proxy with an invalid range which is greater than 65535, the proxy doesn't exit. That's not what we want.

Should we fix this in v1.3?
/cc @thockin @mikedanese @resouer 

Before fixing:
```
root@vm:/home/paas/zxp# kube-proxy --master=172.16.1.11:8080 --logtostderr=false --log-dir=/home/user/log/kube --proxy-port-range=65536-65599 &
[6] 6671
root@vm:/home/paas/zxp# ps -ef | grep kube-proxy
root      6671 13507  0 03:48 pts/1    00:00:00 kube-proxy --master=172.16.1.11:8080 --logtostderr=false --log-dir=/home/user/log/kube --proxy-port-range=65536-65599
```

After:
```
root@vm:/home/paas/zxp# kube-proxy --master=172.16.1.11:8080 --logtostderr=false --log-dir=/home/user/log/kube --proxy-port-range=65536-65599 &
[6] 6725
root@vm:/home/paas/zxp# invalid argument "65536-65599" for --proxy-port-range=65536-65599: "65536-65599" is not a valid port range: the port range cannot be greater than 65535: 65536-65599
..............
[6]+  Exit 2                  kube-proxy --master=172.16.1.11:8080 --logtostderr=false --log-dir=/home/user/log/kube --proxy-port-range=65536-65599
```
```
root@vm:/home/paas/zxp# kube-proxy --master=172.16.1.11:8080 --logtostderr=false --log-dir=/home/user/log/kube --proxy-port-range=6000-65599 &
[6] 6732
root@vm:/home/paas/zxp# invalid argument "6000-65599" for --proxy-port-range=6000-65599: "6000-65599" is not a valid port range: the port range cannot be greater than 65535: 6000-65599
..............
[6]+  Exit 2                  kube-proxy --master=172.16.1.11:8080 --logtostderr=false --log-dir=/home/user/log/kube --proxy-port-range=6000-65599
```
2016-07-18 01:44:03 -07:00
k8s-merge-robot d168bbe3b8 Merge pull request #28767 from johscheuer/fix-volume-typos
Automatic merge from submit-queue

Fix typos in volume.go

Fixed some minor typos in the docs of `volume.go`.
2016-07-18 00:36:00 -07:00
Prashanth Balasubramanian a9426a19c9 Don't recreate lb cloud resources on kcm restart 2016-07-17 21:59:22 -07:00
AdoHe ddbd539d1e kubectl apply add --overwrite flag 2016-07-18 00:32:13 -04:00
k8s-merge-robot 01925c810b Merge pull request #24733 from kargakis/rc-rs-conversions
Automatic merge from submit-queue

Custom conversions between RCs/RSs

Needed for building storages that still need to work with RCs but also want to facilitate RSs.

cc: @deads2k @smarterclayton @liggitt
2016-07-17 04:49:16 -07:00
Xiang Li 44c0a1190c cacher.go: embed storage.Interface into cacher 2016-07-16 23:25:48 -07: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
k8s-merge-robot 0bec77bd6b Merge pull request #29062 from bprashanth/cidr
Automatic merge from submit-queue

List all nodes and occupy cidr map before starting allocations

Manually tested by starting a 200 node cluster with frequent controller manager restarts.
Fixes https://github.com/kubernetes/kubernetes/issues/29058
2016-07-16 15:49:10 -07:00
Prashanth Balasubramanian 2f9516db30 List all nodes and occupy cidr map before starting allocations 2016-07-16 13:54:01 -07:00
k8s-merge-robot 8677b0c545 Merge pull request #28743 from Clarifai/gpu-impl
Automatic merge from submit-queue

Fix GPU resource validation

This fixes scheduling of pods with GPU resources. The change was never upstreamed during the 1.3 beta period, as it got lost in the noise of other changes in our fork. Ooops. I'll submit a cherry-pick request for 1.3.1 as soon as this lands in master.

Because of defaulting, requests are always set if limits are. Thus, the check can never succeed. Instead, make sure that the two values are equal.

Also, remove a few other error messages and remove unnecessary Sprintf calls.
2016-07-16 11:48:42 -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
lixiaobing10051267 97219275b1 Apiserver ServeHTTP() modify 2016-07-16 12:29:11 +08:00
lixiaobing10051267 7ecae85493 Type define note "errNotAcceptable indicates Content-Type is not recognized" wrong 2016-07-16 11:31:52 +08:00
k8s-merge-robot 5e1b75d164 Merge pull request #28990 from xiangpengzhao/fix_duplicated_code
Automatic merge from submit-queue

Delete duplicated code

The code block below is called twice sequentially in func `doTestPlugin`.
.
```go
 	if _, err := os.Stat(path); err != nil {
 		if os.IsNotExist(err) {
 			t.Errorf("SetUp() failed, volume path not created: %s", path)
 		} else {
 			t.Errorf("SetUp() failed: %v", err)
 		}
 	}
```
2016-07-15 19:30:34 -07:00
k8s-merge-robot d6336c4f4b Merge pull request #29024 from yifan-gu/copy_etc_hosts_resolv
Automatic merge from submit-queue

rkt: Copy the /etc/hosts /etc/resolv.conf into pod dir before mounting.

rkt: Copy the /etc/hosts /etc/resolv.conf into pod dir before mounting.
    
This enables the container to modify the /etc/hosts/ /etc/resolv.conf without changing the host's ones.
With this PR, we now match the docker's behavior.

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

cc @kubernetes/sig-rktnetes @quentin-m
2016-07-15 18:56:48 -07:00
Yifan Gu 56698a6c3e rkt: Copy the /etc/hosts /etc/resolv.conf into pod dir before mounting.
This enables the container to modify the /etc/hosts/ /etc/resolv.conf
without changing the host's ones.

With this PR, we now match the docker's behavior.
2016-07-15 17:40:29 -07:00
Tim Hockin 1f37281dae Scale kube-proxy conntrack limits by cores
For large machines we want more conntrack entries than smaller machines.
2016-07-15 16:36:40 -07:00
k8s-merge-robot e576a2f760 Merge pull request #29017 from thockin/undelete-generated-files
Automatic merge from submit-queue

Undelete generated files

There's been enough people broken by not committing generated code, that we
should undo that until we have a proper client that is `go get` compatible.

This is temporary.

Fixes #28920
2016-07-15 16:27:14 -07:00
k8s-merge-robot d3dbe9c716 Merge pull request #28202 from hongchaodeng/cpa
Automatic merge from submit-queue

Better handle etcd compaction in multi-apiserver

What:
- Change etcd compaction routine to better handle multi-apiserver (HA) scenarios. See the docs in code.
2016-07-15 13:33:58 -07:00
Antonio Murdaca 5faa9b1283
CRI: add LinuxUser to LinuxContainerConfig
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-15 22:17:41 +02:00
k8s-merge-robot b6c87904f6 Merge pull request #27853 from dubstack/dubstack-inject-qos-creation2
Automatic merge from submit-queue

[Kubelet] Improving QOS in kubelet by introducing QoS level Cgroups - `--cgroups-per-qos`

This PR is tied to this upstream issue #27204 
Please note that only the last commit is unique to this PR. The first two commits are from previous PR's.

It introduces a new flag in the Kubelet which can be used to specify if the user wants to use the QoS cgroup hierarchy. 

cc @kubernetes/sig-node
2016-07-15 11:54:25 -07:00
Vishnu kannan ea1a459a80 Check if service accounts exist in gcr credential provider
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-15 11:41:02 -07:00
Vishnu kannan ee9cded79a do not query the metadata server to find out if running on GCE. Retry docker registry fetches on GCP
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-15 11:41:02 -07:00
k8s-merge-robot 6193335bd9 Merge pull request #28985 from caesarxuchao/v1ojbref
Automatic merge from submit-queue

move api.ObjectReference.ObjectKind to pkg/api/ref.go

This is needed to convert k8s components to use versioned clientset.

To let components use versioned client, we need to convert `pkg/client/record` to v1, which depends on `pkg/api/ref.go`, so we need to make a `pkg/api/v1/ref.go`. And this [line](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/ref.go#L44) requires v1.ObjectReference to be a runtime.Object. Moving `api.ObjectReference.ObjectKind` to `pkg/api/ref.go` will make the writing a conversion script easier because all the necessary changes will be restricted in `ref.go`.
2016-07-15 11:14:07 -07:00
Tim Hockin 3384e03920 Commit generated files
There's been enough people broken by not committing generated code, that we
should undo that until we have a proper client that is `go get` compatible.

This is temporary.
2016-07-15 10:27:51 -07:00
Hongchao Deng 54025ce8b3 etcd3/store: Add test for compact conflict 2016-07-15 10:24:50 -07:00
Hongchao Deng 186b4858b4 better handle etcd compaction in multi-apiserver 2016-07-15 10:24:49 -07:00
k8s-merge-robot 529df988e8 Merge pull request #28964 from ncdc/export-isterminal
Automatic merge from submit-queue

Reexport term.IsTerminal

Reexport term.IsTerminal so downstream consumers (e.g. OpenShift) can use it.

@smarterclayton @sttts
2016-07-15 10:06:20 -07:00
Buddha Prakash 5000e74664 Inject top level QoS cgroup creation in the Kubelet 2016-07-15 10:02:22 -07:00
Mike Dame cfbf7da75b Make sure --record=false is acknowledged when passed to commands 2016-07-15 11:24:05 -04:00
k8s-merge-robot 0af6d321e8 Merge pull request #28935 from smarterclayton/avoid_double_encode
Automatic merge from submit-queue

Don't double encode protobuf runtime.Unknown

When using runtime.Object and runtime.RawExtension, passing
runtime.Unknown to protobuf serializer should result in the raw message
being serialized (since all normal protobuf objects are
runtime.Unknown).

Also, avoid setting a content-type when decoding a protobuf object
except when the content appears to be proto.

@wojtek-t
2016-07-15 07:43:09 -07:00
k8s-merge-robot aa16140298 Merge pull request #28926 from ronnielai/pleg
Automatic merge from submit-queue

Including ContainerRemoved in PLEG event reporting
2016-07-15 07:03:19 -07:00
k8s-merge-robot 15b1fe33ee Merge pull request #28915 from ronnielai/gc-threshold
Automatic merge from submit-queue

Support deleting all unused images

#25239
2016-07-15 06:22:56 -07:00
Michail Kargakis f85067b27d api: custom conversions for rc/rs 2016-07-15 14:52:27 +02:00
Michail Kargakis d7038f50b6 unversioned: conversion from new to original label selector 2016-07-15 14:52:27 +02:00
k8s-merge-robot 5844145795 Merge pull request #28815 from smarterclayton/fix_stringer
Automatic merge from submit-queue

Generate a better Stringer method for proto types

This replaces the bad string output generated by golang/proto with gogo/protobuf stringer generation. Makes the output similar to %#v and more debuggable. We have to have a String() method to implement proto.Message, so this is strictly better.

@wojtek-t, @thockin for after your PR merges

Fixes #28756
2016-07-15 05:49:40 -07:00
k8s-merge-robot 423106ccee Merge pull request #28512 from smarterclayton/multirestmapper
Automatic merge from submit-queue

Implement a RESTMappings method

With the introduction of batch/v1 and batch/v2alpha1, any
MultiRESTMapper that has per groupversion mappers (as a naive discovery
client would create) would end up being unable to call RESTMapping() on
batch.Jobs. As we finish up discovery we will need to be able to choose
prioritized RESTMappings based on the service discovery doc.

This change implements RESTMappings(groupversion) which returns all
possible RESTMappings for that kind.  That allows a higher level call to
prioritize the returned mappings by server or client preferred version.

@deads2k
2016-07-15 05:13:55 -07:00
k8s-merge-robot e7e434b10d Merge pull request #27600 from caesarxuchao/rc-gc
Automatic merge from submit-queue

[GarbageCollector] Let the RC manager set/remove ControllerRef

What's done:
* RC manager sets Controller Ref when creating new pods
* RC manager sets Controller Ref when adopting pods with matching labels but having no controller
* RC manager clears Controller Ref when pod labels change
* RC manager clears pods' Controller Ref when rc's selector changes
* RC manager stops adoption/creating/deleting pods when rc's DeletionTimestamp is set
* RC manager bumps up ObservedGeneration: The [original code](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller_utils.go#L36) will do this.
* Integration tests:
  * verifies that changing RC's selector or Pod's Labels triggers adoption/abandoning
* e2e tests (separated to #27151):
  * verifies GC deletes the pods created by RC if DeleteOptions.OrphanDependents=false, and orphans the pods if DeleteOptions.OrphanDependents=true.

TODO:

- [x] we need to be able to select Pods that have a specific ControllerRef. Then each time we sync the RC, we will iterate through all the Pods that has a controllerRef pointing the RC, event if the labels of the Pod doesn't match the selector of RC anymore. This will prevent a Pod from stuck with a stale controllerRef, which could be caused by the race between abandoner (the goroutine that removes controllerRef) and worker the goroutine that add controllerRef to pods).
- [ ] use controllerRef instead of calling `getPodController`. This might be carried out by the control-plane team.
- [ ] according to the controllerRef proposal (#25256): "For debugging purposes we want to add an adoptionTime annotation prefixed with kubernetes.io/ which will keep the time of last controller ownership transfer." This might be carried out by the control-plane team.

cc @lavalamp @gmarek
2016-07-15 04:40:40 -07:00
Szymon Pyżalski b87ee3dff7 Validation logic applied to edited file
The file that is submitted via edit is now subject to validation
logic as any other file. The validation flags were added to the edit
command.

Fixes: #17542
2016-07-15 13:02:19 +02:00
k8s-merge-robot d347435708 Merge pull request #19837 from mikedanese/kubelet-external
Automatic merge from submit-queue

kubelet external componentconfig
2016-07-15 03:59:50 -07:00
Wojciech Tyczynski f71244975d Revert "[garbage collector] add e2e test" 2016-07-15 10:10:02 +02:00
xiangpengzhao b2ab356ca5 Delete duplicated code. 2016-07-15 03:04:24 -04:00
Chao Xu 3fb678aca3 move api.OjbectReference.ObjectKind() to ref.go 2016-07-14 23:02:05 -07:00
k8s-merge-robot 7be82496eb Merge pull request #28428 from justinsb/aws_region_ap_south
Automatic merge from submit-queue

AWS: Add ap-south-1 to list of known AWS regions

Adding the new ap-south-1 region (Mumbai)
2016-07-14 20:28:53 -07:00
Chao Xu 11a341de67 let RC manager utilize the GC 2016-07-14 19:59:31 -07:00
k8s-merge-robot bea5232790 Merge pull request #28946 from ping035627/ping035627-patch-0714-2
Automatic merge from submit-queue

Modify wrong description about "InsecurePort" in genericapiserver.go

Modify wrong description about "InsecurePort" in genericapiserver.go, avoid misleading.
2016-07-14 19:56:09 -07:00
k8s-merge-robot e182520db6 Merge pull request #28944 from ping035627/ping035627-patch-0715
Automatic merge from submit-queue

Improve fatal error description for init in genericapiserver.go

When api.NewRequestContextFilter return error in the "init" function of genericapiserver.go, there are no handler info, add more information to indicate s.Handler or s.InsecureHandler, I suggest.
2016-07-14 19:56:04 -07:00
k8s-merge-robot c481291320 Merge pull request #28937 from ping035627/ping035627-patch-0714
Automatic merge from submit-queue

Optimise the New function in genericapiserver.go

It needn't the handlerContainer variable in the "New" function when deal s.HandlerContainer, I think, and it seems the codes more concise.
2016-07-14 19:56:00 -07:00
k8s-merge-robot 01e34b72c1 Merge pull request #27151 from caesarxuchao/gc-e2e
Automatic merge from submit-queue

[garbage collector] add e2e test

This PR also includes some changes to plumb controller-manager's `--enable_garbage_collector` from the environment variable.

The e2e test will not be run by the core suite because it's marked `[Feature:GarbageCollector]`.

The corresponding jenkins job configuration PR is https://github.com/kubernetes/test-infra/pull/132.
2016-07-14 19:55:52 -07:00
Michael Taufen e52718bbc6 Clean up API
Move SystemReserved and KubeReserved into KubeletConfiguration struct
Convert int64 to int32 for some external type fields so they match internal ones
tLS* to tls* for JSON field names
Fix dependency on removed options.AutoDetectCloudProvider
Change floats in KubeletConfiguration API to ints
2016-07-14 18:40:11 -07:00
Michael Taufen 9393bd0fa6 Fix unit test build errors
These tests can just use the empty string for the PodInfraContainerImage.
2016-07-14 18:40:11 -07:00
Michael Taufen 2e49f6b64a Make it build!
Update external KubeletConfiguration type
Add defaults for new KubeletConfiguration fields
Modify some defaults to match upstream settings
Add/rename some conversion functions
Updated codegen
Fixed typos
Mike Danese caught that s.NodeLabels wasn't allocated, fix on line 118
of cmd/kubelet/app/options/options.go.
Provide list of valid sources in comment for HostNetworkSources field
2016-07-14 18:38:58 -07:00
Mike Danese e235073c26 f 2016-07-14 18:38:58 -07:00
Mike Danese e070cb617a componentconfig: add external kubelet configuration type 2016-07-14 18:38:58 -07:00
Yu-Ju Hong 007257a5ad kubelet: remove outdated TODOs 2016-07-14 18:28:25 -07:00
Daniel Smith 360f2eb927 Revert "Remove pod mutation for PVs with supplemental GIDs" 2016-07-14 17:47:46 -07:00
PingWang a7cea72e66 modify two wrong description about InsecurePort
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Update genericapiserver.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-15 08:29:18 +08:00
Ron Lai a58c774c08 Including ContainerRemoved in PLEG event reporting 2016-07-14 16:39:03 -07:00
Anirudh 467333cc40 Create event only if creation of PVC failed. 2016-07-14 11:53:42 -07:00