Commit Graph

3213 Commits (05c046f6d339dfbc986d5966ac3a28f0e29f2d81)

Author SHA1 Message Date
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Dr. Stefan Schimanski 918868b115 genericapiserver: cut off certificates api dependency 2017-01-16 14:10:59 +01:00
xilabao 8acbbb21e1 fix example in set selector
example run failed
2017-01-16 01:55:30 -06:00
AdoHe d6d82425a4 refactor delete to remove cobra dependency 2017-01-15 15:30:06 +08:00
Brendan Burns 31eca372c9 Add the ability to edit fields within a config map. 2017-01-14 21:12:27 -08:00
Kubernetes Submit Queue a6fa5c2bfd Merge pull request #39814 from deads2k/api-58-multi-register
Automatic merge from submit-queue

replace global registry in apimachinery with global registry in k8s.io/kubernetes

We'd like to remove all globals, but our immediate problem is that a shared registry between k8s.io/kubernetes and k8s.io/client-go doesn't work.  Since client-go makes a copy, we can actually keep a global registry with other globals in pkg/api for now.

@kubernetes/sig-api-machinery-misc @lavalamp @smarterclayton @sttts
2017-01-13 12:37:02 -08:00
juanvallejo 95437a941f export list of user resources
This patch exports the list of "userResources" found in
`pkg/kubectl/cmd/util/shortcut_resmapper.go` to allow its use in
external packages and clients.
2017-01-13 14:48:47 -05:00
deads2k f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
Xing Zhou 695c27287b Fixed typo.
Fixed variable sequence typo in kubectl create sub-command tests.
2017-01-13 12:54:15 +08:00
Robert Rati 6a3ad93d6c [scheduling] Moved pod affinity and anti-affinity from annotations to api
fields. #25319
2017-01-12 14:54:29 -05:00
Kubernetes Submit Queue e73d66ce44 Merge pull request #37557 from sttts/sttts-update-ugorji
Automatic merge from submit-queue

Update ugorji/go/codec godep

In order to pick-up https://github.com/ugorji/go/issues/119 and to get rid of the workaround at https://github.com/kubernetes/kubernetes/pull/36909/files#diff-a09eb061a0fb0ef3c9ef9d696f1ad0b4R426.
2017-01-12 02:36:16 -08:00
Janet Kuo a8e92e6f2a Fix bug when printing replicas in Deployment Describer 2017-01-11 17:26:01 -08:00
Dr. Stefan Schimanski 2741eb7fdb Update generated files 2017-01-11 21:54:07 +01:00
juanvallejo 9c7b5c3425 log info on invalid --output-version
Object versions default to the current version (v1) when a specified
`--output-version` is invalid. This patch logs a warning when this is
the case. Cases affected are all commands with the `--output-version`
option, and anywhere runtime objects are converted to versioned objects.

**Example**
```
$ kubectl get pod <mypod> -o json --output-version=invalid
W1013 17:24:16.810278   26719 result.go:238]  info: the output version
specified (invalid) is invalid, defaulting to v1
{
        "kind": "Pod",
            "apiVersion": "v1",
                "metadata": {
                            "name": "mypod",
                                    "namespace": "test",
...
```
2017-01-11 13:12:33 -05:00
Kubernetes Submit Queue 6e5b455b77 Merge pull request #39038 from ncdc/fix-kubectl-get-list
Automatic merge from submit-queue

Fix kubectl get -f <file> -o <nondefault printer> so it prints all items in the file

**What this PR does / why we need it**: Fix kubectl get -f <file> -o <nondefault printer> so it prints all the objects in the file, instead of just the first one. Also add a test for this feature.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

cc @AdoHe @deads2k @liggitt @fabianofranz @kubernetes/kubectl @kubernetes/sig-cli-misc
2017-01-11 09:58:38 -08:00
Andy Goldstein 613ada4cd7 Fix kubectl get -f <file> -o <nondefault printer>
Fix kubectl get -f <file> -o <nondefault printer> so it prints all the
objects in the file, instead of just the first one. Also add a test for
this feature.
2017-01-11 10:30:13 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Kubernetes Submit Queue 3f9f7471af Merge pull request #38989 from sjenning/set-qos-field
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702)

Set PodStatus QOSClass field

This PR continues the work for https://github.com/kubernetes/kubernetes/pull/37968

It converts all local usage of the `qos` package class types to the new API level types (first commit) and sets the pod status QOSClass field in the at pod creation time on the API server in `PrepareForCreate` and in the kubelet in the pod status update path (second commit).  This way the pod QOS class is set even if the pod isn't scheduled yet.

Fixes #33255

@ConnorDoyle @derekwaynecarr @vishh
2017-01-10 22:24:13 -08:00
Kubernetes Submit Queue 748e8f6b1c Merge pull request #39540 from pwittrock/kubectldocs
Automatic merge from submit-queue (batch tested with PRs 39673, 39536, 39617, 39540, 39686)

Improve kubectl help with examples.

```release-note
NONE
```
2017-01-10 20:38:19 -08:00
Kubernetes Submit Queue 4d9bd12cac Merge pull request #39536 from screeley44/add-storage-class
Automatic merge from submit-queue (batch tested with PRs 39673, 39536, 39617, 39540, 39686)

Adding storageclass to resource printers for get pv and pvc

Give ability to see what Storage Class a PV is using, as well as what StorageClass a PVC has requested

```
[root@screeley-sc1 gce]# kubectl get pv
NAME                                       CAPACITY   ACCESSMODES   RECLAIMPOLICY   STATUS      CLAIM                            STORAGECLASS   REASON    AGE
pv-gce                                     2Gi        RWO           Retain          Available                                    anything                 41m
pvc-774217fd-d440-11e6-9d11-42010af00010   2Gi        RWO           Delete          Bound       default/gce-claim-storageclass   slow                     0s

[root@screeley-sc1 gce]# kubectl get pvc
NAME                              STATUS    VOLUME                                     CAPACITY   ACCESSMODES   REQUESTEDSTORAGECLASS   AGE
gce-claim-class1                  Pending                                                                                      		6m
gce-claim-classless               Pending                                                                                      		6m
gce-claim-storageclass            Bound     pvc-774217fd-d440-11e6-9d11-42010af00010   2Gi        RWO           slow           		6m
gce-claim-storageclass-nonexist   Pending                                                                       superfly       		4s
```
@kubernetes/sig-storage
2017-01-10 20:38:15 -08:00
Kubernetes Submit Queue dd544bb950 Merge pull request #37288 from juanvallejo/jvallejo/update-quota-scope-descriptions
Automatic merge from submit-queue (batch tested with PRs 39486, 37288, 39477, 39455, 39542)

Update quota scope descriptions

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

This patch improves the help text descriptions for quota scopes.

@kubernetes/kubectl
2017-01-10 14:33:12 -08:00
Kubernetes Submit Queue 9ef9630976 Merge pull request #39486 from ncdc/allow-missing-keys-in-templates
Automatic merge from submit-queue (batch tested with PRs 39486, 37288, 39477, 39455, 39542)

Allow missing keys in templates by default

Switch to allowing missing keys in jsonpath templates by default.

Add support for allowing/disallowing missing keys in go templates
(default=allow).

Add --allow-missing-template-keys flag to control this behavior (default=true /
allow missing keys).

Fixes #37991

@kubernetes/sig-cli-misc @kubernetes/api-reviewers @smarterclayton @fabianofranz @liggitt @pwittrock
2017-01-10 14:33:10 -08:00
Seth Jennings e2402b781b set qos class field in pod status 2017-01-10 16:31:52 -06:00
juanvallejo cade00e646
do not filter kubectl get pods if -o json or yaml
This patch sets the value of --show-all to true if the output format
specified is 'json' or 'yaml'.
2017-01-10 14:42:38 -05:00
Kubernetes Submit Queue ee177dbbfe Merge pull request #38866 from xingzhou/kube-25579
Automatic merge from submit-queue (batch tested with PRs 37845, 39439, 39514, 39457, 38866)

Add software versions to "kubectl get nodes -o wide" output.

Added "OS-IMAGE" and "KERNEL-VERSION" two columns to
"kubectl get nodes -o wide" output. This will help to provide
more information for user to locate or debug issues. See discussion
in ticket #25579
2017-01-09 13:15:21 -08:00
juanvallejo 134cada45f Update quota scope descriptions 2017-01-09 11:35:54 -05:00
Scott Creeley 79fea8857d Adding storageclass to resource printers 2017-01-09 10:57:28 -05:00
Andy Goldstein 80c5cd8b88 Allow missing keys in templates by default
Switch to allowing missing keys in jsonpath templates by default.

Add support for allowing/disallowing missing keys in go templates
(default=allow).

Add --allow-missing-template-keys flag to control this behavior
(default=true / allow missing keys).
2017-01-09 10:35:46 -05:00
Xing Zhou 5edac7c575 Add software versions to "kubectl get nodes -o wide" output.
Added "OS-IMAGE" and "KERNEL-VERSION" two columns to
"kubectl get nodes -o wide" output. This will help to provide
more information for user to locate or debug issues. See discussion
in ticket #25579
2017-01-09 03:06:28 +00:00
Clayton Coleman c5d755dbec
Refactor tests to match new versioned code structure 2017-01-06 23:45:03 -05:00
Clayton Coleman e5019de260
refactor: Move versioned/watch to meta/v1 2017-01-06 23:45:03 -05:00
Phillip Wittrock dc2fffe5d4 Improve kubectl help with examples. 2017-01-06 13:35:43 -08:00
Kubernetes Submit Queue fd3498483b Merge pull request #38835 from p0lyn0mial/shortcutexpander_take_res_from_hardcoded
Automatic merge from submit-queue

ShortcutExpander has been extended in a way that it will examine a ha…

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

ShortcutExpander has been extended in a way that it will examine a hardcoded list of tuples anticipated from the server when searching for an alternative name for the resource.

Note that the list is ordered and the first match will yield the extended resource's name.

One important thing to highlight is that the ShortcutExpander will fall back to PriorityRestMaper to determine the group for the resource.

Also this PR introduces a new shortcut namely sc which will resolve to storageclasses within storage.k8s.io group


**Special notes for your reviewer**: You might want to see https://github.com/kubernetes/kubernetes/pull/38755

**Release note**:

```release-note
```
2017-01-06 10:36:01 -08:00
Kubernetes Submit Queue 0d93a4c360 Merge pull request #39428 from shiywang/refactor_wideColumns_printer
Automatic merge from submit-queue (batch tested with PRs 39132, 39428)

Move wideHeader [] strings into handlerEntry

To adress this problem: https://github.com/openshift/origin/pull/12354, make `-o wide` more flexible to be used by OpenShift
2017-01-06 09:53:20 -08:00
shiywang 31c4d158af move wideHeader string into handlerEntry
change var name, remove formatWideHeaders()

go fmt
2017-01-06 14:20:50 +08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Kubernetes Submit Queue acc81d6d96 Merge pull request #39291 from xilabao/fix-set-selector
Automatic merge from submit-queue (batch tested with PRs 38766, 39291)

fix kubectl set selector

fix #39290
2017-01-05 03:36:18 -08:00
Kubernetes Submit Queue 51e6c879e7 Merge pull request #39226 from luksa/kubectl_proxy_empty_path
Automatic merge from submit-queue (batch tested with PRs 39311, 39226, 39445)

Make kubectl proxy accept empty path

**What this PR does / why we need it**:
The kubectl proxy previously returned 403 Forbidden: Unauthorized when receiving a request from e.g. "curl localhost:8001" or "curl localhost:8001/".  The previous DefaultPathAcceptRE regex was wrong as it assumed the path in this case would be "/" (but it is actually "").

After someone runs kubectl proxy and tries accessing it with curl, they will probably just try hitting localhost:8001  (which returns an "Unauthorized" response) instead of say localhost:8001/api (which returns a proper response from the API server). Also, whoever previously modified the DefaultPathAcceptRE regex was obviously expecting the regex to accept requests for localhost:8001/

```release-note
fix issue with kubectl proxy so that it will proxy an empty path - e.g. http://localhost:8001
```
2017-01-04 18:25:07 -08:00
Jess Frazelle b5da2d13a6
cleanup dataXXX in /tmp
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:27:06 -08:00
Kubernetes Submit Queue 17f8d82fa3 Merge pull request #39359 from tianshapjq/add-top-specification
Automatic merge from submit-queue

add some specifications on the top command

**What this PR does / why we need it**:
the top command is available when heapster works fine on the server, but the specifications doesn't mention about this. So I added some specifications here.
2017-01-04 08:45:54 -08:00
Kubernetes Submit Queue ee03b9b206 Merge pull request #39400 from xilabao/fix-wrong-help-message-for-taint
Automatic merge from submit-queue (batch tested with PRs 39409, 39400)

fix wrong help message for taint

fix #39381
2017-01-04 08:03:10 -08:00
Kubernetes Submit Queue 819535b96a Merge pull request #36245 from fraenkel/env_configmap
Automatic merge from submit-queue (batch tested with PRs 38433, 36245)

Allow pods to define multiple environment variables from a whole ConfigMap

Allow environment variables to be populated from ConfigMaps

- ConfigMaps represent an entire set of EnvVars
- EnvVars can override ConfigMaps


fixes #26299
2017-01-03 23:28:09 -08:00
xilabao a8b15492b4 fix wrong help message for taint 2017-01-04 11:14:25 +08:00
xilabao 78a0fb1e5a fix kubectl set selector 2017-01-04 10:34:24 +08:00
tianshapjq 2c2dba67fd modify the specifications 2017-01-04 09:12:24 +08:00
Kubernetes Submit Queue 34ea3a17af Merge pull request #39001 from xilabao/fix-group-in-create-clusterrolebinding
Automatic merge from submit-queue

fix group in create clusterrolebinding

group lost.

```
#kubectl create clusterrolebinding test --clusterrole=a --group=b
clusterrolebinding "test" created

#kubectl get clusterrolebinding test -o yaml
apiVersion: rbac.authorization.k8s.io/v1alpha1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: 2016-12-20T03:13:24Z
  name: test
  resourceVersion: "284"
  selfLink: /apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindingstest
  uid: 44d3476d-c662-11e6-a439-7427ea6f0fe3
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: a
subjects: null
```
2017-01-03 16:49:24 -08:00
Kubernetes Submit Queue 3951ae4e1d Merge pull request #38112 from juanvallejo/jvallejo/add-output-format-support-kubectl-create
Automatic merge from submit-queue

Add json,yaml output format support to kubectl create, kubectl apply

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

**Release note**:
```release-note
Added support for printing in all supported `--output` formats to `kubectl create ...` and `kubectl apply ...`
```

This patch adds the ability to specify an output format other than
"name" to `kubectl create ...`. It can be used in conjunction with the
`--dry-run` option. Converts unstructured objects into known types in
order to support all `--output` values.

The patch prints `*resource.Info`s returned by the server. If a resource does not yet exist (and the `--dry-run` option is not set), the resource is created and printed in the specified format.

@kubernetes/cli-review @fabianofranz
2017-01-03 14:18:33 -08:00
Kubernetes Submit Queue 2a89179046 Merge pull request #39070 from shiywang/remove_unused_param
Automatic merge from submit-queue (batch tested with PRs 39022, 39331, 39070, 39344)

remove unused parameter
2017-01-03 10:32:22 -08:00
Kubernetes Submit Queue 7a9dddbbfc Merge pull request #39126 from xilabao/update-prompt-in-create-rolebinding/clusterrolebinding
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

update prompt in create rolebinding/clusterrolebinding
2017-01-03 09:45:20 -08:00
Michael Fraenkel 2d803afc98 ConfigMaps populate environment variables 2017-01-03 11:02:15 -05:00
Kubernetes Submit Queue cfc3c4b9aa Merge pull request #39150 from kargakis/ignore-deleted-pods-in-rolling-updater
Automatic merge from submit-queue

kubectl: ignore deleted pods in the rolling updater

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

The Deployment controller already ignores deleted pods or more precisely the ReplicaSet controller ignores deleted pods ([pod classification](a30b6e2d16/pkg/controller/replicaset/replica_set.go (L600)) ignores [deleted pods](a30b6e2d16/pkg/controller/controller_ref_manager.go (L63))) and the Deployment controller reuses what's in the ReplicaSet status.

@kubernetes/sig-apps-misc @kubernetes/sig-cli-misc
2017-01-02 07:34:19 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Kubernetes Submit Queue 897c48e75f Merge pull request #39053 from tanshanshan/fix-help2
Automatic merge from submit-queue (batch tested with PRs 39053, 36446)

fix --no-header help description

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

the current description is
>  --no-headers=false: When using the default or custom-column output format, don't print headers.

but ,

>  kubectl get po

 the header has been printing , so  the default condition is printing headers.

> kubectl get po --no-headers=true

 the header  has been not printing

> kubectl get po --no-headers=false

 the header  has been printing

So , I  fixed the help description

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2016-12-28 19:07:04 -08:00
tianshapjq a153f6f885 add some specifications on the top command 2016-12-29 08:44:45 +08:00
Kubernetes Submit Queue 3a2492f4d6 Merge pull request #39218 from luksa/kubectl_top_short_forms
Automatic merge from submit-queue

Kubectl top now also accepts short forms for "node" and "pod" ("no", "po")

**What this PR does / why we need it**:
People are used to typing `kubectl get po` and will expect `kubectl top po` to also work (without having to type the full resource name).
2016-12-28 15:47:11 -08:00
Xing Zhou 4fcc770367 Add three more columns to `kubectl get deploy -o wide` output.
Added CONTAINER(S), IMAGE(S) and SELECTOR fields to the output
of `kubectl get deploy -o wide`.
2016-12-28 03:07:13 +00:00
Kubernetes Submit Queue 9ce8f10a4d Merge pull request #39172 from foxish/fix-help
Automatic merge from submit-queue

Add PDB to kubectl get --help.

**What this PR does / why we need it**: Adds PDB to kubectl get --help

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: Fixes https://github.com/kubernetes/kubernetes/issues/39100

**Release note**:

```release-note
NONE
```

/cc @saad-ali @mwielgus
2016-12-27 13:19:36 -08:00
Marko Luksa c0aa2767aa Make kubectl proxy accept empty path
The proxy previously returned 403 Forbidden: Unauthorized when receiving a request from e.g. "curl localhost:8001" or "curl localhost:8001/".  The previous DefaultPathAcceptRE regex was wrong as it assumed the path in this case would be "/" (but it is actually "").
2016-12-25 18:31:55 +01:00
andrewsykim b8311ec7f9 kubectl get hpa should how current replicas 2016-12-24 23:30:39 -05:00
Kubernetes Submit Queue 1ee7163308 Merge pull request #36802 from brendandburns/i18n
Automatic merge from submit-queue

Begin paths for internationalization in kubectl

This is just the first step, purposely simple so we can get the interface correct.

@kubernetes/sig-cli @deads2k
2016-12-24 13:09:12 -08:00
Marko Luksa 764e8bd6c6 Kubectl top now also accepts short forms for "node" and "pod" ("no" and "po") 2016-12-24 17:25:08 +01:00
Brendan Burns 277306449b Add initial translation support. 2016-12-23 20:45:52 -08:00
Kubernetes Submit Queue b3fb6cb5fb Merge pull request #35191 from SamiHiltunen/commas-in-secrets
Automatic merge from submit-queue

kubectl: commas in --from-literal on secret creation

Closes #35185

``` release-note
Fixes an issue where commas were not accepted in --from-literal flags when creating secrets. Passing multiple values separated by a comma in a single --from-literal flag is no longer supported. Please use multiple --from-literal flags to provide multiple values.
```
2016-12-23 08:04:50 -08:00
Kubernetes Submit Queue 5f0ece92de Merge pull request #39008 from brendandburns/unicode
Automatic merge from submit-queue

Support loading UTF16 files if a byte-order-mark is present

Add support in kubectl for loading UTF16 encoded files if they have a correct BOM (Byte-Order-Mark https://en.wikipedia.org/wiki/Byte_order_mark) at the beginning
of the file. Falls back on UTF8 encoding, if no understandable BOM is present.

Fixes part of https://github.com/kubernetes/kubernetes/issues/39007

@fabianofranz @deads2k @kubernetes/sig-cli-misc
2016-12-22 22:11:13 -08:00
Mayank Kumar 777977612b ReplicaSet has owner ref of the Deployment that created it 2016-12-22 16:45:50 -08:00
Anirudh 7f0bcb3688 Add PDB to kubectl get --help. 2016-12-22 14:47:11 -08:00
p0lyn0mial ad688d7761 ShortcutExpander has been extended in a way that it will examine a hardcoded list of tuples anticipated from the server when
searching for an alternative name for the resource. Note that the list is ordered and the first match will yield the extended resource's name.

One important thing to highlight is that the ShortcutExpander will fall back to PriorityRestMaper to determine the group for
the resource. Also this PR introduces a new shortcut namely sc which will resolve to storageclasses within storage.k8s.io group

In addition the type of kubectl.ShortForms has been changed to ResourceShortcuts struct. It has got a brand new name,
it was also extended and ordered by group.
2016-12-22 17:29:52 +01:00
Michail Kargakis 3ee150fcc0 kubectl: ignore deleted pods in the rolling updater 2016-12-22 14:26:17 +01:00
xilabao 528a8d7d52 update prompt in create rolebinding/clusterrolebinding 2016-12-22 11:33:49 +08:00
xilabao 6b19a711ec fix group in create clusterrolebinding 2016-12-22 10:14:11 +08:00
tanshanshan 565a53871d fix help 2016-12-22 09:48:24 +08:00
Brendan Burns 8e561d9ae7 Add support for loading utf16 files. 2016-12-21 14:57:26 -08:00
deads2k 8b25c21e79 add create rolebinding 2016-12-21 09:03:27 -05:00
Angus Salkeld 17a711d8fd Add new command "kubectl set selector" 2016-12-21 12:30:56 +01:00
Shiyang Wang 9d037a0ab6 remove unused parameter 2016-12-21 16:09:51 +08:00
Kubernetes Submit Queue 52df372f9b Merge pull request #35805 from dgoodwin/token-mgmt
Automatic merge from submit-queue

Implement kubeadm bootstrap token management

Creates bootstrap tokens as secrets per the specification in #30707 

_WARNING_: These are not currently hooked up to the discovery service or the token it creates.

Still TODO:
- [x] delete tokens
- [x] merge with #35144 and adopt it's testing approach
- [x] determine if we want wholesale json output & templating like kubectl (we do not have an API object with the data we want here) may require a bit of plumbing.
- [x] allow specifying a token duration on the CLI
- [x] allow configuring the default token duration
- [x] hook up the initial token created during init

Sample output:

```
(root@centos1 ~) $ kubeadm token create
Running pre-flight checks
<cmd/token> Token secret created: f6dc69.c43e491752c4a0fd
(root@centos1 ~) $ kubeadm token create
Running pre-flight checks
<cmd/token> Token secret created: 8fad2f.e7b78c8a5f7c7b9a
(root@centos1 ~) $ kubeadm token list  
Running pre-flight checks
ID        TOKEN                     EXPIRATION
44d805    44d805.a4e78b6cf6435e33   23h
4f65bb    4f65bb.d006a3c7a0e428c9   23h
6a086e    6a086e.2ff99f0823236b5b   23h
8fad2f    8fad2f.e7b78c8a5f7c7b9a   23h
f6dc69    f6dc69.c43e491752c4a0fd   23h
f81653    f81653.9ab82a2926c7e985   23h
```
2016-12-20 14:44:40 -08:00
Kubernetes Submit Queue cc215202f2 Merge pull request #38929 from soltysh/cronjob_gen_test
Automatic merge from submit-queue

Add test for CronJob generator

Per @janetkuo request this was split from #38614, it adds test for `CronJob` generator, and additionally copy labels to `JobTemplate`, to be consistent with how `Job` generator works.
2016-12-20 14:04:20 -08:00
Devan Goodwin bfe345dd86 Implement kubeadm bootstrap token management.
Adds kubeadm subcommands to create, list, and delete bootstrap tokens.
Tokens can be created with a TTL duration, or 0 for tokens that will not
expire. The create command can also be used to specify your own token
(for use when bootstrapping masters and nodes in parallel), or update an
existing token's secret or ttl.

Marked "ex" for experimental for now as the boostrap controllers are not
yet hooked up in core.
2016-12-20 11:43:55 -04:00
Maciej Szulik 4855ae2e84 Add test for CronJob generator 2016-12-20 10:00:00 +01:00
Kubernetes Submit Queue 874fca652d Merge pull request #38086 from tianshapjq/reduce-decode-times
Automatic merge from submit-queue

Reduce decode times by changing the kubectl.Filter(runtime.Object, *PrintOptions)'s return values

**What this PR does / why we need it**:
In kubectl/cmd/get.go, we use the function filterFuncs.Filter() to decode data and filter the object. But in the following function printer.PrintObj() decodes the data again.
I made these modifications to reduce the decoding times by changing the filterFuncs.Filter()'s returned values. We can get the decoded object from this function and pass it to the following printer.PrintObj(), so not to waste time to decode again.
2016-12-19 16:23:02 -08:00
Denis Andrejew e8fa6cddfd fix typo in describe.go 2016-12-19 20:27:14 +00:00
Kubernetes Submit Queue d6046aab0e Merge pull request #38903 from deads2k/cli-16-fix-generic-create
Automatic merge from submit-queue (batch tested with PRs 38080, 38903)

prevent negotation on connections that dont' require it

Not all clientconfigs require negotiation.  Before there was a patch (hardcoded to an instance variable) that allowed this.  This updates the code to allow the same as before.

@kubernetes/sig-cli @fabianofranz

@ncdc you'll want to pick
2016-12-19 07:42:45 -08:00
Maciej Szulik cdec94523e Remove extensions/v1beta1 Job - generated changes 2016-12-17 00:07:25 +01:00
Maciej Szulik 9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
deads2k 9b507e8603 prevent negotation on connections that dont' require it 2016-12-16 16:26:55 -05:00
Robert Rati 91931c138e [scheduling] Moved node affinity from annotations to api fields. #35518 2016-12-16 11:42:43 -05:00
Kubernetes Submit Queue 0d80ee0b8d Merge pull request #38767 from kargakis/fix-setting-container-name-in-create-deployment
Automatic merge from submit-queue

kubectl: fix 'create deployment' to set container name correctly

@kubernetes/kubectl @kubernetes/sig-cli
2016-12-16 04:38:22 -08:00
Kubernetes Submit Queue e2a9fc1022 Merge pull request #38841 from mikedanese/fix-tests
Automatic merge from submit-queue

bazel: fix some unit tests
2016-12-15 20:19:46 -08:00
Mike Danese 8fdec87d19 bazel: fix some unit tests 2016-12-15 18:36:22 -08:00
tianshapjq 1453cd6264 reduce decoding times by changing kubectl.Filter(runtime.Object, *PrintOptions)'s return value 2016-12-16 09:37:11 +08:00
deads2k 50f6733800 make kubectl factory rings 2016-12-15 15:18:16 -05:00
Kubernetes Submit Queue db867c0c9d Merge pull request #36396 from aveshagarwal/master-display-pod-node-selectors
Automatic merge from submit-queue (batch tested with PRs 38783, 36396)

Display pod node selectors with kubectl describe.

**What this PR does / why we need it**:
This PR fixes kubectl describe so that it now shows associated node selectors with pods.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

@kubernetes/rh-cluster-infra @kubernetes/kubectl
2016-12-14 17:54:52 -08:00
Kubernetes Submit Queue d8efc779ed Merge pull request #38154 from caesarxuchao/rename-release_1_5
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Rename "release_1_5" clientset to just "clientset"

We used to keep multiple releases in the main repo. Now that [client-go](https://github.com/kubernetes/client-go) does the versioning, there is no need to keep releases in the main repo. This PR renames the "release_1_5" clientset to just "clientset", clientset development will be done in this directory.

@kubernetes/sig-api-machinery @deads2k 

```release-note
The main repository does not keep multiple releases of clientsets anymore. Please find previous releases at https://github.com/kubernetes/client-go
```
2016-12-14 14:21:51 -08:00
Chao Xu 6709b7ada2 run hack/update-codegen.sh
run hack/verify-gofmt.sh
update bazel
2016-12-14 12:39:49 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Derek Carr f1af1e965a Fix typo in drain command 2016-12-14 13:00:25 -05:00
Michail Kargakis bf78c00a96 kubectl: fix 'create deployment' to set container name correctly 2016-12-14 17:32:33 +01:00
Kubernetes Submit Queue 7b8ecda289 Merge pull request #38743 from caesarxuchao/remove
Automatic merge from submit-queue

Remove accidentally committed files

Accidentally committed in #37534.
2016-12-13 20:44:16 -08:00
Chao Xu 411128f294 remove wrongly committed files 2016-12-13 19:44:51 -08:00
Kubernetes Submit Queue 085f0d74dc Merge pull request #38538 from juanvallejo/jvallejo/dont-report-success-if-obj-not-patched
Automatic merge from submit-queue

Prevent "patched" output on obj not patched

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

This patch compares an original object against a patched object returned
from the server and only announces that the object was successfully
patched if the object returned from the server does not equal the
original object.

@fabianofranz @kubernetes/cli-review
2016-12-13 10:42:26 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
juanvallejo cbe479039b Add json,yaml output format support kubectl create
This patch adds the ability to specify an output format other than
"name" to `kubectl create ...`. It can be used in conjunction with the
`--dry-run` option. Converts unstructured objects into known types in
order to support all `--output` values.
2016-12-12 16:09:12 -05:00
Kubernetes Submit Queue 0ac73a823a Merge pull request #34966 from ivan4th/make-top-pod-test-table-driven
Automatic merge from submit-queue (batch tested with PRs 38453, 36672, 38629, 34966, 38630)

Make kubectl top pod test table-driven
2016-12-12 11:41:10 -08:00
Kubernetes Submit Queue 3d29c3d229 Merge pull request #36672 from ymqytw/check_annotation_for_apply
Automatic merge from submit-queue (batch tested with PRs 38453, 36672, 38629, 34966, 38630)

Warn user if they try to apply on an object without the annotation

Give user a warning when using `kubectl apply` on a resource lacking the `LastAppliedConfig` annotation

fixes #36620

Ref: #35134 and #36509.

**Release note**:
```release-note
Issue a warning when using `kubectl apply` on a resource lacking the `LastAppliedConfig` annotation
```
2016-12-12 11:41:06 -08:00
Ivan Shvedunov 9b9c1e6952 Make top pod test table-driven 2016-12-12 20:23:17 +03:00
Clayton Coleman 42e0eda3e4
Sorting printer changed 2016-12-10 18:07:33 -05:00
Clayton Coleman c52d510a24
refactor: generated 2016-12-10 18:05:53 -05:00
Clayton Coleman 42d410fdde
Switch to use pkg/apis/meta/v1/unstructured and the new interfaces
Avoid directly accessing an unstructured type if it is not required.
2016-12-10 18:05:28 -05:00
Kubernetes Submit Queue e732ee70f4 Merge pull request #38406 from liggitt/remove-internal-json-annotations
Automatic merge from submit-queue

Remove json serialization annotations from internal types

fixes #3933

Internal types should never be serialized, and including json serialization tags on them makes it possible to accidentally do that without realizing it.

fixes in this PR:

* types
  * [x] remove json tags from internal types
  * [x] fix references from serialized types to internal ObjectMeta
* generation
  * [x] remove generated json codecs for internal types (they should never be used)
* kubectl
  * [x] fix `apply` to operate on versioned object
  * [x] fix sorting by field to operate on versioned object
  * [x] fix `--record` to build annotation patch using versioned object
* hpa
  * [x] fix unmarshaling to internal CustomMetricTargetList in validation
* thirdpartyresources
  * [x] fix encoding API responses using internal ObjectMeta
* tests
  * [x] fix tests to use versioned objects when checking encoded content
  * [x] fix tests passing internal objects to generic printers

follow ups (will open tracking issues or additional PRs):
- [ ] remove json tags from internal kubeconfig types (`kubectl config set` pathfinding needs to work against external type)
- [ ] HPA should version CustomMetricTargetList serialization in annotations
- [ ] revisit how TPR resthandlers encoding objects
- [ ] audit and add tests for printer use (human-readable printer requires internal versions, generic printers require external versions)
- [ ] add static analysis tests preventing new internal types from adding tags
- [ ] add static analysis tests requiring json tags on external types (and enforcing lower-case first letter)
- [ ] add more tests for `kubectl get` exercising known and unknown types with all output options
2016-12-10 14:00:17 -08:00
ymqytw b6cfa9aa98 warn user if they try to apply on an object without the annotation 2016-12-09 17:29:31 -08:00
juanvallejo 7410acf4ab
Prevent "patched" output on obj not patched
This patch compares an original object against a patched object returned
from the server and only announces that the object was successfully
patched if the object returned from the server does not equal the
original object.
2016-12-09 19:01:27 -05:00
Kubernetes Submit Queue 68b17c2942 Merge pull request #37270 from xilabao/remove-duplicate-get-errs
Automatic merge from submit-queue (batch tested with PRs 37270, 38309, 37568, 34554)

Remove duplicate get errs

old:
```shell
$ kubectl get ns
NAME          STATUS    AGE
default       Active    2m
kube-system   Active    2m

$ kubectl get ns --all-namespaces
NAMESPACE   NAME      STATUS    AGE
error: namespace is not namespaced
error: namespace is not namespaced
```
new:
```shell
$ kubectl get ns --all-namespaces
NAMESPACE   NAME      STATUS    AGE
error: namespace is not namespaced
```
2016-12-09 14:11:14 -08:00
Jordan Liggitt 4536388909
Update bazel 2016-12-09 16:26:06 -05:00
Jordan Liggitt 2d868441d8
Make sorting work on versioned objects 2016-12-09 16:26:06 -05:00
Jordan Liggitt 8b34e0ed53
Make --record compute patch using versioned object 2016-12-09 16:26:05 -05:00
Jordan Liggitt 12806be2bf
Fix tests using internal types for generic printing 2016-12-09 16:26:05 -05:00
Jordan Liggitt cc7a44f545
Fix tests using internal types for serialization 2016-12-09 16:26:05 -05:00
Jordan Liggitt 3654d63766
Compute apply patch using versioned object 2016-12-09 16:26:04 -05:00
Jordan Liggitt fcf5bbccd6
Fix references from serializable types to use v1.ObjectMeta 2016-12-09 16:26:04 -05:00
Kubernetes Submit Queue b9536688d3 Merge pull request #38429 from duglin/removeDelete
Automatic merge from submit-queue (batch tested with PRs 37860, 38429, 38451, 36050, 38463)

Remove "pod xxx deleted" message from kubectl run --rm

This is a follow-on to https://github.com/kubernetes/kubernetes/issues/28695

Its unnecessary to print the message when the user asked for it.
We should only show a msg (error) when we didn't do what they asked.
Also showing this in a "kubectl run" is bad because it then
gets appended to the user's output and they would then have to strip
it off if they want to use the output in some follow-on processing.

Signed-off-by: Doug Davis <dug@us.ibm.com>

```release-note
kubectl run --rm no longer prints "pod xxx deleted"
```
2016-12-09 13:22:14 -08:00
Kubernetes Submit Queue 7168fce59a Merge pull request #38265 from brendandburns/configmap
Automatic merge from submit-queue (batch tested with PRs 38284, 38403, 38265)

Display config map data, not byte count.

Begins to address https://github.com/kubernetes/kubernetes/issues/36222

Next step is:
`kubectl edit configmap <name> --key=<file-name>`

@kubernetes/sig-cli
2016-12-09 08:50:23 -08:00
Kubernetes Submit Queue 35d6d902e8 Merge pull request #38403 from deads2k/fix-local-up-dns
Automatic merge from submit-queue (batch tested with PRs 38284, 38403, 38265)

Fix local up cluster dns with RBAC

The DNS server needs permissions to run using RBAC.  This does it with a big hammer before we sort out tight permissions.

@fabianofranz for the CLI change
@xilabao for the local-up-cluster change
2016-12-09 08:50:21 -08:00
Kubernetes Submit Queue aae1b14592 Merge pull request #33083 from mfojtik/resolve-image
Automatic merge from submit-queue

Add ResolveImage function to CLI factory

This functions helps to integrate third-party mechanism for resolving the image names. For example, this function can be used in OpenShift to add support for resolving the ImageStreamTag and ImageStreamImage.

See: https://github.com/openshift/origin/pull/10995
2016-12-09 05:26:52 -08:00
Michal Fojtik 737b32772e add ResolveImage function to CLI factory 2016-12-09 12:41:38 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Kubernetes Submit Queue 5628cde1bd Merge pull request #37164 from duglin/removeWaiting
Automatic merge from submit-queue (batch tested with PRs 38413, 37164)

Remove chatty "waiting for pod" msg from kubectl run

Attacking #28695 one step at a time

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-08 18:08:55 -08:00
Doug Davis 24fbba393e Remove "pod xxx deleted" message from kubectl run --rm
Its unnecessary to print the message when the user asked for it.
We should only show a msg (error) when we didn't do what they asked.
Also showing this in a "kubectl run" is bad because it then
gets appended to the user's output and they would then have to strip
it off if they want to use the output in some follow-on processing.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-08 17:40:08 -08:00
Kubernetes Submit Queue b0b6f3c256 Merge pull request #38401 from liggitt/addressable-deep-copy
Automatic merge from submit-queue (batch tested with PRs 36071, 32752, 37998, 38350, 38401)

Pass addressable values to DeepCopy

Extracted from https://github.com/kubernetes/kubernetes/pull/35728

These are the places we are currently calling DeepCopy incorrectly, and we need to fix, even if we don't pick up the changes to DeepCopy in #35728:
* creating a new cloner means we have no generated functions registered
* passing non-addressable values doesn't pick up generated deep copy functions, and forces us into reflective mode
2016-12-08 16:26:00 -08:00
Kubernetes Submit Queue e3b9546028 Merge pull request #32752 from fraenkel/logs_selector
Automatic merge from submit-queue (batch tested with PRs 36071, 32752, 37998, 38350, 38401)

Allow a selector when retrieving logs

#19873

initial commit to see if I am headed in the right direction.
Its missing all the test cases, but the selector path works.
2016-12-08 16:25:54 -08:00
Kubernetes Submit Queue 76e0b1af54 Merge pull request #36071 from juanvallejo/jvallejo/fix-set-image-local-output
Automatic merge from submit-queue

fix local resource output when `-f` not specified

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

`kubectl set image` does not have a `--dry-run` option. Although it offers a
`--local` flag, it does not support server request, limiting input to that of stdin
or that of a local file.

This patch adds a `--dry-run` option to the `kubectl set image` command,
allowing for resources from the server to be selected, without making any
mutations.

cc @ncdc 

Related PR: https://github.com/kubernetes/kubernetes/pull/36174
2016-12-08 16:20:00 -08:00
juanvallejo 6eaab223f2 add --dry-run opt to `kubectl set image`
This patch adds a `--dry-run` option to `kubectl set image...`
2016-12-08 15:50:52 -05:00
deads2k b18e433590 add serviceaccount option to clusterrrolebinding 2016-12-08 14:18:39 -05:00
Jordan Liggitt 6819706adf
Pass addressable values to DeepCopy 2016-12-08 14:16:01 -05:00
Kubernetes Submit Queue b650149ee1 Merge pull request #37096 from andor-pierdelacabeza/patch-1
Automatic merge from submit-queue (batch tested with PRs 38260, 32811, 28458, 33570, 37096)

Fix renaming order shown on terminal
2016-12-08 02:11:26 -08:00
Kubernetes Submit Queue fa5556b92b Merge pull request #32811 from fraenkel/headless_service
Automatic merge from submit-queue (batch tested with PRs 38260, 32811, 28458, 33570, 37096)

Allow no ports when exposing headless service

fixes #32795
2016-12-08 02:11:20 -08:00
Kubernetes Submit Queue f8dd91fb28 Merge pull request #36541 from juanvallejo/jvallejo/remove-duplicate-describer-errs
Automatic merge from submit-queue (batch tested with PRs 36626, 37294, 37463, 37943, 36541)

Remove duplicate describer errs

Downstream issue https://github.com/openshift/origin/issues/11846

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

The `describe` command iterates through a list of infos received from
the server and aggregates a list of errors while attempting to call each
resource's respective describer. When a resource exists, but does not
have a describer set, such as `Event`, the `describe` command outputs
the same error `error: no description has been implemented for "Event"`
for each info.

```
$ kubectl describe events
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
```

@kubernetes/kubectl @fabianofranz
2016-12-08 00:23:16 -08:00
Kubernetes Submit Queue c323c72a66 Merge pull request #37943 from ailusazh/ailusa
Automatic merge from submit-queue (batch tested with PRs 36626, 37294, 37463, 37943, 36541)

Add Version to the resource printer for 'get nodes'

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

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

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-08 00:23:15 -08:00
Kubernetes Submit Queue 910912ea3b Merge pull request #37364 from foxyriver/status-code
Automatic merge from submit-queue

use status code const to express http status

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

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

Using status code const to express http status.

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-07 22:47:46 -08:00
Avesh Agarwal 588ad30d10 Display pod node selectors with kubectl describe. 2016-12-08 01:28:40 -05:00
xilabao 0dc166a9fa Remove duplicate get errs 2016-12-08 13:56:56 +08:00
deads2k b658552947 remove validation dependency on version negotiation 2016-12-07 13:23:20 -05:00
Kubernetes Submit Queue ce93c81029 Merge pull request #38092 from xilabao/fix-alias-conflict
Automatic merge from submit-queue (batch tested with PRs 35101, 38215, 38092)

fix alias conflict of clusterrolebinding

create_configmap alias is "cm"
2016-12-07 07:27:17 -08:00
Kubernetes Submit Queue 490151ee50 Merge pull request #38181 from tanshanshan/remove-todo
Automatic merge from submit-queue (batch tested with PRs 38181, 38128, 36711)

Remove redundant conditional statement

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

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

1. remove redundant conditional statement
2. replace  errors.New(fmt.Sprintf with fmt.Errorf 

Thanks.

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-07 03:09:30 -08:00
Kubernetes Submit Queue 36d593c749 Merge pull request #38085 from yarntime/fix_typo_in_scale
Automatic merge from submit-queue (batch tested with PRs 37693, 38085)

fix typo in scale

fix typo.
2016-12-07 00:52:29 -08:00
Brendan Burns 670b21e11c Display config map data, not byte count. 2016-12-06 22:36:40 -08:00
tanshanshan c76cd49da1 remove redundant condition 2016-12-07 08:39:40 +08:00
Mike Danese e225625a80 add a configuration for kubelet to register as a node with taints
and deprecate register-schedulable
2016-12-06 10:32:54 -08:00
Kubernetes Submit Queue e4abc36d5d Merge pull request #37636 from juanvallejo/jvallejo/bugfix/print-resource-kind-when-single-resource-type
Automatic merge from submit-queue

add resource prefix to multiple items w/ same kind

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

This patch ensures that a resource prefix is added to multiple items of
the same kind, when using `kubectl get all`. Before, a prefix was added only
when a single item was returned on `kubectl get all`, but ignored if only a
single resource kind existed but multiple items for that kind were
returned.

**Example**
```
$ kubectl get all
No resources found.

$ kubectl create service loadbalancer testsvc1 --tcp=8080
$ kubectl get all
NAME               CLUSTER-IP       EXTERNAL-IP                     PORT(S)    AGE
svc/testsvc1       172.30.119.220   172.46.100.155,172.46.100.155   8080/TCP   1h

$ kubectl create service loadbalancer testsvc2 --tcp=8081
$ kubectl get all
NAME               CLUSTER-IP       EXTERNAL-IP                     PORT(S)    AGE
svc/testsvc1       172.30.119.220   172.46.100.155,172.46.100.155   8080/TCP   1h
svc/testsvc2       172.30.241.197   172.46.164.158,172.46.164.158   8081/TCP   1h
```

@fabianofranz
2016-12-06 07:43:07 -08:00
Kubernetes Submit Queue 653fd97ba0 Merge pull request #37966 from p0lyn0mial/unify_restmapping_and_restmappings
Automatic merge from submit-queue (batch tested with PRs 38185, 37966)

decided to extract common logic for RESTMapping and RESTMappings to a…

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

**What this PR does / why we need it**: the changes introduced in this PR extract common logic of RESTMapping and RESTMappings to one common method. 

**Special notes for your reviewer**: this is my first PR - be polite.



The only change in logic to what was before is when calling commonRESTMappings from RESTMapping
we search all defaultGroupVersion as opposed to just one when no mapping was found for provided versions.
2016-12-06 06:49:25 -08:00
tianshapjq 55521ee8be remove the create-external-load-balancer flag in cmd/expose.go 2016-12-06 16:48:32 +08:00
xilabao ff09a68079 fix alias conflict of clusterrolebinding 2016-12-06 09:13:42 +08:00
p0lyn0mial 5f8e774517 extended RESTMappings method by a version parameter.
RESTMapping method can now rely on RESTMappings by passing versions parameter and taking the first match found by RESTMappings method. In addition
a UT that test the new method has been added.

The only change in logic to what was before is when calling RESTMapping
we search all defaultGroupVersion as opposed to just one when no mapping was found for provided versions.
2016-12-05 20:09:36 +01:00
Kubernetes Submit Queue 1552edbf0c Merge pull request #37366 from xilabao/extend-cmd-valid-resources-information
Automatic merge from submit-queue (batch tested with PRs 37366, 36373)

extend cmd valid resources information about roles
2016-12-05 08:13:40 -08:00
Dr. Stefan Schimanski 2dff13f332 Update generated files 2016-12-05 12:42:31 +01:00
Dr. Stefan Schimanski 458d2b2fe4 Add verb support for discovery client 2016-12-05 12:36:05 +01:00
Kubernetes Submit Queue 433c6bede3 Merge pull request #37066 from xilabao/update-label-filter-prompt
Automatic merge from submit-queue

update label filter prompt

I have to look up the meaning of selector in docs/user-guide/labels.md.  I think  we could print more info when run "--help".
2016-12-04 22:26:13 -08:00
yarntime@163.com 17e91695f9 fix typo 2016-12-05 14:23:07 +08:00
xilabao b95dcfb424 update label filter prompt 2016-12-05 11:03:21 +08:00
Kubernetes Submit Queue 81177226a8 Merge pull request #37679 from zdj6373/proxy-accept
Automatic merge from submit-queue

Code optimization

Accept function, the same sentence information repeated three times, under the optimization, recorded in the call function
2016-12-04 17:16:08 -08:00
Kubernetes Submit Queue 513893c96e Merge pull request #37789 from yarntime/check_min_max
Automatic merge from submit-queue

check the value of min and max in kubectl

check the value of min and max in kubectl.
2016-12-04 16:39:24 -08:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Kubernetes Submit Queue 12801e8bbb Merge pull request #37649 from smarterclayton/top_node
Automatic merge from submit-queue

kubectl top pod|node should handle when Heapster is somewhere else

OpenShift runs Heapster on HTTPS, which means `top node` and `top pod`
are broken because they hardcode 'http' as the scheme. Provide an
options struct allowing users to specify `--heapster-namespace`,
`--heapster-service`, `--heapster-scheme`, and `--heapster-port` to the
commands (leveraging the existing defaults).

@kubernetes/sig-metrics makes top a little more useful in other spots
2016-12-03 15:04:14 -08:00
Kubernetes Submit Queue db323e9885 Merge pull request #36646 from kargakis/create-pdb-subcommand
Automatic merge from submit-queue (batch tested with PRs 38049, 37823, 38000, 36646)

kubectl: add create pdb subcommand

@mwielgus @mml @kubernetes/kubectl

```release-note
Add kubectl create poddisruptionbudget command
```
2016-12-03 14:20:54 -08:00
Kubernetes Submit Queue 91d8c41147 Merge pull request #36732 from oulinbao/refactor_describe_containers
Automatic merge from submit-queue

Refactor describe.go with PrefixWriter

**What this PR does / why we need it**:
 refactor describeContainers function and decrease gocyclo result

**Special notes for your reviewer**:
the new PR for 36032
https://github.com/kubernetes/kubernetes/pull/36032

**Release note**:
```release-note
```NONE
2016-12-03 01:28:11 -08:00
Kubernetes Submit Queue 39e63e3e53 Merge pull request #37608 from tianshapjq/modify-get-help
Automatic merge from submit-queue (batch tested with PRs 37608, 37103, 37320, 37607, 37678)

add some help info about the 'all' arg

**What this PR does / why we need it**:
There is an arg named "all" in the get command, we can use it like "kubectl get all". But we can get nothing about this arg in the help description. Users may not know how to use it without looking into the source code. So here I'm going to add some description about this arg.

**Which issue this PR fixes** 
We discussed about this in 
In pkg/kubectl/cmd/get.go there is a confused arg named "all" [#37533](https://github.com/kubernetes/kubernetes/issues/37533)
2016-12-02 23:32:44 -08:00
juanvallejo 3484c6f676 add resource prefix to multiple items w/ same kind
This patch ensures that a resource prefix is added to multiple items of
the same kind, when using `oc get all`. Before, a prefix was added only
when a single item was returned on `oc get all`, but ignored if only a
single resource kind existed but multiple items for that kind were
returned.
2016-12-02 15:14:44 -05:00
Michail Kargakis b8fab92600 kubectl: generated changes for new pdb command 2016-12-02 18:42:25 +01:00
Michail Kargakis 065b652961 kubectl: add create pdb subcommand 2016-12-02 18:42:25 +01:00
Michail Kargakis 86c515ebc3 kubectl: set alias for poddisruptionbudget 2016-12-02 18:39:55 +01:00
Kubernetes Submit Queue 74066816b6 Merge pull request #37098 from deads2k/cli-12-create-cbinding
Automatic merge from submit-queue

add create clusterrolebinding command

Adds `kubectl create clusterrolebinding`.

@kubernetes/sig-cli
2016-12-02 08:44:58 -08:00
Kubernetes Submit Queue bbd447f555 Merge pull request #34789 from AdoHe/external_service
Automatic merge from submit-queue

create service add create ExternalName service implementation

@kubernetes/kubectl create service add ExternalName support, refer #34731 for more detail.

```release-note
kubectl create service externalname
```
2016-12-02 07:29:06 -08:00
ailusazh f98c2fbbcf Add Version to the resource printer for 'get nodes' 2016-12-02 13:06:23 +00:00
Doug Davis c5387eebe4 Remove chatty "waiting for pod" msg from kubectl run
Attacking #28695 one step at a time

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-01 17:46:04 -08:00
Clayton Coleman 3d237cac2e
kubectl top pod|node should handle when Heapster is somewhere else
OpenShift runs Heapster on HTTPS, which means `top node` and `top pod`
are broken because they hardcode 'http' as the scheme. Provide an
options struct allowing users to specify `--heapster-namespace`,
`--heapster-service`, `--heapster-scheme`, and `--heapster-port` to the
commands (leveraging the existing defaults).
2016-12-01 12:33:32 -05:00
Kubernetes Submit Queue 15fa210056 Merge pull request #36217 from xilabao/get-detail-about-rolebinding
Automatic merge from submit-queue

add kubectl get rolebindings/clusterrolebindings -o wide

Use "-o wide" to get more information of roleRef/subjects
`kubectl get rolebindings -o wide`

|NAME | AGE | ROLE | USERS | GROUPS | SERVICEACCOUNTS|
|:-------|:-------|:-------|:-------|:-------|:-------|
|admin-resource-binding |1s | Role/admin-resource-role | test | | |


`kubectl get clusterrolebindings -o wide`

|NAME|AGE|ROLE|USERS|GROUPS|SERVICEACCOUNTS|
|:-------|:-------|:-------|:-------|:-------|:-------|
|cluster-admin|27s|cluster-admin| |system:masters| |
|system:basic-user|27s|system:basic-user| |system:authenticated, system:unauthenticated | |
|system:controller:replication-controller|27s|system:controller:replication-controller | | |kube-system/replication-controller|
|system:discovery |27s|system:discovery| |system:authenticated, system:unauthenticated| |
2016-12-01 07:52:11 -08:00
Kubernetes Submit Queue 56779576f0 Merge pull request #36424 from xilabao/fix-forbid-clusterrole-with-namespace
Automatic merge from submit-queue

fix forbid clusterrole with namespace

run `kubectl get clusterroles --all-namespaces`
old version
return error message:
```
NAMESPACE   NAME      AGE
clusterRole is not namespaced
clusterRole is not namespaced
clusterRole is not namespaced
clusterRole is not namespaced
clusterRole is not namespaced
clusterRole is not namespaced
clusterRole is not namespaced
```


```release-note

Add error message when trying to use clusterrole with namespace in kubectl

```
2016-12-01 00:39:12 -08:00
yarntime@163.com 4bbc3ba7b1 check the value of min and max 2016-12-01 16:09:05 +08:00
Kubernetes Submit Queue 737edd02a4 Merge pull request #35258 from feiskyer/package-aliase
Automatic merge from submit-queue

Fix package aliases to follow golang convention

Some package aliases are not not align with golang convention https://blog.golang.org/package-names. This PR fixes them. Also adds a verify script and presubmit checks.

Fixes #35070.

cc/ @timstclair @Random-Liu
2016-11-30 16:39:46 -08:00
Kubernetes Submit Queue 9ccc291e8a Merge pull request #37263 from smarterclayton/wait_on_immediate
Automatic merge from submit-queue

When --grace-period=0 is provided, wait for deletion

The grace-period is automatically set to 1 unless --force is provided, and the client waits until the object is deleted.

This preserves backwards compatibility with 1.4 and earlier. It does not handle scenarios where the object is deleted and a new object is created with the same name because we don't have the initial object loaded (and that's a larger change for 1.5).

Fixes #37117 by relaxing the guarantees provided.

```release-note
When deleting an object with `--grace-period=0`, the client will begin a graceful deletion and wait until the resource is fully deleted.  To force deletion, use the `--force` flag.
```
2016-11-30 11:15:17 -08:00
Kubernetes Submit Queue b312b34d53 Merge pull request #37619 from seeekr/patch-2
Automatic merge from submit-queue

fix typo in `kubectl proxy` command line help

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

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

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

**Special notes for your reviewer**: doc only

**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
```

(docs only) fixed port from 8011 to 8001 (the default) because in that particular line no specific port is specified and thus the default is going to be used.
2016-11-30 08:03:47 -08:00
Kubernetes Submit Queue 3c618a8167 Merge pull request #36726 from xilabao/fix-get-podsecuritypolicy
Automatic merge from submit-queue

fix kubectl get psp

old result:
```shell
./cluster/kubectl.sh --token=/system:masters get psp
NAME         PRIV      CAPS      VOLUMEPLUGINS   SELINUX    RUNASUSER
privileged   true      []        RunAsAny        RunAsAny   RunAsAny   RunAsAny   false     [*]
restricted   false     []        RunAsAny        RunAsAny   RunAsAny   RunAsAny   false     [*]
```

new result:
```shell
./cluster/kubectl.sh --token=/system:masters get psp
NAME         PRIV      CAPS      SELINUX    RUNASUSER   FSGROUP    SUPGROUP   READONLYROOTFS   VOLUMES
privileged   true      []        RunAsAny   RunAsAny    RunAsAny   RunAsAny   false            [*]
restricted   false     []        RunAsAny   RunAsAny    RunAsAny   RunAsAny   false            [*]
```

test.yaml
```
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
  name: privileged
spec:
  fsGroup:
    rule: RunAsAny
  privileged: true
  runAsUser:
    rule: RunAsAny
  seLinux:
    rule: RunAsAny
  supplementalGroups:
    rule: RunAsAny
  volumes:
  - '*'
---
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
  name: restricted
spec:
  fsGroup:
    rule: RunAsAny
  runAsUser:
    rule: RunAsAny
  seLinux:
    rule: RunAsAny
  supplementalGroups:
    rule: RunAsAny
  volumes:
  - '*'
```
2016-11-30 02:04:49 -08:00
Kubernetes Submit Queue 6b46578832 Merge pull request #37604 from ymqytw/fix_issues_with_drain
Automatic merge from submit-queue

make drain retry forever and use a new graceful period

Implemented the 1st approach according to https://github.com/kubernetes/kubernetes/issues/37460#issuecomment-263437516
1) Make drain retry forever if the error is always Too Many Requests (429) generated by Pod Disruption Budget.
2) Use a new graceful period per #37460
3) Update the message printed out when successfully deleting or evicting a pod.

fixes #37460

cc: @davidopp @erictune
2016-11-30 02:04:39 -08:00
zdj6373 e737f3277d Code optimization 2016-11-30 17:40:57 +08:00
Pengfei Ni f584ed4398 Fix package aliases to follow golang convention 2016-11-30 15:40:50 +08:00
ymqytw b358b2df02 make drain retry forever and use new timeout 2016-11-29 14:23:40 -08:00
Kubernetes Submit Queue 63a930f88e Merge pull request #37397 from ymqytw/update_doc_for_kubectl_apply
Automatic merge from submit-queue

Update doc for kubectl apply

Update doc for `kubectl apply`.

@MrHohn @mikedanese Please review the changes related to `--prune`.

We will need to update the doc when flags `--dry-run` and `-o` have been fixed. Ref: https://github.com/kubernetes/kubernetes/pull/34028#issuecomment-262392748

Partially addresses: kubernetes/kubernetes.github.io#1513

cc: @pwittrock @foxish
2016-11-29 07:31:48 -08:00
Kubernetes Submit Queue 93f6736daf Merge pull request #37345 from MrHohn/kubectl-apply-remove-w
Automatic merge from submit-queue

Removes shorthand flag -w from kubectl apply

Fixes #37342.

A shorthand flag `-w` was introduced as flag `--prune-whitelist` for kubectl apply two weeks ago. Turned out it is not what we should do. Removing this shorthand flag before 1.5 release to prevent further issues.

@ymqytw @pwittrock
2016-11-29 07:31:38 -08:00
Denis Andrejew be404a074f fix typo in `kubectl proxy` command line help
fixed port from 8011 to 8001 (the default) because in that particular line no specific port is specified and thus the default is going to be used.
2016-11-29 11:54:48 +00:00
tianshapjq d0ba378177 add some help info about the 'all' arg 2016-11-29 14:45:10 +08:00
oulinbao 0b74fa12b8 Refactor describe.go with PrefixWriter 2016-11-29 09:29:04 +08:00
Kubernetes Submit Queue 4a3c7aecdb Merge pull request #37321 from ymqytw/update_doc_for_kubectl_drain
Automatic merge from submit-queue

Update kubectl drain help message

Update `kubectl drain` help messages according to kubernetes/kubernetes.github.io#1768

cc: @erictune @pwittrock
2016-11-28 13:26:16 -08:00
ymqytw 2f32b48b25 update doc for kubectl apply 2016-11-28 09:52:39 -08:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
foxyriver ee6568a52a use status code const to express http status 2016-11-24 09:07:04 +08:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu 96cd71d8f6 kubectl 2016-11-23 15:53:09 -08:00
Clayton Coleman 7cdb6b169d
When --grace-period=0 is provided, wait for deletion
The grace-period is automatically set to 1 unless --force is provided,
and the client waits until the object is deleted.

This preserves backwards compatibility with 1.4 and earlier. It does not
handle scenarios where the object is deleted and a new object is created
with the same name.
2016-11-23 15:02:43 -06:00
xilabao c526849436 extend cmd valid resources information 2016-11-23 17:49:43 +08:00
Zihong Zheng f57c9c70f9 Removes shorthand flag from kubectl apply 2016-11-22 22:24:50 -08:00
ymqytw 3cc294b1e0 Revert "support patch list of primitives"
This reverts commit 34891ad9f6.
2016-11-22 21:06:36 -08:00
ymqytw d248843b65 Revert "try old patch after new patch fails"
This reverts commit f32696e734.
2016-11-22 21:02:30 -08:00
ymqytw 9b16b435fc Revert "Update apply and edit"
This reverts commit 48d3ca23cf.
2016-11-22 21:02:15 -08:00
ymqytw d178bc76ed Revert "add a unit test"
This reverts commit 11653b11c1.
2016-11-22 21:01:20 -08:00
ymqytw b8fbf68759 update kubectl drain doc 2016-11-22 15:34:58 -08:00
Kubernetes Submit Queue 2af762b67a Merge pull request #37142 from AdoHe/fix_kubectl_get_all
Automatic merge from submit-queue

kubectl resource filter convert unstructured obj before apply filter …

Fix #37128 

@pwittrock @saad-ali ptal.
2016-11-21 08:28:02 -08:00
deads2k e300f01a1b add create clusterrolebinding command 2016-11-21 08:50:06 -05:00
Kubernetes Submit Queue b9d2d74a94 Merge pull request #37038 from ymqytw/retry_old_patch_after_new_patch_fail
Automatic merge from submit-queue

Fix kubectl Stratigic Merge Patch compatibility

As @smarterclayton pointed out in [comment1](https://github.com/kubernetes/kubernetes/pull/35647#pullrequestreview-8290820) and [comment2](https://github.com/kubernetes/kubernetes/pull/35647#pullrequestreview-8290847) in PR #35647,
we cannot assume the API servers publish version and they shares the same version.

This PR removes all the calls of GetServerSupportedSMPatchVersion().
Change the behavior of `apply` and `edit` to:
Retrying with the old patch version, if the new version fails.
Default other usage of SMPatch to the new version, since they don't update list of primitives.

fixes #36916

cc: @pwittrock @smarterclayton
2016-11-19 01:02:47 -08:00
AdoHe 67f6754e0f kubectl resource filter convert unstructured obj before apply filter func 2016-11-19 13:03:39 +08:00
ymqytw 11653b11c1 add a unit test 2016-11-18 15:35:50 -08:00
ymqytw 48d3ca23cf Update apply and edit 2016-11-18 09:01:28 -08:00
Kubernetes Submit Queue 15bbd11bbf Merge pull request #35967 from saturnism/patch-2
Automatic merge from submit-queue

Append newline to the "deleted context ... " and "deleted cluster" message

**What this PR does / why we need it**: Append newline to the "deleted context ... " message.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2016-11-18 08:28:12 -08:00
Alvaro [Andor] f2fcf659fc Fix renaming order shown on terminal
When finishing a rolling update, a message is shown :
'Renaming oldRc to newRc'
In my case that'd be:
'Renaming nginx to nginx-df8d9fafc5007d83968cd37c8353d52e'
That naming order is incorrect, as the new name is temporary, and the final name should be the old one
2016-11-18 16:17:25 +01:00
Kubernetes Submit Queue ddcd9708ec Merge pull request #36898 from deads2k/cli-10-fix-unstructuredtpr
Automatic merge from submit-queue

remove TPR registration, ease validation requirements

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

This removes the special casing for TPRs inside of the `UnstructuredObject`, which should allow CRUD against skewed kube api server levels.

@kubernetes/kubectl @kubernetes/sig-cli 
@janetkuo
2016-11-18 06:27:17 -08:00
Kubernetes Submit Queue cae6cf2cee Merge pull request #37031 from foxish/add-ss-kubectl
Automatic merge from submit-queue

Adding statefulset to the list of things kubectl says it knows about

**What this PR does / why we need it**: Adding statefulset to the list of things kubectl says it knows about.

**Special notes for your reviewer**: 

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
NONE
```

cc @kubernetes/sig-apps @erictune
2016-11-17 16:49:58 -08:00
ymqytw f32696e734 try old patch after new patch fails 2016-11-17 14:28:09 -08:00
Anirudh 4b53a32e14 Adding statefulset to the kubectl output for valid resources 2016-11-17 13:53:23 -08:00
Ray Tsang 846cd2d66a Append newline to the "deleted context ... " and "deleted cluster ..." message 2016-11-17 12:30:45 -05:00
Kubernetes Submit Queue 424286996a Merge pull request #36764 from ymqytw/make_edit_before_create_iterate
Automatic merge from submit-queue

make kubectl create --edit iterate

`kubectl create --edit` is broken after #36148 merged.
`kubectl create --edit` will fail when a manifest that contains multiple resources.
I guess the root cause is that dynamic typer doesn't support a list of resources currently.

This PR makes `kubectl create --edit` iterate again as `kubectl create`.
2016-11-17 01:25:34 -08:00
deads2k 66e5c38d67 remove TPR registration, ease validation requirements 2016-11-16 14:04:35 -05:00
AdoHe d66bcbfa61 create service add create ExternalName service implementation 2016-11-16 04:47:10 -05:00
Kubernetes Submit Queue fac05d9c81 Merge pull request #36174 from JacobTanenbaum/v2resource_fixes
Automatic merge from submit-queue

V2resource fixes

when using kubectl set resources it resets all resource fields that are not being set.

for example
$ kubectl set resources deployments nginx --limits=cpu=100m

followed by

$ kubectl set resources deployments nginx --limits=memory=256Mi

would result in the nginx deployment only limiting memory at 256Mi with the previous
limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
only modifies fields set in that command and changed the testing so that the desired behavior
is checked.

Also a typo:

you must specify an update to requests or limits or (in the form of --requests/--limits)

corrected to

you must specify an update to requests or limits (in the form of --requests/--limits)

Implemented both the dry run and local flags.

Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112

The original PR associated with these fixes where reverted due to causing a flake in hack/make-rules/test-cmd.sh, I gave the 'kubectl set resources' tests there own deployment and set the terminationGracePeriodSeconds to 0 and have run test-cmd.sh for hours without hitting the flake
2016-11-15 21:03:06 -08:00
Kubernetes Submit Queue 2bd8bb2699 Merge pull request #34873 from k82cn/k8s_34633
Automatic merge from submit-queue

Set non-zero exit code on failures for kubectl

fixes #34633 

/cc @AdoHe
2016-11-15 03:40:53 -08:00
Kubernetes Submit Queue 79fc0a95a0 Merge pull request #35543 from philips/improve-version
Automatic merge from submit-queue

kubectl: add less verbose version

The kubectl version output is very complex and makes it hard for users
and vendors to give actionable information. For example during the
recent Kubernetes 1.4.3 TLS security scramble I had to write a one-liner
for users to get out the version number to give to figure out if they
are vulnerable:

```
$ kubectl version | grep -i Server | sed  -n 's%.*GitVersion:"\([^"]*\).*%\1%p'
```

Instead this patch outputs simply output by default

```
./kubectl version
Client Version: v1.4.3
Server Version: v1.4.3
```

Adding the `--verbose` flag will output the old format.
2016-11-14 22:39:21 -08:00
ymqytw 189348df2b make kubectl create --edit iterate 2016-11-14 14:12:24 -08:00
Kubernetes Submit Queue 61a5d23e0f Merge pull request #36603 from fabianofranz/fix_lists_in_convert
Automatic merge from submit-queue

Fix handling lists in kubectl convert

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

When handling multiple objects in `kubectl convert` (for example in `kubectl convert -f .` with multiple files in current directory) the objects must be managed as a list instead of individually, otherwise `-o yaml|json` will generate invalid format (just multiple json/yaml objects concatenated) which can't be fed to `kubectl create` like in `kubectl convert -f . | kubectl create -f -`.


```release-note
NONE
```
2016-11-14 12:21:16 -08:00
deads2k baa2418b11 let printer update unstructured list 2016-11-14 10:42:28 -05:00
xilabao b472d49bf2 fix kubectl get psp 2016-11-14 10:29:37 +08:00
Klaus Ma fec8793b5f Set non-zero exit code on failures for kubectl. 2016-11-12 07:40:54 -05:00
Kubernetes Submit Queue 3e169be887 Merge pull request #35647 from ymqytw/patch_primitive_list
Automatic merge from submit-queue

Fix strategic patch for list of primitive type with merge sementic

Fix strategic patch for list of primitive type when the patch strategy is `merge`.
Before: we cannot replace or delete an item in a list of primitive, e.g. string, when the patch strategy is `merge`. It will always append new items to the list.
This patch will generate a map to update the list of primitive type.
The server with this patch will accept either a new patch or an old patch.
The client will found out the APIserver version before generate the patch.

Fixes #35163, #32398

cc: @pwittrock @fabianofranz 

``` release-note
Fix strategic patch for list of primitive type when patch strategy is `merge` to remove deleted objects.
```
2016-11-11 14:36:44 -08:00
Brandon Philips 9216057589 kubectl: add less verbose version
The kubectl version output is very complex and makes it hard for users
and vendors to give actionable information. For example during the
recent Kubernetes 1.4.3 TLS security scramble I had to write a one-liner
for users to get out the version number to give to figure out if they
are vulnerable:

    $ kubectl version | grep -i Server | sed  -n 's%.*GitVersion:"\([^"]*\).*%\1%p'

Instead this patch outputs simply output with `--short`

    ./kubectl version --short
    Client Version: v1.4.3
    Server Version: v1.4.3
2016-11-10 14:07:42 -08:00
Fabiano Franz 8965fcaf10 Fix handling lists in kubectl convert 2016-11-10 18:19:30 -02:00
Kubernetes Submit Queue a551dff534 Merge pull request #35901 from justinsb/kubectl_show_labels
Automatic merge from submit-queue

kubectl: show node label if defined

We are moving towards marking master nodes as tainted, and not
necessarily unschedulable.  Further now we encourage users to taint
nodes, marking them unschedulable.

Thus the reliance on "Unschedulable" is not really a great indicator for
the master.

Instead, recognize the existing node 'role' markers, and surface them
where Unschedulable is (in the status).

We recognize:

 * a kubernetes.io/role label
 * a kubeadm.alpha.kubernetes.io/role label
~a taint with Key 'dedicated'~

Fix #33533
2016-11-10 03:12:33 -08:00
Kubernetes Submit Queue 6fcf8e415c Merge pull request #34584 from ymqytw/support_force_apply
Automatic merge from submit-queue

support kubectl apply --force

Support `kubectl apply --force` which is first delete the resource and then re-apply the resource, when the patch fails.

Fixes: #16569
2016-11-09 21:14:25 -08:00
Kubernetes Submit Queue 5d894d5164 Merge pull request #36495 from mwielgus/kubectl_pdb
Automatic merge from submit-queue

Support for PodDisruptionBudget in Kubectl

Based on:

https://github.com/kubernetes/kubernetes/pull/35287

cc: @davidopp @soltysh @wojtek-t
2016-11-09 17:33:41 -08:00
Kubernetes Submit Queue 7bb031da3a Merge pull request #30237 from mikedanese/csr-porcelain
Automatic merge from submit-queue

implement kubectl procelain csr commands

cc @gtank

ref #30163
2016-11-09 16:57:49 -08:00
juanvallejo 11ad2cf2ff
Remove duplicate describer errs
The `describe` command iterates through a list of infos received from
the server and aggregates a list of errors while attempting to call each
resource's respective describer. When a resource exists, but does not
have a describer set, such as `Event`, the `describe` command outputs
the same error `error: no description has been implemented for "Event"`
for each info.

```
$ kubectl describe events
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
no description has been implemented for "Event"
```
2016-11-09 16:28:36 -05:00
ymqytw 34891ad9f6 support patch list of primitives 2016-11-09 11:46:59 -08:00
Marcin 5e83188327 Autogenerated bazel 2016-11-09 13:41:18 +01:00
Marcin 9cee1456a6 Describe and get support for the updated api + tests 2016-11-09 13:39:16 +01:00
Maciej Szulik 5f8e76b479 Add resource printer and describer for PodDisruptionBudget 2016-11-09 11:33:51 +01:00
Kubernetes Submit Queue b3e4083f49 Merge pull request #36133 from luomiao/photon-support-PR-v2
Automatic merge from submit-queue

Support persistent volume usage for kubernetes running on Photon Controller platform

**What this PR does / why we need it:**
Enable the persistent volume usage for kubernetes running on Photon platform.
Photon Controller: https://vmware.github.io/photon-controller/

_Only the first commit include the real code change.
The following commits are for third-party vendor dependency and auto-generated code/docs updating._

Two components are added:
pkg/cloudprovider/providers/photon: support Photon Controller as cloud provider
pkg/volume/photon_pd: support Photon persistent disk as volume source for persistent volume

Usage introduction:
a. Photon Controller is supported as cloud provider.
When choosing to use photon controller as a cloud provider, "--cloud-provider=photon --cloud-config=[path_to_config_file]" is required for kubelet/kube-controller-manager/kube-apiserver. The config file of Photon Controller should follow the following usage:

```
[Global]
target = http://[photon_controller_endpoint_IP]
ignoreCertificate = true
tenant = [tenant_name]
project = [project_name]
overrideIP = true
```

b. Photon persistent disk is supported as volume source/persistent volume source.
yaml usage:

```
volumes:
  - name: photon-storage-1
    photonPersistentDisk:
        pdID: "643ed4e2-3fcc-482b-96d0-12ff6cab2a69"
```
pdID is the persistent disk ID from Photon Controller.

c. Enable Photon Controller as volume provisioner.
yaml usage:

```
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: gold_sc
provisioner: kubernetes.io/photon-pd
parameters:
  flavor: persistent-disk-gold
```

The flavor "persistent-disk-gold" needs to be created by Photon platform admin before hand.
2016-11-09 00:10:22 -08:00
Kubernetes Submit Queue 4b5667e177 Merge pull request #36211 from brendandburns/cordon
Automatic merge from submit-queue

Add retry to node scheduability marking.

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

@justinsb @janetkuo @kubernetes/sig-cli
2016-11-08 16:05:53 -08:00
Miao Luo b22ccc6780 Support persistent volume on Photon Controller platform
1. Enable Photon Controller as cloud provider
2. Support Photon persistent disk as volume source/persistent volume
source
2016-11-08 09:36:16 -08:00
Kubernetes Submit Queue 3b31c9f019 Merge pull request #36355 from soltysh/deprecate_extensionsjob
Automatic merge from submit-queue

 Deprecate extensions/v1beta1.Jobs related stuff

This PR supersedes https://github.com/kubernetes/kubernetes/pull/33861, it's a pre-req for removing `extensions/v1beta1.Jobs` (#32763) in the next release. 

@kubernetes/kubectl @kubernetes/api-review-team ptal
@bgrant0607 @erictune @janetkuo fyi

```release-note
Deprecate extensions/v1beta1.Jobs
```
2016-11-08 07:18:40 -08:00
Mike Danese 584689f182 implement kubectl procelain csr commands 2016-11-08 06:33:46 -08:00
xilabao b346911299 fix forbid clusterrole with namespace 2016-11-08 16:25:33 +08:00
xilabao 93be603d8f add kubectl get rolebindings/clusterrolebindings -o wide 2016-11-08 16:19:57 +08:00
Kubernetes Submit Queue 13cc43af82 Merge pull request #35483 from ymqytw/use_evict_for_drain
Automatic merge from submit-queue

Fix kubectl drain for statefulset

Support deleting pets for `kubectl drain`. 
Use evict to delete pods.

Fixes: #33727

```release-note
Adds support for StatefulSets in kubectl drain.
Switches to use the eviction sub-resource instead of deletion in kubectl drain, if server supports.
```

@foxish @caesarxuchao
2016-11-07 17:42:08 -08:00
ymqytw b73fae6c55 Fix kubectl drain for statefulset and use eviciton for drain if possible 2016-11-07 16:13:06 -08:00
Justin Santa Barbara 98f7c3919e kubectl: show node label if defined
We are moving towards marking master nodes as tainted, and not
necessarily unschedulable.  Further now we encourage users to cordon
nodes, marking them unschedulable.

Thus the reliance on "Unschedulable" is not really a great indicator for
the master.

So, recognize the existing node 'role' markers, and surface them
where Unschedulable is (in the status).

We recognize:

 * a kubernetes.io/role label
 * a kubeadm.alpha.kubernetes.io/role label

Fix #33533
2016-11-07 18:38:21 -05:00
Kubernetes Submit Queue 7f74d48586 Merge pull request #36171 from kargakis/kubectl-changes-for-failed-deployments
Automatic merge from submit-queue

kubectl: enhancements for deployment progress deadline

Changes:
* add deployment conditions in the describer
* abort 'rollout status' for deployments that have exceeded their
progress deadline

Depends on https://github.com/kubernetes/kubernetes/pull/35691.

@kubernetes/kubectl @kubernetes/deployment

Fixes https://github.com/kubernetes/kubernetes/issues/31319
2016-11-07 10:22:32 -08:00
Maciej Szulik ed6ede3715 Deprecate extensions/v1beta1.Jobs related stuff 2016-11-07 12:44:51 +01:00
Maciej Szulik 0b5ef16008 Support ScheduledJob name 2016-11-07 10:14:12 +01:00
Maciej Szulik 41d88d30dd Rename ScheduledJob to CronJob 2016-11-07 10:14:12 +01:00
Kubernetes Submit Queue f7e0c6c19e Merge pull request #35418 from sttts/sttts-discovery-cache
Automatic merge from submit-queue

Add caching for discovery info with invalidation on cache-miss

TODO:
- [x] write tests for `CachedDiscoveryClient`
- [x] write tests for `DeferredDiscoveryRESTMapper` on cache-miss
- [x] find better way/structure to get rid of `invalidateCh` in c06ba3175b
2016-11-06 20:10:57 -08:00
Brendan Burns 55f031e167 Add retry to node scheduability marking. 2016-11-06 08:28:36 -08:00
Michail Kargakis f97666eb66 kubectl: enhancements for deployment progress deadline
Changes:
* add deployment conditions in the describer
* abort 'rollout status' for deployments that have exceeded their
progress deadline
2016-11-06 14:08:33 +01:00
Kubernetes Submit Queue 47519962bf Merge pull request #35484 from smarterclayton/delete_warning
Automatic merge from submit-queue

Add --force to kubectl delete and explain force deletion

--force is required for --grace-period=0. --now is == --grace-period=1.
Improve command help to explain what graceful deletion is and warn about
force deletion.

Part of #34160 & #29033

```release-note
In order to bypass graceful deletion of pods (to immediately remove the pod from the API) the user must now provide the `--force` flag in addition to `--grace-period=0`.  This prevents users from accidentally force deleting pods without being aware of the consequences of force deletion.  Force deleting pods for resources like StatefulSets can result in multiple pods with the same name having running processes in the cluster, which may lead to data corruption or data inconsistency when using shared storage or common API endpoints.
```
2016-11-05 11:19:04 -07:00
Kubernetes Submit Queue da56dc1e33 Merge pull request #35206 from juanvallejo/jvallejo/exit-w-errorcode-on-non-existent-cmds
Automatic merge from submit-queue

update default run function for sub-commands

**Release note**:

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

This patch updates parent commands of sub-commands to exit with a usage
error and exit code 1 on an invalid (non-sub-command) argument.

cc @kargakis
2016-11-05 07:33:46 -07:00
ymqytw 750449ba3c support force apply 2016-11-04 20:42:34 -07:00
Dr. Stefan Schimanski c8513c31a1 Update bazel 2016-11-04 21:17:12 +01:00
Dr. Stefan Schimanski 14ce6f6065 Add caching for discovery info 2016-11-04 21:17:12 +01:00
Kubernetes Submit Queue 5a2c473c1c Merge pull request #36085 from deads2k/cli-05-generic-print
Automatic merge from submit-queue

have basic kubectl crud agnostic of registered types

Makes `kubectl get` agnostic to scheme (baked in API types).  This means that it will now work against generic API servers that are "kube shaped".

This is similar to the work done for `kubectl create` last release.  I'll split out the smaller command.  `kubectl get` looks a lot different, but this eliminates all special casing for TPR in those cases.



@fabianofranz
2016-11-04 08:17:02 -07:00
deads2k 61673c4b39 make kubectl get generic with respect to objects 2016-11-04 09:04:57 -04:00
Kubernetes Submit Queue 9531442cd6 Merge pull request #35866 from madhusudancs/federation-kubefed-init-fakeclient
Automatic merge from submit-queue

Make the fake command factory return the clientset with appropriate rest clients for all the API groups.

Please review only the last commit here. This is based on PR #35865 which will be reviewed independently.

Design Doc: PR #34484

cc @kubernetes/sig-cluster-federation @nikhiljindal
2016-11-04 05:46:46 -07:00
deads2k 7fe9bd4c30 make kubectl delete generic 2016-11-04 07:50:31 -04:00
deads2k 9260b992bf make kubectl replace generic 2016-11-04 07:50:31 -04:00
Kubernetes Submit Queue e4edd817af Merge pull request #35220 from MrHohn/kubectl-apply-type
Automatic merge from submit-queue

Implement --prune-whitelist(-w) flag to overwrite default whitelist for --prune

From #34274.

Updates:

As suggested, the new commits implement a default whitelist for `kubectl apply --prune`, which could be overwritten by using `--prune-whitelist`or `-w` flag. The default whitelist and example as below.

Also supports `--dry-run` for `--prune` to fix #35222.

whitelist:

```
type pruneResource struct {
    group      string
    version    string
    kind       string
    namespaced bool
}

*pruneResources = []pruneResource{
    {"", "v1", "ConfigMap", true},
    {"", "v1", "Endpoints", true},
    {"", "v1", "Namespace", false},
    {"", "v1", "PersistentVolumeClaim", true},
    {"", "v1", "PersistentVolume", false},
    {"", "v1", "Pod", true},
    {"", "v1", "ReplicationController", true},
    {"", "v1", "Secret", true},
    {"", "v1", "Service", true},
    {"batch", "v1", "Job", true},
    {"extensions", "v1beta1", "DaemonSet", true},
    {"extensions", "v1beta1", "Deployment", true},
    {"extensions", "v1beta1", "HorizontalPodAutoscaler", true},
    {"extensions", "v1beta1", "Ingress", true},
    {"extensions", "v1beta1", "ReplicaSet", true},
    {"apps", "v1beta1", "StatefulSet", true},
}
```

example:

```
$ kubectl apply -f /path/to/file --prune -l test=true \
      -w core/v1/Pod \
      -w core/v1/Service \
      -w extensions/v1beta1/Deployment 
```

@mikedanese
2016-11-03 18:46:17 -07:00
Kubernetes Submit Queue f2b5600567 Merge pull request #36017 from foxish/kubectl-new-2
Automatic merge from submit-queue

Set reason and message on Pod during nodecontroller eviction

**What this PR does / why we need it**: Pods which are evicted by the nodecontroller due to network partition, or unresponsive kubelet should be differentiated from termination initiated by other sources. The reason/message are consumed by kubectl to provide a better summary using get/describe.

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

**Release note**:
```release-note
Pods that are terminating due to eviction by the nodecontroller (typically due to unresponsive kubelet, or network partition) now surface in `kubectl get` output 
as being in state "Unknown", along with a longer description in `kubectl describe` output.
```
2016-11-03 18:05:44 -07:00
Kubernetes Submit Queue 6ac5887e8a Merge pull request #36148 from kargakis/edit-list
Automatic merge from submit-queue

kubectl: make edit work with lists again

@kubernetes/kubectl this is fixing https://github.com/kubernetes/kubernetes/issues/20519 and slightly changes the behavior of --recursive when the directory that is being edited has files with errors. Previously since `edit` was working on an object basis, bad objects would be skipped and the editor would load the next object. We want to load multiple objects in the same list and it's impossible to load invalid objects in a list so --recursive will not work if there is any error in the directory. I think this is an acceptable trade-off.

Review here: https://github.com/kubernetes/kubernetes/pull/36148/files?w=1
2016-11-03 17:27:13 -07:00
Kubernetes Submit Queue 27118fe23a Merge pull request #35715 from apelisse/owners-pkg-kubectl
Automatic merge from submit-queue

Curating Owners: pkg/kubectl

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone lgtms and then someone
experienced in the project approves), we are adding new reviewers to
existing owners files.
## If You Care About the Process:

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
well: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.
## TLDR:

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:
1. Comment on the pull-request explaining the changes you want. I'll
   take care of doing them (unless you want to modify the pull-request
   yourself).
2. OWNERS files in subdirectory can be removed if they are redundant with
   top-directory files.
3. Please use the ALIAS feature if you want to re-use a list of persons
   in different files.
2016-11-03 15:50:29 -07:00
Anirudh 6d7213dd39 Update bazel 2016-11-03 13:47:09 -07:00
Anirudh a5bdc5f509 Set reason and message on Pod during nodecontroller eviction
Pods which are evicted by the nodecontroller due to network
malfunction, or unresponsive kubelet should be differentiated
from termination initiated by other sources. The reason/message
are consumed by kubectl to provide a better summary using get/describe.
2016-11-03 13:47:03 -07:00
Kubernetes Submit Queue 7c391158e3 Merge pull request #35810 from deads2k/client-18-decode-status
Automatic merge from submit-queue

always allow decoding of status when returned from the API

`unversioned.Status` should be able to come back from any API version and still be properly decoded.  This doesn't happen today by default.

@smarterclayton  Our projectrequest endpoint returns a `Status` object on a 200 return from list to indicate everything went well.  This (or something like it) is needed to make the API accepted by `kubectl`.  Alternatively, we change the API to return a different (still not a `Project`) value from list, which still feels wrong.
2016-11-03 11:18:23 -07:00
Jacob Tanenbaum 13afa70c81 Implemented both the dry run and local flags.
Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112

The previous attempt at the PR (PR#35050) was reverted for causeing a flake.
I believe that setting the deployments terminationGracePeriodSeconds to 0 should
take care of it. I ran hack/make-rules/test-cmd.sh 50 times in a row without encountering
the flake
2016-11-03 12:55:19 -04:00
Jacob Tanenbaum 9d7ae7b80d fixed some issues with kubectl set resources
when using kubectl set resources it resets all resource fields that are not being set.

for example
  # kubectl set resources deployments nginx --limits=cpu=100m

followed by

  # kubectl set resources deployments nginx --limits=memory=256Mi

would result in the nginx deployment only limiting memory at 256Mi with the previous
limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
only modifies fields set in that command and changed the testing so that the desired behavior
is checked.

Also a typo:

 you must specify an update to requests or limits or  (in the form of --requests/--limits)

corrected to

 you must specify an update to requests or limits (in the form of --requests/--limits)

changelog:
 - fixed a typo in hack/make-rules/test-cmd.sh "effecting" to "affecting"
2016-11-03 12:55:19 -04:00
Kubernetes Submit Queue f91cd17821 Merge pull request #35799 from deads2k/client-17-negotiation
Automatic merge from submit-queue

clean up client version negotiation to handle no legacy API

Version negotiation fails if the legacy API endpoint isn't available.

This tightens up the negotiation interface based to more clearly express what each stage is doing and what the constraints on negotiation are.  This is needed to speak to generic API servers.

@kubernetes/kubectl
2016-11-03 07:53:47 -07:00
Michail Kargakis 35f7d2513f kubectl: make edit work with lists again 2016-11-03 13:12:22 +01:00
Clayton Coleman 6e25830378
Add --force to kubectl delete and explain force deletion
--force is required for --grace-period=0. --now is == --grace-period=1.
Improve command help to explain what graceful deletion is and warn about
force deletion.
2016-11-02 17:44:05 -04:00
Madhusudan.C.S 0092cda7ed Need type assertion because RESTClient() is now a method that returns and interface. 2016-11-01 21:59:51 -07:00
Madhusudan.C.S e69475d29e Make the fake command factory return the clientset with appropriate rest clients for all the API groups.
Calling `internalclientset.New()` with a rest client as an argument simply
copies that rest client to all the API group clients irrespective of the
configured GroupVersion or versionedAPIPath in the client. So only one
API group client gets the client configured correctly for that API
group. All the other API group clients get misconfigured rest clients.

On the other hand, `internalclientset.NewForConfigOrDie()` does the right
thing by reconfiguring the passed configs for each API group and
initializes an appropriate rest client for that group.

Now that we are relying on the `NewForConfigOrDie()` method to
initialize the rest clients, we need to swap the underlying http clients
in each of these rest clients with a fake one for testing.
2016-11-01 19:03:04 -07:00
Kubernetes Submit Queue 3d33b45e43 Merge pull request #30091 from rootfs/azure-storage
Automatic merge from submit-queue

support Azure disk dynamic provisioning

azure disk dynamic provisioning

A screen shot 

``` console
$ kubectl create -f examples/experimental/persistent-volume-provisioning/azure-dd.yaml
storageclass "slow" created
$ kubectl create -f examples/experimental/persistent-volume-provisioning/claim1.json
persistentvolumeclaim "claim1" created
$ kubectl describe pvc
Name:       claim1
Namespace:  default
Status:     Bound
Volume:     pvc-de7150d1-6a37-11e6-aec9-000d3a12e034
Labels:     <none>
Capacity:   3Gi
Access Modes:   RWO
$ kubectl create -f pod.yaml
replicationcontroller "nfs-server" created
$ kubectl describe pod
Name:       nfs-server-b9w6x
Namespace:  default
Node:       rootfs-dev/172.24.0.4
Start Time: Wed, 24 Aug 2016 19:46:21 +0000
Labels:     role=nfs-server
Status:     Running
IP:     172.17.0.2
Controllers:    ReplicationController/nfs-server
Containers:
  nfs-server:
    Container ID:   docker://be6f8c0e26dc896d4c53ef0d21c9414982f0b39a10facd6b93a255f9e1c3806c
    Image:      nginx
    Image ID:       docker://bfdd4ced794ed276a28cf56b233ea58dec544e9ca329d796cf30b8bcf6d39b3f
    Port:       
    State:      Running
      Started:      Wed, 24 Aug 2016 19:49:19 +0000
    Ready:      True
    Restart Count:  0
    Volume Mounts:
      /exports from mypvc (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-9o0fj (ro)
    Environment Variables:  <none>
Conditions:
  Type      Status
  Initialized   True 
  Ready     True 
  PodScheduled  True 
Volumes:
  mypvc:
    Type:   PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  claim1
    ReadOnly:   false
  default-token-9o0fj:
    Type:   Secret (a volume populated by a Secret)
    SecretName: default-token-9o0fj
QoS Class:  BestEffort
Tolerations:    <none>
Events:
  FirstSeen LastSeen    Count   From            SubobjectPath           Type        Reason      Message
  --------- --------    -----   ----            -------------           --------    ------      -------
  11m       11m     1   {default-scheduler }                    Normal      Scheduled   Successfully assigned nfs-server-b9w6x to rootfs-dev
  9m        9m      1   {kubelet rootfs-dev}                    Warning     FailedMount Unable to mount volumes for pod "nfs-server-b9w6x_default(6eb7fd98-6a33-11e6-aec9-000d3a12e034)": timeout expired waiting for volumes to attach/mount for pod "nfs-server-b9w6x"/"default". list of unattached/unmounted volumes=[mypvc]
  9m        9m      1   {kubelet rootfs-dev}                    Warning     FailedSync  Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "nfs-server-b9w6x"/"default". list of unattached/unmounted volumes=[mypvc]
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Pulling     pulling image "nginx"
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Pulled      Successfully pulled image "nginx"
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Created     Created container with docker id be6f8c0e26dc
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Started     Started container with docker id be6f8c0e26dc

```

@colemickens @brendandburns
2016-11-01 17:27:14 -07:00
Zihong Zheng af048bdb62 Implements --prune-whitelist(-w) flag to overwrite default whitelist for --prune 2016-11-01 14:02:00 -07:00
Saad Ali 1c51ac4fc1 Revert "fixed some issues with kubectl set resources" 2016-11-01 13:53:17 -07:00
deads2k 235678d591 always allow decoding of status when returned from the API 2016-11-01 16:36:45 -04:00
Madhusudan.C.S 1712a190cb [Federation][(Un)join-00] Implement federation/cluster resource generator. 2016-11-01 00:58:54 -07:00
deads2k bae940df5c clean up client version negotiation to handle no legacy API 2016-10-31 16:05:50 -04:00
Kubernetes Submit Queue 24899597b9 Merge pull request #32687 from jouve/resource_type
Automatic merge from submit-queue

update list of vailable resources

Hi,

kubectl get --help produce a list of resource types and aliases :

```
Valid resource types include:
   * clusters (valid only for federation apiservers)
   * componentstatuses (aka 'cs')
   ...
```

``` release-note
Update the list of resources in kubectl get --help
```

The list is currently outdated (for exemple missing networkpolicy).

http://kubernetes.io/docs/user-guide/kubectl-overview/#resource-types has the same data and is also outdated.

The patch updates these 2 lists.
2016-10-31 09:28:29 -07:00
juanvallejo 988e747649 update default run function for sub-commands
This patch updates parent commands of sub-commands to exit with a usage
error and exit code 1 on an invalid (non-sub-command) argument.
2016-10-31 10:08:12 -04:00
Michal Fojtik 0faa27e62d Use PATCH when pausing/resuming objects and CalculatePatches to get the patch 2016-10-31 13:13:59 +01:00
Kubernetes Submit Queue f448f24c73 Merge pull request #34914 from brendandburns/kubectl-cp
Automatic merge from submit-queue

add kubectl cp

Implements `kubectl cp` (https://github.com/kubernetes/kubernetes/issues/13776)

Syntax examples:

```sh
# Copy from pod to local machine
$ kubectl cp [namespace/]pod:/some/file/or/dir ./some/local/file/or/dir

# Copy from local machine to pod
$ kubectl cp /some/local/file/or/dir [namespace/]pod:/some/remote/file/or/dir
```

@deads2k @smarterclayton @kubernetes/sig-cli
2016-10-30 15:12:41 -07:00
Cyril Jouve ffcc2f61b5 update available resource list 2016-10-30 21:47:25 +01:00
Kubernetes Submit Queue 71ba8a90f0 Merge pull request #35732 from fabianofranz/run_cant_dryrun_with_attach
Automatic merge from submit-queue

Better kubectl run validations

Adds more validations to flags that must be mutually exclusive in `kubectl run`. For example, `--dry-run` must not be used with `--attach`, `--stdin` or `--tty`. Adds unit tests for these new validations and some previously existing ones.

**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
NONE
```
2016-10-30 13:07:28 -07:00
Kubernetes Submit Queue bc5682bbaa Merge pull request #35050 from JacobTanenbaum/resource_fixes
Automatic merge from submit-queue

fixed some issues with kubectl set resources

when using kubectl set resources it resets all resource fields that are not being set.

for example
  # kubectl set resources deployments nginx --limits=cpu=100m

followed by

  # kubectl set resources deployments nginx --limits=memory=256Mi

would result in the nginx deployment only limiting memory at 256Mi with the previous
limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
only modifies fields set in that command and changed the testing so that the desired behavior
is checked.

Also a typo:

 you must specify an update to requests or limits or  (in the form of --requests/--limits)

corrected to

 you must specify an update to requests or limits (in the form of --requests/--limits)

 Implemented both the dry run and local flags.

Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112
2016-10-30 06:18:56 -07:00
Kubernetes Submit Queue 1ff0b422a8 Merge pull request #35664 from ymqytw/update_drain_test
Automatic merge from submit-queue

Update drain test

Update how int convert to string in the kubectl drain test.
It is safer to use `strconv.Itoa()` than `string()`.
2016-10-30 04:30:18 -07:00
Kubernetes Submit Queue 5f8dc216d1 Merge pull request #35427 from fabianofranz/issues_35426
Automatic merge from submit-queue

kubectl commands must not use the factory out of Run

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

@smarterclayton PTAL
2016-10-30 03:17:59 -07:00
Kubernetes Submit Queue 7778ee2190 Merge pull request #33024 from juanvallejo/jvallejo/add-print-error-w-causes-cmdutil-helper
Automatic merge from submit-queue

Add "PrintErrorWithCauses" cmdutil helper

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

This patch adds a new helper function to `cmd/util/helpers.go` that
handles errors containing collections of causes and prints each cause in
a separate newline.
2016-10-30 01:12:13 -07:00
Brendan Burns d65757fb88 add kubectl cp 2016-10-29 20:24:54 -07:00
Kubernetes Submit Queue a06a08a906 Merge pull request #34489 from caesarxuchao/time-copy.sh
Automatic merge from submit-queue

Verify and update client-go staging area for every PR

We need to keep the staging area up-to-date to prevent PRs from breaking client-go.

It's marked as "WIP" because we need to decide the [versioning strategy](https://github.com/kubernetes/client-go/issues/9) for client-go first. This PR contains breaking changes for client-go.

This is blocking #29934 and potentially #34441

cc @kubernetes/sig-api-machinery
2016-10-29 16:24:07 -07:00
Kubernetes Submit Queue 7f309f5fae Merge pull request #35471 from caesarxuchao/client-gen-multi-versions
Automatic merge from submit-queue

Let release_1_5 clientset include multiple versions of a group

Fix #35237 

This PR make versioned clientset to include multiple versions of a group. Currently only `batch` has `v1` and `v2alpha1`. The clientset interface now looks like:
```go
	BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface
	BatchV1() v1batch.BatchV1Interface
	// Deprecated: please explicitly pick a version if possible.
	Batch() v1batch.BatchV1Interface
```

Commit "update client-gen to say internalversion rather than unversioned" fixes https://github.com/kubernetes/kubernetes/issues/24481. 


cc @kubernetes/sig-api-machinery @soltysh @deads2k @nikhiljindal 



```release-note
release_1_5 clientset supports multiple versions of a group.
```
2016-10-29 15:40:13 -07:00
Kubernetes Submit Queue 7c9c8cbf28 Merge pull request #34952 from kargakis/update-observedgeneration-for-overlapping-deployments
Automatic merge from submit-queue

Make overlapping deployments deletable

@kubernetes/deployment ptal

Fixes https://github.com/kubernetes/kubernetes/issues/34466 by 1) not adding the overlapping annotation in the working deployment, 2) updates observedGeneration for overlapping deployments, and 3) updates the kubectl deployment reaper to do non-cascading deletion for deployments with the overlapping annotation.
2016-10-29 14:50:16 -07:00
Chao Xu fd2fdfba89 move client/unversioned/fake to client/restclient/fake 2016-10-29 14:22:02 -07:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Kubernetes Submit Queue 7fc2273cad Merge pull request #35327 from r2d4/kubectl-completion-boilerplate
Automatic merge from submit-queue

Add boilerplate to `kubectl completion bash`

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

Small refactor to make kubectl bash and zsh completion share
boilerplate.  Previously the boilerplate was not included in the bash
script.
2016-10-29 12:27:39 -07:00
Kubernetes Submit Queue 739f78fad2 Merge pull request #33250 from ymqytw/edit_before_create
Automatic merge from submit-queue

support editing before creating resource

Support `kubectl create -f config.yaml --edit`
Support editing before creating resource from files, urls and stdin.
The behavior is similar to `kubectl edit`
It won't create anything when edit make no change.

partial: #18064

Based on: #33686 and #33973

```release-note
Support editing before creating resource from files, urls and stdin, e.g. `kubectl create -f config.yaml --edit`
It won't create anything when edit make no change.
```
2016-10-29 11:45:43 -07:00
Antoine Pelisse 91393b5123 Move pkg/kubectl reviewers into an alias 2016-10-28 14:54:17 -07:00
Phillip Wittrock 28bdf8298b Update OWNERS 2016-10-28 13:11:57 -07:00
Clayton Coleman ca2f1b87ad
Replace negotiation with a new method that can extract info
Alter how runtime.SerializeInfo is represented to simplify negotiation
and reduce the need to allocate during negotiation. Simplify the dynamic
client's logic around negotiating type. Add more tests for media type
handling where necessary.
2016-10-28 11:30:11 -04:00
juanvallejo 643649113f Add "PrintErrorWithCauses" cmdutil helper
This patch adds a new helper function to cmd/util/helpers.go that
handles errors containing collections of causes and prints each cause in
a separate newline.
2016-10-28 10:17:45 -04:00
Huamin Chen 1d52719465 azure disk volume: support storage class and dynamic provisioning
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-10-28 13:31:47 +00:00
Janet Kuo 10aee82ae3 Rename PetSet API to StatefulSet 2016-10-27 17:25:10 -07:00
Fabiano Franz bc1a1d7b30 Better kubectl run validations 2016-10-27 20:05:26 -02:00
Antoine Pelisse 0332c3c346 Update OWNERS approvers and reviewers: pkg/kubectl 2016-10-27 11:38:57 -07:00
Jacob Tanenbaum a77cecb957 Implemented both the dry run and local flags.
Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112
2016-10-27 14:05:46 -04:00
Jacob Tanenbaum fe3bcad128 fixed some issues with kubectl set resources
when using kubectl set resources it resets all resource fields that are not being set.

for example
  # kubectl set resources deployments nginx --limits=cpu=100m

followed by

  # kubectl set resources deployments nginx --limits=memory=256Mi

would result in the nginx deployment only limiting memory at 256Mi with the previous
limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
only modifies fields set in that command and changed the testing so that the desired behavior
is checked.

Also a typo:

 you must specify an update to requests or limits or  (in the form of --requests/--limits)

corrected to

 you must specify an update to requests or limits (in the form of --requests/--limits)

changelog:
 - fixed a typo in hack/make-rules/test-cmd.sh "effecting" to "affecting"
2016-10-27 14:05:46 -04:00
Fabiano Franz 60fc7b87be kubectl commands must not use the factory out of Run 2016-10-27 15:38:22 -02:00
ymqytw 08d4d8dba5 Update drain test 2016-10-26 19:17:05 -07:00
deads2k 81ae13084d handle non-generated client removal 2016-10-26 16:10:41 -04:00
ymqytw c641834bb3 support editing before creating resource 2016-10-24 09:56:37 -07:00
ymqytw 8a2610c6fb fix drain test flake 2016-10-24 09:32:49 -07:00
Mike Danese df713b478c fix tests by declaring testdata 2016-10-21 17:32:32 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Kubernetes Submit Queue a7807eb5a4 Merge pull request #34138 from ingvagabund/create-restclient-interface
Automatic merge from submit-queue

Create restclient interface

Refactoring of code to allow replace *restclient.RESTClient with any RESTClient implementation that implements restclient.RESTClientInterface interface.
2016-10-21 16:02:04 -07:00
Matt Rickard 0497ffb9c6 Add boilerplate to kubectl completion bash
Small refactor to make kubectl bash and zsh completion share
boilerplate.  Previously the boilerplate was not included in the bash
script.
2016-10-21 14:07:38 -07:00
Jan Chaloupka 6079053407 Update clientset generator to use RESTClient interface instead of the RESTClient data type 2016-10-21 10:13:51 +02:00
Kubernetes Submit Queue 68e68052be Merge pull request #35115 from k82cn/k8s_35092
Automatic merge from submit-queue

Did not print 'No resources found.' if error.

fixes #35092 .
2016-10-21 01:01:32 -07:00
Kubernetes Submit Queue 10ebd65913 Merge pull request #34922 from zreigz/add-nodeport
Automatic merge from submit-queue

Add NodePort value in kubectl output

This PR enhances kubectl output after the command execution: `kubectl get svc`.
It additionally shows the value of the NodePort.

This PR is a response for this issue: https://github.com/kubernetes/kubernetes/issues/34100
2016-10-20 06:10:37 -07:00
Sami Hiltunen 66c8f60f02 kubectl: commas in --from-literal on secret creation
* Fixes an issue where commas were not accepted in --from-literal
  arguments when creating secrets. (closes #35185)
2016-10-20 14:19:40 +02:00
Kubernetes Submit Queue ad9ee6a50c Merge pull request #34778 from ymqytw/safe_kubectl_drain
Automatic merge from submit-queue

wait until the pods are deleted completely

Drain the pods on a node safely by keeping polling until all pods has been deleted.

```release-note
kubectl drain now waits until pods have been delete from the Node before exiting
```

Fixes: #34782
2016-10-20 04:45:45 -07:00
Kubernetes Submit Queue 5482fe0368 Merge pull request #35097 from nhlfr/loadbalancer-service-help
Automatic merge from submit-queue

kubectl: Fix --help output for kubectl create service loadbalancer
2016-10-20 02:10:52 -07:00
ymqytw e8fd8d50a5 address comments 2016-10-19 17:09:11 -07:00
Kubernetes Submit Queue 2de1f5c07e Merge pull request #34407 from brendandburns/kubectl-schema
Automatic merge from submit-queue

Add validation that detects repeated keys in the labels and annotations maps

Fixes #2965  (a nearly 2 year old feature request!)

@kubernetes/kubectl 

@eparis
2016-10-19 14:01:00 -07:00
Kubernetes Submit Queue 91b7e1f9c3 Merge pull request #34638 from screeley44/k8-get-sc
Automatic merge from submit-queue

Adding default StorageClass annotation printout for resource_printer and describer and some refactoring

adding ISDEFAULT for _kubectl get storageclass_ output

```
[root@screeley-sc1 gce]# kubectl get storageclass
NAME            TYPE                   ISDEFAULT
another-class   kubernetes.io/gce-pd   NO        
generic1-slow   kubernetes.io/gce-pd   YES       
generic2-fast   kubernetes.io/gce-pd   YES       
```

```release-note
Add ISDEFAULT to kubectl get storageClass output
```

@kubernetes/sig-storage
2016-10-19 11:36:08 -07:00
Kubernetes Submit Queue 5133e1f0df Merge pull request #34683 from asalkeld/cmd/testing/fake
Automatic merge from submit-queue

Move the common test functions from cmd_test.go to cmd/testing/fake.go

**What this PR does / why we need it**:
This is so that we can use NewAPIFactory() from cmd/set/*test.go
Up until now we would get a import loop error.

This commit also adds a basic unit test case for cmd/set/set_image.go

**Which issue this PR fixes**
partial #34592

**Special notes for your reviewer**:
None

**Release note**:
```release-note
NONE
```
2016-10-19 08:03:07 -07:00
Scott Creeley 86f1a94be5 Adding default StorageClass annotation printout for resource_printer 2016-10-19 10:59:07 -04:00
Klaus Ma 930cd155ad Did not print 'No resources found.' if error. 2016-10-19 20:40:11 +08:00
Ilya Dmitrichenko 2494462e5f
Get rid of output line that break automated usage of `kubectl set image` (fix #35105) 2016-10-19 13:13:20 +01:00
Michal Rostecki 957776bd9e kubectl: Fix --help output for kubectl create service loadbalancer
Fixes #35086
2016-10-19 09:06:22 +02:00
ymqytw 55c6116d66 address comments and add tests 2016-10-18 22:55:15 -07:00
Kubernetes Submit Queue 20841a5b0e Merge pull request #34537 from AdoHe/get_info
Automatic merge from submit-queue

kubectl get print filter info use verbose

add a quick fix #34469
2016-10-18 19:10:27 -07:00
ymqytw 3bd3c9570f fix test 2016-10-18 16:01:51 -07:00
ymqytw 7922a2a105 wait until the pods are deleted completely 2016-10-18 16:01:51 -07:00
Angus Salkeld d58554a647 Move the common test functions from cmd_test.go to cmd/testing/fake.go
This is so that we can use NewAPIFactory() from cmd/set/*test.go
Up until now we would get a import loop error.

This commit also adds a basic unit test case for cmd/set/set_image.go
2016-10-19 08:53:26 +10:00
Michail Kargakis 8351450a22 kubectl: do not cascade deletion for overlapping deployments 2016-10-18 17:46:34 +02:00
Kubernetes Submit Queue 1dfae3633d Merge pull request #34981 from deads2k/cli-03-supress-error
Automatic merge from submit-queue

glog non-fatal, usually unimportant error instead of fmt

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

This particular message isn't usually important, so demote it to glog.
2016-10-18 05:59:14 -07:00
deads2k ea1eefa7ff glog non-fatal, usually unimportant error instead of fmt 2016-10-18 07:58:20 -04:00
Kubernetes Submit Queue c19569f03f Merge pull request #34502 from fabianofranz/cli_usability_improvements
Automatic merge from submit-queue

Improvements to CLI usability and maintainability

Improves `kubectl` from an usability perspective by

1. Fixing how we handle terminal width in help. Some sections like the flags use the entire available width, while others like long descriptions breaks lines but don't follow a well established max width (screenshot below). This PR adds a new responsive writer that will adjust to terminal width and set 80, 100, or 120 columns as the max width, but not more than that given POSIX best practices and recommendations for better readability.
![terminal_width](https://cloud.githubusercontent.com/assets/158611/19253184/b23a983e-8f1f-11e6-9bae-667dd5981485.png)
2. Adds our own normalizers for long descriptions and cmd examples which allows us better control about how things like lists, paragraphs, line breaks, etc are printed. Features markdown support. Looks like `templates.LongDesc` and `templates.Examples` instead of `dedent.Dedend`.
3. Allows simple reordering and reuse of help and usage sections.
3. Adds `verify-cli-conventions.sh` which intends to run tests to make sure cmd developers are using what we propose as [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md). Just a couple simple tests for now but the framework is there and it's easy to extend.
4. Update [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md) to use our own normalizers instead of `dedent.Dedent`.

**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
Improves how 'kubectl' uses the terminal size when printing help and usage.
```

@kubernetes/kubectl
2016-10-17 23:41:23 -07:00
mbohlool 25afcc5522 Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
Fabiano Franz 3f7579cacb Tools for checking CLI conventions 2016-10-17 11:50:02 -02:00