Commit Graph

14482 Commits (52b3ef6f9c0326b5df19fa041cea920a59e7c2f3)

Author SHA1 Message Date
Jan Safranek d8a95a3785 Update matching logic with storage class
- no default StorageClass
- PVC.Spec.Class == nil means the same as PVC.Spec.Class == ""
2016-08-18 10:36:50 +02:00
Jan Safranek d94220810e GCE changes for the new provisioning model 2016-08-18 10:36:50 +02:00
Jan Safranek 4b97db202c AWS changes for new provisioning model 2016-08-18 10:36:49 +02:00
Jan Safranek 6e4d95f646 Dynamic provisioning V2 controller, provisioners, docs and tests. 2016-08-18 10:36:49 +02:00
Kubernetes Submit Queue f9190ed61a Merge pull request #30138 from gmarek/flags
Automatic merge from submit-queue

Expose flags for new NodeEviction logic in NodeController

Fix #28832
Last PR from the NodeController NodeEviction logic series. 

cc @davidopp @lavalamp @mml
2016-08-18 00:41:28 -07:00
Kubernetes Submit Queue 6fb10dd762 Merge pull request #30241 from Q-Lee/webhook
Automatic merge from submit-queue

Adding types file for image admission controller.

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
Adding container image verification webhook API.
```
2016-08-17 21:30:34 -07:00
Kubernetes Submit Queue f0db50a7da Merge pull request #30723 from yujuhong/procfs_fix
Automatic merge from submit-queue

Fix building pkg/util/procfs on non-linux platforms

This partially fixes https://github.com/kubernetes/test-infra/issues/393

/cc @ixdy @krousey @dims
2016-08-17 20:50:01 -07:00
Kubernetes Submit Queue 98bdd3967e Merge pull request #29825 from nak3/json-marshalindent
Automatic merge from submit-queue

Use MarshalIndent instead of marshal and indent
2016-08-17 19:02:32 -07:00
Kubernetes Submit Queue 7ceb23c719 Merge pull request #30828 from bprashanth/nc_podready
Automatic merge from submit-queue

Nodecontroller doesn't flip readiness on pods if kubeletVersion < 1.2.0

Older versions of the kubelet didn't know how to reconcile pod.Status, so the nodecontroller would mark pods NotReady on netsplit, and if the partition recovered in < 5m, the pods would never get marked Ready resulting in NotReady endpoints indefinitely (till kubelet restart/pod recreate etc).
2016-08-17 19:02:12 -07:00
bprashanth 30f3cb9d26 Scaler and reaper for petset 2016-08-17 17:37:56 -07:00
bprashanth 4601ac7643 Allow non-patch-updates to replicas 2016-08-17 17:37:56 -07:00
Daniel Smith 3e69c5a9b8 queueActionLocked requires write lock 2016-08-17 17:34:49 -07:00
Kubernetes Submit Queue 9ecee38f78 Merge pull request #27275 from nebril/issue-27274
Automatic merge from submit-queue

Replace map[string]string with labels.Set (TODO)

fixes #27274
2016-08-17 16:08:13 -07:00
bprashanth 15c9826061 Nodecontroller doesn't flip readiness on pods if kubeletVersion < 1.2.0 2016-08-17 15:33:35 -07:00
Kubernetes Submit Queue 4b5fd43e24 Merge pull request #30250 from krousey/kctl_dynamic
Automatic merge from submit-queue

Change kubectl create to use dynamic client

https://github.com/kubernetes/kubernetes/issues/16764 https://github.com/kubernetes/kubernetes/issues/3955

This is a series of changes to allow kubectl create to use discovery-based REST mapping and dynamic clients.

cc @kubernetes/sig-api-machinery

**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
kubectl will no longer do client-side defaulting on create and replace.
```
2016-08-17 14:48:56 -07:00
Yu-Ju Hong a47e2ff91a Fix image inspection and matching
An image string could contain a hostname (e.g., "docker.io") or not. The same
applies to the RepoTags returned from an image inspection. To determine whether
the image docker pulled matches what the user ask for, we check if the either
string is the suffix of the other.
2016-08-17 14:48:11 -07:00
derekwaynecarr a65a24a850 kubelet eviction on inode exhaustion 2016-08-17 16:57:44 -04:00
Andy Goldstein c3fe759fec Always return exec command output
Always return exec command output, even if the command invocation returns nonzero. This applies to
exec probes and kubelet RunInContainer calls.
2016-08-17 16:21:19 -04:00
Chao Xu 594234d61c fix tests; convert IsPodActive to operate on *Pod 2016-08-17 13:05:37 -07:00
Quintin Lee 5ddb869a29 Adding auto-generated code for ImagePolicy webhook. 2016-08-17 12:25:42 -07:00
Quintin Lee 19c0c676d8 Adding imagepolicy group non-autogenerated code. 2016-08-17 12:25:42 -07:00
Jordan Liggitt fdb7c93a97
Close websocket watch when client closes 2016-08-17 15:20:05 -04:00
Matt Liggett 441bfb0614 Record an event when a pod does not have exactly 1 controller. 2016-08-17 12:14:06 -07:00
Matt Liggett 17ddb19ada Add TODO comment. 2016-08-17 12:14:06 -07:00
Yu-Ju Hong a2824bb7a3 Fix building pkg/util/procfs on non-linux platforms 2016-08-17 11:57:44 -07:00
Rodrigo Campos 4e9a14a64f Update generated code 2016-08-17 14:44:42 -04:00
Rodrigo Campos 5637569f74 Check return value from volume.SetVolumeOwnership() in downwardAPI
The function can fail, so we must check the return code.
2016-08-17 14:44:42 -04:00
Rodrigo Campos 568f4c2e63 Add mode permission bits to configmap, secrets and downwardAPI
This implements the proposal in:
docs/proposals/secret-configmap-downwarapi-file-mode.md

Fixes: #28317.

The mounttest image is updated so it returns the permissions of the linked file
and not the symlink itself.
2016-08-17 14:44:41 -04:00
Kubernetes Submit Queue 2bc5414de6 Merge pull request #30666 from feiskyer/fix-mount
Automatic merge from submit-queue

Fix pkg/util/mount for osx

Fix #30665.
2016-08-17 11:37:53 -07:00
Kubernetes Submit Queue f3f818a190 Merge pull request #29639 from aveshagarwal/master-default-resources-limits-fix
Automatic merge from submit-queue

Fix default resource limits (node allocatable) for downward api volumes and env vars

@kubernetes/rh-cluster-infra  @pmorie @derekwaynecarr
2016-08-17 11:37:41 -07:00
Tim St. Clair c99d7fddc1
Add alpha annotations support to the PodSecurityPolicy provider 2016-08-17 10:14:36 -07:00
Tim St. Clair d4ea444277
Add utility package for dealing with common map types 2016-08-17 10:14:33 -07:00
Kubernetes Submit Queue 86c83ccd00 Merge pull request #28696 from erictune/cpu
Automatic merge from submit-queue

Use k8s.io docs for memory/cpu request/limit
2016-08-17 09:59:42 -07:00
Wojciech Tyczynski 331083727f Change podNamespacer API 2016-08-17 16:55:01 +02:00
Matthew Wong 6486576f56 continue searching on bad size and add tests for bad size&mode 2016-08-17 10:42:52 -04:00
Andy Goldstein 8b171081d1 Add newline to printf to fix junit 2016-08-17 10:40:27 -04:00
Scott Creeley 782d7d9815 Add Events for operation_executor to show status of mounts, failed or successful 2016-08-17 09:53:47 -04:00
Timothy St. Clair 730fc70107 Update etcd default ports for v3, and validate tests 2016-08-17 07:49:19 -05:00
deads2k 1ed263e0e5 add --raw for kubectl get 2016-08-17 08:45:50 -04:00
Kubernetes Submit Queue aedeccda95 Merge pull request #28352 from vefimova/fix_22986-1
Automatic merge from submit-queue

Added warning msg for `kubectl get`

- added warning description regarding terminated pods to `get` long help message
  - added printing of warning message in case of `get pods` if there are hidden pods

Fixes #22986  (initiall PR and discussion are here #26417)

## **Output examples:**
### # kubectl get pods
```
NAME                       READY     STATUS             RESTARTS   AGE
dapi-test-pod1             0/1       Terminating        0          22h
liveness-http              0/1       CrashLoopBackOff   11245      22d
ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2336       8d
  info: 1 completed object(s) was(were) not shown in pods list. Pass --show-all to see all objects.

```

### #  kubectl get pods,namespaces
```
NAME                          READY     STATUS             RESTARTS   AGE
po/dapi-test-pod1             0/1       Terminating        0          22h
po/liveness-http              1/1       Running            11242      22d
po/ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2335       8d
 info: 1 completed object(s) was(were) not shown in pods list. Pass --show-all to see all objects.

NAME             STATUS    AGE
ns/default       Active    89d
ns/kube-system   Active    41d
```

### # kubectl get pods -a
```
NAME                       READY     STATUS             RESTARTS   AGE
busybox                    0/1       Error              0          27d
dapi-test-pod1             0/1       Terminating        0          22h
liveness-http              0/1       CrashLoopBackOff   11245      22d
ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2336       8d
```

### # kubectl get -h
```
Display one or many resources.

Possible resource types include (case insensitive): pods (aka 'po'), services (aka 'svc'), deployments (aka 'deploy'),
replicasets (aka 'rs'), replicationcontrollers (aka 'rc'), nodes (aka 'no'), events (aka 'ev'), limitranges (aka 'limits'),
persistentvolumes (aka 'pv'), persistentvolumeclaims (aka 'pvc'), resourcequotas (aka 'quota'), namespaces (aka 'ns'),
serviceaccounts (aka 'sa'), ingresses (aka 'ing'), horizontalpodautoscalers (aka 'hpa'), daemonsets (aka 'ds'), configmaps (aka 'cm'),
componentstatuses (aka 'cs), endpoints (aka 'ep'), petsets (alpha feature, may be unstable) and secrets.

This command will hide resources that have completed. For instance, pods that are in the Succeeded or Failed phases.
You can see the full results for any resource by providing the '--show-all' flag.

By specifying the output as 'template' and providing a Go template as the value
of the --template flag, you can filter the attributes of the fetched resource(s).

Examples:

.........
````
2016-08-17 05:11:50 -07:00
Maciej Kwiek 7b3041664b Remove misleading TODOs about labels.Set 2016-08-17 12:02:20 +02:00
Eric Tune faad0cec15 Use k8s.io docs for memory/cpu request/limit 2016-08-17 02:58:44 -07:00
Kubernetes Submit Queue 7b49d0c19d Merge pull request #23265 from AdoHe/big_yaml
Automatic merge from submit-queue

use Reader.ReadLine instead of bufio.Scanner to support bigger yaml

@smarterclayton ptal. Also refer #19603 #23125 for more details.
2016-08-17 02:26:46 -07:00
gmarek 4cf698ef04 Expose flags for new NodeEviction logic in NodeController 2016-08-17 10:43:24 +02:00
Kubernetes Submit Queue fdd2392035 Merge pull request #30504 from piosz/hpa-ext-client
Automatic merge from submit-queue

Hpa ext client

```release-note
Removed support for HPA in extensions client.
```

fix #21578
2016-08-17 01:35:16 -07:00
Kubernetes Submit Queue 90f3a95700 Merge pull request #30724 from jingxu97/reconcile-8-16
Automatic merge from submit-queue

Add GetDeviceNameFromMount in mount_unsupported.go
2016-08-17 01:35:05 -07:00
Kubernetes Submit Queue 18aa761b07 Merge pull request #30664 from hongchaodeng/r3
Automatic merge from submit-queue

pkg/storage: remove Codec() from interface

What?
Removes Codec() from storage.Interface.

Why?
- storage interface doesn't need to expose Codec().
- Codec() isn't used anywhere.
2016-08-17 00:56:05 -07:00
Kubernetes Submit Queue c07ef7163c Merge pull request #30497 from ping035627/ping035627-patch-0811
Automatic merge from submit-queue

Add validation conditions for autoscale

When validate the value of max and min in autoscale.go, it should append all the invalid conditions to errs, and print the value.
2016-08-17 00:55:29 -07:00
Kubernetes Submit Queue 6bbc99937d Merge pull request #30492 from lixiaobing10051267/masterUID
Automatic merge from submit-queue

Modify IsInvalidObj name and description

IsInvalidObj  note incorrect, modify it.
2016-08-17 00:55:01 -07:00
Kubernetes Submit Queue 622db63282 Merge pull request #30435 from hodovska/1328441-non-k8scontainers
Automatic merge from submit-queue

Add note: kubelet manages only k8s containers.

Kubelet wrote log when accesing container which was not created in k8s, what could confuse users. That's why we added note about it in documentation and lowered log level of the message to 5.

Here is example of the message: 
```
> Apr 19 11:50:32 openshift-114.lab.sjc.redhat.com atomic-openshift-node[9551]: 
I0419 11:50:32.194020    9600 docker.go:363] 
Docker Container: /tiny_babbage is not managed by kubelet.
```

bug 1328441
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1328441
2016-08-17 00:54:33 -07:00
Kubernetes Submit Queue b22ba87ab3 Merge pull request #30165 from mikedanese/shortname
Automatic merge from submit-queue

add shortname for certificate signing request in kubectl

#30163
2016-08-17 00:54:13 -07:00
Kubernetes Submit Queue e800c391f5 Merge pull request #30050 from ping035627/ping035627-patch-0804
Automatic merge from submit-queue

Correct the url in comment and optimise the code style

The PR modified two aspects:
1) Correct the url in comment, the original url can't be accessed;
2) Optimise the code style according to the go style guide.
2016-08-17 00:53:53 -07:00
Kevin 1e2d560253 make taints unique by <key, effect> on a node 2016-08-17 15:40:33 +08:00
Kubernetes Submit Queue 1c9332ab51 Merge pull request #30400 from ronnielai/percent1
Automatic merge from submit-queue

Support percentage threshold for eviction
2016-08-16 23:03:21 -07:00
saadali 0c72568247 Skip safe to detach if node api obj doesn't exist 2016-08-16 21:30:51 -07:00
AdoHe ca315e317b kubectl run add pull-policy flag to control image pull policy 2016-08-17 11:26:27 +08:00
Jordan Liggitt 5b7edc1aa6
Validate involvedObject.Namespace matches event.Namespace 2016-08-16 21:18:52 -04:00
Daniel Smith 2aa0bb2dfc Revert "syncNetworkUtil in kubelet and fix loadbalancerSourceRange on GCE" 2016-08-16 18:12:28 -07:00
Jing Xu 89de4f2f55 Add GetDeviceNameFromMount in mount_unsupported.go
Add GetDeviceNameFromMount in mount_unsupported.go
2016-08-16 16:34:10 -07:00
Kubernetes Submit Queue d412d5721d Merge pull request #30486 from freehan/lbsrcfix
Automatic merge from submit-queue

syncNetworkUtil in kubelet and fix loadbalancerSourceRange on GCE

fixes: #29997 #29039

@yujuhong Can you take a look at the kubelet part?

@girishkalele KUBE-MARK-DROP is the chain for dropping connections. Marked connection will be drop  in INPUT/OUTPUT chain of filter table. Let me know if this is good enough for your use case.
2016-08-16 15:22:34 -07:00
Matt Liggett d60ba3c6e2 Implement DisruptionController.
Part of #12611
2016-08-16 15:20:41 -07:00
Clayton Coleman 994e9e3c62
ResourceNames() should prohibit unnamed arguments
resource.Builder should prohibit empty resource names (the error is from
the wrong place) so that commands that work on multiple resources but
not resource types can properly limit errors.
2016-08-16 17:52:17 -04:00
Kubernetes Submit Queue 1b0bc9421f Merge pull request #30301 from girishkalele/endpoint_hostnames
Automatic merge from submit-queue

Add NodeName to EndpointAddress object

Adding a new string type `nodeName` to api.EndpointAddress.
We could also do  *ObjectReference to the api.Node object instead, which would be more precise for the future.

```
type ObjectReference struct {
    Kind            string    `json:"kind,omitempty"`
    Namespace       string    `json:"namespace,omitempty"`
    Name            string    `json:"name,omitempty"`
    UID             types.UID `json:"uid,omitempty"`
    APIVersion      string    `json:"apiVersion,omitempty"`
    ResourceVersion string    `json:"resourceVersion,omitempty"`

    // Optional. If referring to a piece of an object instead of an entire object, this string
    // should contain information to identify the sub-object. For example, if the object
    // reference is to a container within a pod, this would take on a value like:
    // "spec.containers{name}" (where "name" refers to the name of the container that triggered
    // the event) or if no container name is specified "spec.containers[2]" (container with
    // index 2 in this pod). This syntax is chosen only to have some well-defined way of
    // referencing a part of an object.
    // TODO: this design is not final and this field is subject to change in the future.
    FieldPath string `json:"fieldPath,omitempty"`
}
```
2016-08-16 13:11:10 -07:00
Avesh Agarwal 52a60fe3be Fix default resource limits (node capacities) for downward api volumes 2016-08-16 14:41:17 -04:00
Kubernetes Submit Queue ce78648fe5 Merge pull request #30648 from hongchaodeng/cleanup
Automatic merge from submit-queue

pkg/storage: cleanup unused Config

The entry has been moved to [pkg/storage/storagebackend/factory.Create()](https://github.com/kubernetes/kubernetes/blob/master/pkg/storage/storagebackend/factory/factory.go#L27)
2016-08-16 11:11:27 -07:00
juanvallejo 4b18f52fc9 add unit test for duplicate errors 2016-08-16 13:09:55 -04:00
juanvallejo 6e7df2c986 remove duplicate errors from aggregate error outputs 2016-08-16 13:09:52 -04:00
derekwaynecarr 14a2b261a8 Node controller deletePod return true if there are pods pending deletion 2016-08-16 13:05:38 -04:00
Matthew Wong fe817674ab Don't bind pre-bound pvc & pv if size request not satisfied 2016-08-16 12:24:18 -04:00
Silas Boyd-Wickizer 39a9ec3a4f Add a short `-n` for `kubectl`'s `--namespace`
fixes #24078

--namespace is a very common flag for nearly every kubectl command we have.
We should claim -n for it.
2016-08-16 08:32:47 -07:00
Kenjiro Nakayama 7d3cad6898 Use MarshalIndent instead of marshal and indent 2016-08-16 18:00:30 +09:00
Kubernetes Submit Queue 5962874414 Merge pull request #30118 from timstclair/aa-hookup
Automatic merge from submit-queue

Implement AppArmor Kubelet support

Includes PR https://github.com/kubernetes/kubernetes/pull/29812

Implements the Kubelet logic for AppArmor based on the alpha API proposed [here](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/apparmor.md). Also adds an E2E test, and I ran manual tests.

Remaining work: PodSecurityPolicy support, profile loader daemon, documentation, (maybe) beta API.

/cc @jfrazelle @Amey-D @kubernetes/sig-node 

*Note on release-note-none: I am implementing AppArmor over multiple PRs. I will submit a single release note once the implementation is done to cover all of them.*
2016-08-15 22:32:58 -07:00
Kris b5235bccec Make kubectl replace use dynamic clients 2016-08-15 22:07:54 -07:00
Kris 7511412ca6 Make kubectl create use dynamic clients 2016-08-15 22:07:54 -07:00
Kris 24c441e96d kubectl/resource: Remove thirdparty special casing
And also remove some duplicate code while I'm at it.
2016-08-15 22:07:54 -07:00
Kris d1aa3dd0b4 Fix thirdparty codec to return GVK 2016-08-15 22:07:54 -07:00
Kris 63a512fe47 Add discovery mapper and dynamic typer to kubectl 2016-08-15 22:07:54 -07:00
Kris 3999f071d1 Add generic "List" type for all versions 2016-08-15 22:07:54 -07:00
Kris 361f13ddf0 Add JSON encoding handlers to unstructured objects 2016-08-15 22:07:53 -07:00
Brendan Burns 50089f6c81 Initial support for TokenFile in the client config. 2016-08-15 21:59:49 -07:00
Kubernetes Submit Queue c24c1eedf2 Merge pull request #29981 from ping035627/ping035627-patch-0803
Automatic merge from submit-queue

Implement restful for InstallLogsSupport

The PR implement restful for InstallLogsSupport in apiserver.go.
2016-08-15 21:51:35 -07:00
Kubernetes Submit Queue 9c769c5dbe Merge pull request #29437 from AdoHe/event_node_uid
Automatic merge from submit-queue

fix node controller event uid issue

Fix #29289. @smarterclayton ptal. This is not a very elegant fix, if we can use nodeName in log maybe we can set timedValue.Value to node.UID.
2016-08-15 21:13:43 -07:00
Girish Kalele e105525b33 Fix endpoints_controller unit tests 2016-08-15 21:01:21 -07:00
Hongchao Deng a607a69f4a pkg/storage: cleanup Codec() from interface 2016-08-15 20:46:13 -07:00
Kubernetes Submit Queue 096dd4df50 Merge pull request #26510 from AdoHe/patch_test
Automatic merge from submit-queue

update strategic patch test for merge list of maps

Refer #26418 for more details. @janetkuo the test case is added, ptal.
2016-08-15 20:38:22 -07:00
Kubernetes Submit Queue c5ab95cd79 Merge pull request #30661 from saad-ali/safeDeviceUnmount
Automatic merge from submit-queue

Prevent device unmount from deleting dir on failed unmount

This PR cleans up the device unmount code for attachable volumes. Specifically it:
* Prevents deletion of directory via `os.Remove` unless unmount succeeds.
* Moves common shared device unmount logic to a common util file.
2016-08-15 20:02:30 -07:00
PingWang d902fd6cad correct the url in comment
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

optimise the style

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update err define

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-16 10:41:12 +08:00
PingWang bc3b74a499 Add validation conditions for autoscale
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

delete --min judgment

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-16 09:41:28 +08:00
Euan Kemp c94e134ae4 dockertools: Don't use network plugin if net=host
This was already handled in most places. I think this is the only
remaining instance of it in the docker package.

This could lead to confusing results. E.g. if `networkPlugin` was cni,
it could lead to error logs about not getting network status for host
pods if eth0 didn't exist on the host.
2016-08-15 18:17:11 -07:00
PingWang 8760ae697e implement restful for InstallLogsSupport
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

add ws.doc

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

run hack/update-swagger-spec.sh

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update update-swagger-spec.sh

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update apiserver_test.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update comment

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-16 09:09:02 +08:00
Minhan Xia 643fc3803b add firewall chain to filter request based on loadbalancer source range 2016-08-15 17:42:41 -07:00
Minhan Xia 3bf8679232 add syncNetworkUtil in kubelet 2016-08-15 17:42:35 -07:00
Daniel Smith 7ac0b929b8 Make registered more testable 2016-08-15 17:35:10 -07:00
Pengfei Ni 12d7c4f380 Fix mount for osx 2016-08-16 08:26:15 +08:00
Girish Kalele 36180a930b Generated code 2016-08-15 17:24:01 -07:00
saadali e73c516366 Prevent device unmount from deleting dir on err
Prevent device unmount from deleting dir unless volume is successfully
unmounted first.
2016-08-15 16:58:31 -07:00
Kubernetes Submit Queue 431e7ce1ab Merge pull request #30166 from mikedanese/csr-print
Automatic merge from submit-queue

add a certificate signing request resource printer in kubectl

#30163
2016-08-15 16:02:24 -07:00
vefimova f20c40ed65 Added warning msg for `kubectl get`
- added warning description regarding terminated objects to `get` long help message
  - added printing of warning message in case of `get pods` if there are hidden pods
Fixes #22986
2016-08-15 22:49:37 +00:00
Girish Kalele 95111c457e endpoints controller: Write pod NodeName to endpointAddress in endpoint subsets 2016-08-15 15:12:15 -07:00
Girish Kalele c60ba61fe7 Add NodeName to EndpointAddress object 2016-08-15 15:11:51 -07:00
Tamer Tas f031f09efc kubelet/api: extract PodSandboxManager interface
Splits `RuntimeService` interface into smaller interfaces
to make testing easier and to delineate responsibilities.
2016-08-16 01:09:28 +03:00
Tamer Tas f715aa475c kubelet/api: extract ContainerManager interface 2016-08-16 01:08:17 +03:00
Minhan Xia 85fdeb4742 add iptables util parameters to kubelet config type 2016-08-15 15:04:11 -07:00
bindata-mockuser e067f7548f Delete all dead containers only after pod syncing is done. 2016-08-15 14:36:51 -07:00
Tamer Tas cfc08dea34 kubelet/api: extract RuntimeVersioner interface 2016-08-16 00:35:07 +03:00
Kubernetes Submit Queue 967dc4234a Merge pull request #30582 from dims/fix-issue-30580
Automatic merge from submit-queue

Fix image verification when hostname is present in image

Deal better with the situation where a image name contains
a hostname as well.

Fixes #30580
2016-08-15 14:26:05 -07:00
Hongchao Deng ed79925dd6 pkg/storage: remove unused Config 2016-08-15 14:20:38 -07:00
Kris 69e0740b93 Properly decode lists into VersionedObjects 2016-08-15 14:18:40 -07:00
Kris e5c2154883 Eliminate redundant dynamic client type
This will allow people to override the default parameter codec and still
pass the resulting client with something that accepts *dynamic.Client.
2016-08-15 14:18:40 -07:00
Kris d9ce524d63 Expose dynamic client's content config 2016-08-15 14:18:40 -07:00
Kubernetes Submit Queue 79ed7064ca Merge pull request #27970 from jingxu97/restartKubelet-6-22
Automatic merge from submit-queue

Add volume reconstruct/cleanup logic in kubelet volume manager

Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.

Fixes https://github.com/kubernetes/kubernetes/issues/27653
2016-08-15 13:48:43 -07:00
Tim St. Clair db6629228f
Add AppArmor E2E test 2016-08-15 13:25:22 -07:00
Tim St. Clair 3c7896719b
Implement AppArmor Kubelet support 2016-08-15 13:25:17 -07:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
```

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
Kubernetes Submit Queue 88d8628137 Merge pull request #30521 from yujuhong/rm_pod_resources
Automatic merge from submit-queue

CRI: remove pod sandbox resources

The pod-level resources need further discussion. Remove it from CRI for now.

See the original discussion in #29871
2016-08-15 11:42:19 -07:00
Hongchao Deng eb516fbc0a optimize field.Set{} -> nil 2016-08-15 11:41:25 -07:00
Jing Xu f19a1148db This change supports robust kubelet volume cleanup
Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.
2016-08-15 11:29:15 -07:00
Mike Danese ab730a7179 add a certificate signing request resource printer in kubectl 2016-08-15 09:57:17 -07:00
Kubernetes Submit Queue 3a71e8c9f4 Merge pull request #30457 from ericchiang/reorder-autenticators
Automatic merge from submit-queue

pkg/apiserver/authenticator: reorder oidc plugin to auth after service accounts

Both plugins verify JWTs, but the OpenID Connect plugin performs
much worse when faced with cache misses. Reorder the plugins so
the service account plugin tries to authenticate a bearer token
first.

I had a fun time with this by writing an OpenID Connect provider that stores its data in third party resources. When it's running in the cluster it uses a service account and caused some interesting behavior when the keys expired.

Our OpenID Connect plugin needs a more sophisticated caching model to avoid continuously re-requesting keys when seeing a lot of tokens it doesn't recognize. However, I feel this reordering is generally useful since service accounts will be more common than OpenID Connect tokens.

cc @kubernetes/sig-auth
2016-08-15 09:39:02 -07:00
Clayton Coleman 6caf4d5a3f
Describing a single item should not have extra newlines 2016-08-15 12:28:15 -04:00
derekwaynecarr cebb038935 Fix pvc requests.storage validation 2016-08-15 09:56:04 -04:00
Dominika Hodovska 08945a9b6a Add note: kubelet manages only k8s containers.
bug 1328441
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1328441
2016-08-15 12:36:29 +02:00
Kubernetes Submit Queue 85c91eb332 Merge pull request #30451 from soltysh/isssue30442
Automatic merge from submit-queue

Remove pods along with jobs when Replace ConcurrentPolicy is set

Fixes #30442

This builds on #30327 and needs a bit more love in tests.

@janetkuo @erictune fyi
2016-08-14 04:25:39 -07:00
Maciej Szulik d446930699 Remove pods along with jobs when Replace ConcurrentPolicy is set 2016-08-14 11:59:06 +02:00
AdoHe 2d06408300 use Reader.ReadLine instead of bufio.Scanner to support bigger yaml 2016-08-14 16:02:43 +08:00
Hongchao Deng 75fe25e717 generic.Matcher -> *generic.SelectionPredicate 2016-08-13 21:52:11 -07:00
Davanum Srinivas cc9f41c6d3 Fix image verification when hostname is present in image
Deal better with the situation where a image name contains
a hostname as well.

Fixes #30580
2016-08-13 23:10:07 -04:00
AdoHe b2ab4c6d9b fix node controller event uid issue 2016-08-14 09:41:20 +08:00
Kubernetes Submit Queue 3a8b21b3a5 Merge pull request #29724 from brendandburns/thirdparty3
Automatic merge from submit-queue

Fix third party APIResource reporting

@polvi @caesarxuchao @deads2k 

This "fixes" some additional bugs in third party `APIResourceList` reporting.

This code needs a bunch of cleanup, and more tests, but sending it out for a quick smell check review in case I'm doing something stupid.

Fixes the bug referenced here:  https://github.com/kubernetes/kubernetes/pull/28414#issuecomment-235346108 and in https://github.com/kubernetes/kubernetes/issues/23831

Fixes https://github.com/kubernetes/kubernetes/issues/25570
2016-08-13 17:10:20 -07:00
Brendan Burns b3658c7b16 Fix third party APIResource reporting 2016-08-13 15:51:34 -07:00
Kubernetes Submit Queue ceb75699dd Merge pull request #29740 from svanharmelen/f-cloudstack-cloudprovider
Automatic merge from submit-queue

Add CloudStack cloud provider (extended and refactored)

This PR is superseding PR #26165 is which some groundwork for this PR has been done. So this PR now fixes #26165 and fixes #26045.

I've been in contact with @ngtuna about this updated version of his earlier work (which is still in this PR as one squashed commit) and he has given his 👍  for this 😉

This PR adds additional logic for allocating and associating a public IP, if the `—load-balancer-ip` option is not used. It will do proper management of public IP’s that are allocated by this provider ( so IP’s that are no longer needed/used will also be released again).

Additionally the provider can now also work with CloudStack projects and advanced (VPC) networks. And lastly the Zone interface now returns an actual zone (supplied by the cloud config), a few logical errors are fixed and the first few tests are added.

All the functionality is extensively tested against both basic and advanced (VPC) networks and of course all new and existing (integration) tests are all passing.
2016-08-13 11:30:07 -07:00
Hongchao Deng d4afb781c3 change all PredicateFunc to use SelectionPredicate 2016-08-13 10:11:35 -07:00
Kubernetes Submit Queue e39d7f71e6 Merge pull request #30251 from hongchaodeng/r2
Automatic merge from submit-queue

Move new etcd storage (low level storage) into cacher

In an effort for #29888, we are pushing forward this:

What?
- It changes creating etcd storage.Interface impl into creating config
- In creating cacher storage (StorageWithCacher), it passes config created above and new etcd storage inside.

Why?
- We want to expose the information of (etcd) kv client to cacher. Cacher storage uses this information to talk to remote storage.
2016-08-13 10:09:49 -07:00
Kubernetes Submit Queue 7d00b427ef Merge pull request #30557 from freehan/cniconfig
Automatic merge from submit-queue

move syncNetworkConfig to Init for cni network plugin

start syncNetworkConfig routine in `Init` instead of probing. This fixes a bug where the syncNetworkConfig runs periodically even `cni` network plugin is not in use.
2016-08-13 05:58:33 -07:00
Kubernetes Submit Queue 25f29cb71b Merge pull request #30528 from hongchaodeng/fix
Automatic merge from submit-queue

add RequiresExactMatch test for empty andterm

What?
Add a test path for empty andterm.

Why?
fields.Everything() returns empty andterm.
fields.SelectorFromSet() returns empty andterm.
2016-08-13 04:11:39 -07:00
Kubernetes Submit Queue 9d3bd4caf6 Merge pull request #30517 from kubernetes/cri/remove-resources
Automatic merge from submit-queue

Remove resource specifications from CRI until further notice

See #29871 for the discussion issue.

cc @dchen1107 @vishh @yujuhong @euank @yifan-gu @feiskyer
2016-08-13 03:35:47 -07:00
Kubernetes Submit Queue f98de24061 Merge pull request #30510 from derekwaynecarr/logging-fix
Automatic merge from submit-queue

Endpoint controller logs errors during normal cluster behavior

The endpoint controller logs an error when its forbidden from creating new endpoints during namespace termination.  This is normal cluster behavior, and therefore should not be logged.  This confuses operators administrating the cluster.

Updated to log at a lower level in response to a forbidden message when performing a create operation.  In case of an error on the API server side of the house, I continue to requeue the key.  It should be ignored in a future syncService call once the service is deleted as part of namespace termination.

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

/cc @kubernetes/rh-cluster-infra
2016-08-13 02:59:26 -07:00
Sander van Harmelen 7c3e644162 Enable managing public IP’s and work with projects
This commit adds logic for allocating and associating a public IP, if the `—load-balancer-ip` option is not used. It will do proper management of IP’s that are allocated by this provider, so IP’s that are no longer needed/used will also be released again.

Additionally the provider can now also work with CloudStack projects and advanced (VPC) networks.

Lastly the Zone interface now returns an actual zone (supplied by the cloud config), a few logical errors are fixed and the first few tests are added.

All the functionality is extensively tested against both basic and advanced (VPC) networks.
2016-08-13 10:23:17 +02:00
Kubernetes Submit Queue a44baa0a48 Merge pull request #30383 from deads2k/fix-reaper
Automatic merge from submit-queue

speed up RC scaler

The RC scaler was waiting before starting the scale and then didn't use a watch to observe the result.  That led to longer than expected wait times.

@fabianofranz ptal.  You may want to sweep the rest of the file.  It could use some tidying with `RetryOnConflict` and `watch.Until`.
2016-08-13 01:05:00 -07:00
ngtuna 52cb7b0755 Initial CloudStack provider 2016-08-13 09:40:23 +02:00
Kubernetes Submit Queue 8a35d4c97c Merge pull request #30366 from dims/fix-issue-30355
Automatic merge from submit-queue

Validate SHA/Tag when checking docker images

Docker API does not validate the tag/sha, for example, all the following
calls work say for a alpine image with short SHA "4e38e38c8ce0"
echo -e "GET /images/alpine:4e38e38c8ce0/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
echo -e "GET /images/alpine:4e38e38c/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
echo -e "GET /images/alpine:4/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock

So we should check the response from the Docker API and look for the tags or SHA explicitly.

Fixes #30355
2016-08-12 23:42:40 -07:00
Kubernetes Submit Queue df1abb40ec Merge pull request #30246 from liggitt/certificates
Automatic merge from submit-queue

Set user info in CertificateSigningRequest.Spec on create

Fixes #30239
2016-08-12 23:03:18 -07:00
Kubernetes Submit Queue dadb3322dc Merge pull request #30327 from janetkuo/sj-controller-client
Automatic merge from submit-queue

Use unversioned client in scheduledjobs and set group version to batch/v2alpha1

Fixes #30323
2016-08-12 22:08:34 -07:00
Kubernetes Submit Queue f0e5dac1f1 Merge pull request #30247 from ardnaxelarak/28695_suppress_noisy_output
Automatic merge from submit-queue

Make more messages respect --quiet flag

Make following two messages respect `--quiet` in `kubectl run`
- `If you don't see a command prompt, try pressing enter.`
- `Pod "name" deleted`

Ref #28695
2016-08-12 21:34:14 -07:00
Kubernetes Submit Queue 612e3c2634 Merge pull request #30222 from hodovska/port-forward-cmd-struct
Automatic merge from submit-queue

kubectl/port-forward: complete/validate/run structure

```kubectl port-forward``` command is converted to a complete/validate/run kubectl command structure specified here: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md#command-conventions
In this PR is also exposed the ready and stop channel for API consumer.

Fixes #16504
2016-08-12 20:58:53 -07:00
Kubernetes Submit Queue 929b238adc Merge pull request #30137 from nhlfr/cni-plugin-fail
Automatic merge from submit-queue

Set pod state as "unknown" when CNI plugin fails

Before this change, CNI plugin failure didn't change anything in the pod status, so pods having containers without requested network were "running".

Fixes #29148
2016-08-12 19:28:14 -07:00
Hongchao Deng d0938094d9 move new etcd storage into cacher 2016-08-12 18:40:20 -07:00
Kubernetes Submit Queue 96655d7578 Merge pull request #30087 from dims/remove-pkill-dependency
Automatic merge from submit-queue

Remove kubelet pkill dependency

Issue #26093 identified pkill as one of the dependencies of kublet
which could be worked around.  Build on the code introduced for pidof
and regexp for the process(es) we need to send a signal to.

Related to #26093
2016-08-12 18:38:38 -07:00
Kubernetes Submit Queue 29eda9bf29 Merge pull request #30421 from nikhiljindal/eventsAPI
Automatic merge from submit-queue

Adding events to federation control plane

Adding events to federation control plane.

Apart from the standard changes to add a resource to `federation/apis/core/v1`, other changes are:
* Adding a new `federationoptions.ServerRunOptions` which includes `genericoptions.ServerRunOptions` and EventsTTL. 
* Added a new method in `pkg/api/mapper` to build a RestMapper based on the passed Scheme rather than using `api.Scheme`. Updated `federation/apis/core/install` to use this new method. Without this change, if `federation/apis/core/install.init()` is called before `pkg/api/install.init()` then the registered RESTMapper in `pkg/apimachinery/registered` will have no resources. This second problem will be fixed once we have instances of `pkg/apimachinery/registered` instead of a single global singleton (generated clientset which imports `pkg/api/install` will have a different instance of registered, than federation-apiserver which imports `federation/apis/core/install`).

cc @kubernetes/sig-cluster-federation @lavalamp
2016-08-12 17:26:54 -07:00
Yu-Ju Hong bf7020a9b7 CRI: remove pod resources
The pod-level resources need further discussion. Remove it from CRI for now.
2016-08-12 17:07:25 -07:00
Minhan Xia 7964148059 move syncNetworkConfig to Init for cni network plugin 2016-08-12 16:49:25 -07:00
Janet Kuo e4269d490f Use unversioned client in scheduledjobs and set group version to batch/v2alpha1 2016-08-12 16:46:09 -07:00
Girish Kalele f64c052858 Revert "Scheduledjob e2e" 2016-08-12 16:12:19 -07:00
Kubernetes Submit Queue f279e61e4a Merge pull request #27874 from ingvagabund/kubelet-kernel-tunning-behaviour-new-flags
Automatic merge from submit-queue

[kubelet] Introduce --protect-kernel-defaults flag to make the tunable behaviour configurable

Let's make the default behaviour of kernel tuning configurable. The default behaviour is kept modify as has been so far.
2016-08-12 14:11:26 -07:00
Kubernetes Submit Queue ac1f8bc665 Merge pull request #26027 from soltysh/scheduledjob_e2e
Automatic merge from submit-queue

Scheduledjob e2e

@erictune last element of the scheduledjob puzzle. I think we'll iterate on this once we have all the puzzles in place. This is one of those things that will be allowed to merge after code freeze.

```release-note
* Introducing ScheduledJobs as described in [the proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/scheduledjob.md) as part of `batch/v2alpha1` version (experimental feature).
```

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-08-12 13:27:32 -07:00
Tamer Tas 2b055eb475 pkg/kubelet/container: deprecate outdated CRI API 2016-08-12 23:06:36 +03:00
Tamer Tas 70b5ed2665 pkg/kubelet/rktshim: deprecate kubelet/container API usage 2016-08-12 23:06:32 +03:00
Kubernetes Submit Queue 72f41ff8cf Merge pull request #30506 from tmrts/docs/cri-correction
Automatic merge from submit-queue

pkg/kubelet/container: amend cgroup type documentation
2016-08-12 12:08:17 -07:00
Kubernetes Submit Queue 5992deda1d Merge pull request #30478 from dims/fix-test-pidof-take-2
Automatic merge from submit-queue

Fix TestPidOf {procfs} - Take #2

We should not bailout when we get an error. We should continue
processing other files/directories. We were returning the
err passed in which was causing the processing to stop.

Fixes #30377
2016-08-12 12:07:40 -07:00
Kubernetes Submit Queue 19b2dd17b1 Merge pull request #30083 from feiskyer/kuberuntime-config
Automatic merge from submit-queue

Kubelet: generate sandbox/container config for new runtime API

Generate sandbox/container config for new runtime API. Part of #28789 .

CC @yujuhong @Random-Liu @dchen1107
2016-08-12 12:07:05 -07:00
Hongchao Deng 068bd170fc add RequiresExactMatch test for empty andterm 2016-08-12 11:51:52 -07:00
nikhiljindal 1d76884336 Adding events to federation apiserver 2016-08-12 10:48:19 -07:00
Kubernetes Submit Queue a4acf08747 Merge pull request #30460 from juanvallejo/jvallejo_kube-add-zsh-compatibility-note-kubectl-completion
Automatic merge from submit-queue

Add zsh compatibility note `completion` cmd help

zsh completions are not supported on zsh versions < 5.2.

This patch advices user on supported versions of zsh when using the `completion`
command to avoid potential UX failure.

##### After
`$ kubectl completion -h`
```
Output shell completion code for the given shell (bash or zsh).

This command prints shell code which must be evaluation to provide interactive
completion of kubectl commands.

Examples:

$ source <(kubectl completion bash)

will load the kubectl completion code for bash. Note that this depends on the
bash-completion framework. It must be sourced before sourcing the kubectl
completion, e.g. on the Mac:

$ brew install bash-completion
$ source $(brew --prefix)/etc/bash_completion
$ source <(kubectl completion bash)

If you use zsh*, the following will load kubectl zsh completion:

$ source <(kubectl completion zsh)

* zsh completions are only supported in versions of zsh >= 5.2
```

```release-note
release-note-none
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30460)
<!-- Reviewable:end -->
2016-08-12 10:16:50 -07:00
derekwaynecarr 038c754b7f Endpoint controller logs errors during normal cluster behavior 2016-08-12 12:51:07 -04:00
Kubernetes Submit Queue 7df59f75cd Merge pull request #29726 from anguslees/lb-autodetect
Automatic merge from submit-queue

openstack: Autodetect LBaaS v1 vs v2

```release-note
* openstack: autodetect LBaaS v1/v2 by querying for available extensions.  For most installs, this effectively changes the default from v1 to v2.  Existing installs can add "lb-version = v1" to the provider config file to continue to use v1.
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29726)
<!-- Reviewable:end -->
2016-08-12 09:02:42 -07:00
Kubernetes Submit Queue 6f20321833 Merge pull request #28509 from juanvallejo/jvallejo_update-human-readable-printer-signature
Automatic merge from submit-queue

Update HumanResourcePrinter signature w single PrintOptions param

release-note-none

- Makes [HumanReadablePrinter options field non-exported again](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/resource_printer.go#L346-349)
- Adds test-case for HumanReadablePrinter resource printing with aliases.
- Better formatting for saving resource "kind" aliases

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/28509)
<!-- Reviewable:end -->
2016-08-12 07:27:56 -07:00
Tamer Tas 14cc9919d0 pkg/kubelet/container: amend cgroup type documentation 2016-08-12 16:52:48 +03:00
Kubernetes Submit Queue 9c3d539313 Merge pull request #28844 from mksalawa/kubectltop
Automatic merge from submit-queue

Implement 'kubectl top' command

```release-note
Added 'kubectl top' command showing the resource usage metrics.
```

Sample output:

Nodes:
```
$ kubectl top node

NAME                           CPU       MEMORY    STORAGE   TIMESTAMP                         
kubernetes-minion-group-xxxx   76m       1468 Mi   0 Mi      Tue, 12 Jul 2016 17:37:00 +0200   
kubernetes-minion-group-yyyy   73m       1511 Mi   0 Mi      Tue, 12 Jul 2016 17:37:00 +0200   
kubernetes-minion-group-zzzz   46m       1506 Mi   0 Mi      Tue, 12 Jul 2016 17:37:00 +0200   
kubernetes-master              76m       2059 Mi   0 Mi      Tue, 12 Jul 2016 17:37:00 +0200   
```

Pods in all namespaces:
```
$ kubectl top pod --all-namespaces

NAMESPACE     NAME                                                 CPU       MEMORY    STORAGE   TIMESTAMP                         
default       nginx-1111111111-zzzzz                               0m        1 Mi      0 Mi      Tue, 12 Jul 2016 17:49:00 +0200   
kube-system   etcd-server-kubernetes-master                        4m        116 Mi    0 Mi      Tue, 12 Jul 2016 17:49:00 +0200   
kube-system   fluentd-cloud-logging-kubernetes-minion-group-xxxx   14m       110 Mi    0 Mi      Tue, 12 Jul 2016 17:49:00 +0200   
kube-system   kube-dns-v18-zzzzz                                   1m        6 Mi      0 Mi      Tue, 12 Jul 2016 17:49:00 +0200   
...
```

Pod with containers:
```
$ kubectl top pod heapster-v1.1.0-1111111111-miail --namespace=kube-system --containers

NAMESPACE     NAME                               CPU       MEMORY    STORAGE   TIMESTAMP                         
kube-system   heapster-v1.1.0-1111111111-miail   1m        42 Mi     0 Mi      Tue, 12 Jul 2016 17:52:00 +0200   
              heapster                           1m        26 Mi     0 Mi                                        
              eventer                            0m        3 Mi      0 Mi                                        
              heapster-nanny                     0m        6 Mi      0 Mi                                        
              eventer-nanny                      0m        6 Mi      0 Mi                                        
```

ref #11382

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/28844)
<!-- Reviewable:end -->
2016-08-12 06:50:43 -07:00
Dominika Hodovska c5babe2396 expose ready/stop channel 2016-08-12 15:45:57 +02:00
Piotr Szczesniak a53cfd28fb Autogenerated changes 2016-08-12 15:13:44 +02:00
Kubernetes Submit Queue 2ab58ea519 Merge pull request #30162 from juanvallejo/jvallejo_err-kube-run-on-invalid-image-value
Automatic merge from submit-queue

return err on `kubectl run --image` with invalid value

When running `kubectl run <configname> --image="Invalid$$%ImageValue%%__"`, a configuration is successfully created with an image name that is not a valid value for an image reference.

This patch validates that the image name is a valid image reference, and returns an error before creating a config if an invalid value is passed.

`$ kubectl run test --image="Invalid__%imagename"`
```
error: Invalid image name "Invalid__%imagename": invalid reference format
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30162)
<!-- Reviewable:end -->
2016-08-12 06:09:26 -07:00
Piotr Szczesniak dd142d3e95 Do not generate client for HPA in extensions 2016-08-12 15:01:25 +02:00
Kubernetes Submit Queue 510924b70a Merge pull request #27087 from soltysh/audit_log
Automatic merge from submit-queue

Basic audit log

Fixes #2203 by introducing simple audit logging, including the information about impersonation. We currently have something identical in openshift, but I'm open to any suggestions. Sample logs look like that:

as `<self>`:
```
AUDIT: id="75114bb5-970a-47d5-a5f1-1e99cea0574c" ip="127.0.0.1" method="GET" user="test-admin" as="<self>" namespace="openshift" uri="/api/v1/namespaces/openshift/pods/python"
AUDIT: id="75114bb5-970a-47d5-a5f1-1e99cea0574c" response=200
```

as user:
```
AUDIT: id="b0a443ae-f7d8-408c-a355-eb9501fd5c59" ip="192.168.121.118" method="GET" user="system:admin" as="test-admin" namespace="openshift" uri="/api/v1/namespaces/openshift/pods/python"
AUDIT: id="b0a443ae-f7d8-408c-a355-eb9501fd5c59" response=200
```

```release-note
* Add basic audit logging
```

@ericchiang @smarterclayton @roberthbailey @erictune @ghodss 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/27087)
<!-- Reviewable:end -->
2016-08-12 05:31:31 -07:00
deads2k 553313f867 speed up RC scaler 2016-08-12 08:19:10 -04:00
Maciej Szulik 24f1e1eaf6 Basic audit log 2016-08-12 12:27:19 +02:00
Kubernetes Submit Queue d2543c30d8 Merge pull request #30277 from wojtek-t/optimize_controllers
Automatic merge from submit-queue

Avoid computing DeepEqual in controllers all the time

Computing DeepCopy was responsible for ~33% of cpu usage of controller-manager before this PR.

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
* Use the release-note-* labels to set the release note state 
* Clear this block to use the PR title as the release note 
-OR-
* Enter your extended release note here (newlines are formatted as bullets)
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30277)
<!-- Reviewable:end -->
2016-08-12 03:20:58 -07:00
Kubernetes Submit Queue 5c1e1573d2 Merge pull request #30461 from caesarxuchao/kubectl-gc
Automatic merge from submit-queue

Let kubectl delete rc and rs with DeleteOptions.OrphanDependents=false

so that when the garbage collector is enabled, RC and RS are deleted immediately without waiting for the garbage collector to orphan the pods.

There is no user visible changes, so we don't need a release note.

cc @fabioy

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30461)
<!-- Reviewable:end -->
2016-08-12 01:55:11 -07:00
Kubernetes Submit Queue c4c930b413 Merge pull request #30005 from dchen1107/api
Automatic merge from submit-queue

Marked NodePhase deprecated.

cc/ @lavalamp 

Even Kubernetes stops set NodePhase for a while, the user might patch NodeStatus with NodePhase. Marked the field deprecated and documented first. 

xref: https://github.com/kubernetes/kubernetes.github.io/pull/549

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30005)
<!-- Reviewable:end -->
2016-08-12 01:11:12 -07:00
Kubernetes Submit Queue 8bd71c3de9 Merge pull request #29502 from lixiaobing10051267/masterHostName
Automatic merge from submit-queue

t.Errorf output wrong variables in identity_mapper_test.go

t.Errorf output wrong variables in identity_mapper_test.go

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29502)
<!-- Reviewable:end -->
2016-08-12 00:31:53 -07:00
Kubernetes Submit Queue 4a5c852697 Merge pull request #30420 from janetkuo/sj-job-determi
Automatic merge from submit-queue

Name jobs created by sj deterministically

```release-note
Name the job created by scheduledjob (sj) deterministically with sj's name and a hash of job's scheduled time.
```

@erictune @soltysh

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30420)
<!-- Reviewable:end -->
2016-08-11 23:14:02 -07:00
Kubernetes Submit Queue c73b96d66d Merge pull request #25526 from lavalamp/fix-generated-code
Automatic merge from submit-queue

Fix code generators-- make scheme building composable

I needed to make some changes to make my other refactoring possible and this got rather large. 

We now provide a "SchemeBuilder" to help all of the api packages provide their scheme-building functions (addKnownTypes and friends) in a standardized way. This also allows generated deepcopies & conversions to be entirely self contained, the project will now build without them being present (as they can add themselves to the SchemeBuilder). (Although if you actually build without them, you will get reduced performance!)

Previously, there was no way to construct your own runtime.Scheme (e.g., to test), you had to use the api.Scheme object, which has all sorts of non-hermetic cruft in it. Now you can get everything from a package by calling the scheme builder's AddToScheme, including the generated functions, if they are present.

Next steps are to allow for declaring dependencies, and to standardize the registration & install code. (#25434)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/25526)
<!-- Reviewable:end -->
2016-08-11 22:38:29 -07:00
Kubernetes Submit Queue 01aff52e0c Merge pull request #29653 from ZTE-PaaS/zhangke-patch-010
Automatic merge from submit-queue

the observed usage should match those that have hard constraints

in the sync process, the quota will be replenished, the new observed usage will be sumed from each evaluator, if the previousUsed set is not be cleared, the new usage will be dirty, maybe some unusage resource still in ,  as the code below
	newUsage = quota.Mask(newUsage, matchedResources)
	for key, value := range newUsage {
		usage.Status.Used[key] = value
	}
so i think here shoul not set value previousUsed

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29653)
<!-- Reviewable:end -->
2016-08-11 21:54:28 -07:00
Pengfei Ni 3512975c31 Kubelet: generate sandbox/container config for new runtime API 2016-08-12 12:20:56 +08:00
Kubernetes Submit Queue 78356b53b0 Merge pull request #30396 from derekwaynecarr/quota-negative-usage
Automatic merge from submit-queue

Quota admission errors if usage is negative

If quota observes negative usage for an artifact, that artifact could game the quota system.

This adds a global check in the quota system to catch this scenario for all evaluators.

/cc @deads2k

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30396)
<!-- Reviewable:end -->
2016-08-11 20:24:43 -07:00
lixiaobing10051267 65f772d050 Modify IsInvalidObj name and description 2016-08-12 11:17:08 +08:00
Kubernetes Submit Queue 922477f987 Merge pull request #30381 from aveshagarwal/kubectl-describe-pod-display-tolerations
Automatic merge from submit-queue

Display pod tolerations with kubectl describe pod

@kubernetes/rh-cluster-infra @kubernetes/kubectl

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30381)
<!-- Reviewable:end -->
2016-08-11 19:45:15 -07:00
Kubernetes Submit Queue 7c7acbe1bb Merge pull request #30417 from yujuhong/source_ready
Automatic merge from submit-queue

kubelet: mark source ready after updating the cache

This ensures that cleanup routines don't start until the cache content is
up-to-date.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30417)
<!-- Reviewable:end -->
2016-08-11 18:28:44 -07:00
Angus Lees e4c354c329 openstack: Autodetect LBaaS v1 vs v2
This removes the need to manually specify the version in all but unusual
cases.

For most installs this will effectively flip the default from
v1 (deprecated) to v2 so conservative existing installs may want to
manually configure "lb-version = v1" before upgrading.
2016-08-12 10:33:11 +10:00
Daniel Smith 77f5813194 update generated files, including the client 2016-08-11 17:06:55 -07:00
Daniel Smith f1fd638962 fix register.go files up + add test import 2016-08-11 17:06:54 -07:00
Kubernetes Submit Queue 2c28b88efb Merge pull request #29812 from timstclair/aa-validation
Automatic merge from submit-queue

Add AppArmor validation logic

The validation checks the prerequisites described in the [AppArmor proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/apparmor.md#prerequisites).

In order to unblock the AppArmor implementation from waiting on the APIs to merge, this PR uses 2 helper stubs for handling the Pod API.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29812)
<!-- Reviewable:end -->
2016-08-11 15:49:55 -07:00
Kubernetes Submit Queue d4691a76ec Merge pull request #27911 from jfrazelle/start-enable-golint
Automatic merge from submit-queue

Start verifying golint on a per-package basis as packages are fixed

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
Added `golint` for pkg/security/podsecuritypolicy/capabilities` along with validation.
```


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

This is a POC to start enabling `golint` checks on a per-package basis, we did this on the docker project and it was a great way for new contributors to help and it benefits the project overall. All they have to do is add the package they fixed to the bash array in `hack/verify-golint.sh` and fix all the lint errors. 
Eventually when all the packages have been fixed we can change the function to `find_files`. Or something based off which files are changed in a patch set to verify `golint`.
Now I used this specific package as the POC because I wanted to show the downside of this changing the api of the package.
Most of the times this arose in docker/docker we decided that if someone wasn't importing their deps locally then it was their loss, but I'm not sure if you all will agree.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/27911)
<!-- Reviewable:end -->
2016-08-11 15:03:06 -07:00
Davanum Srinivas 24e8e12b04 Fix TestPidOf {procfs} - Take #2
We should not bailout when we get an error. We should continue
processing other files/directories. We were returning the
err passed in which was causing the processing to stop.

Fixes #30377
2016-08-11 17:36:04 -04:00
bindata-mockuser d2dd03aecc Support percentage representation for eviction thresholds 2016-08-11 14:10:25 -07:00
Kubernetes Submit Queue 9620f066c6 Merge pull request #30128 from ZTE-PaaS/zhangke-patch-021
Automatic merge from submit-queue

get workers length shoud use RLock

get workers length shoud use RLock properly

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30128)
<!-- Reviewable:end -->
2016-08-11 13:33:10 -07:00
Daniel Smith caed8d85f4 add scheme builder 2016-08-11 13:18:26 -07:00
Kubernetes Submit Queue 91a3930331 Merge pull request #30362 from lixiaobing10051267/masterAppsClient
Automatic merge from submit-queue

check validation with no apps client in kubectl util factory

autoscaling client already exist:

		if c.c.AutoscalingClient == nil {
			return errors.New("unable to validate: no autoscaling client")

so following autoscaling client should be apps client:

		if c.c.AppsClient == nil {
			return errors.New("unable to validate: no autoscaling client")
		}

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30362)
<!-- Reviewable:end -->
2016-08-11 12:54:14 -07:00
Chao Xu bcc1b68d47 let kubectl delete rc and rs using explicit non-orphan delete options 2016-08-11 11:30:26 -07:00
juanvallejo 9eb98cfb58 Add zsh compatibility note `completion` cmd help 2016-08-11 13:49:44 -04:00
Tim St. Clair bdc306bbfe
Add AppArmor validation logic
The validation checks the prerequisites described in the [AppArmor
proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/apparmor.md#prerequisites)
2016-08-11 10:31:25 -07:00