Commit Graph

171 Commits (284e8182a402cfd545fc000fedaea071fed873b0)

Author SHA1 Message Date
juanvallejo 191a48f4c3 wire PrintFlags through get cmd 2018-04-25 15:02:48 -04:00
Kubernetes Submit Queue df489968b7
Merge pull request #62877 from deads2k/cli-34-describer
Automatic merge from submit-queue (batch tested with PRs 62982, 63075, 63067, 62877, 63141). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make describers more generic from the CLI

I've made this change very small so the intent and explanation make sense to people.

Clients are not generic.  Client**Configs** are generic.  We faced this distinction in the apiserver and it took us a little to hurdle it.  When you try to provide a generic example or function, you need to provide Client**Config**, not a kube clientset.  The reason is that the code you're calling may have generated their own clientset, may want to use a dynamic one, or may want to a simple restclient.  As we seek to make `kubectl` primitives more generally applicable, this is an example we'll want to follow.  I suspect we'll be making more changes along these veins as we tease out the generic pieces of `kubectl ` to make a friendly CLI library.


@kubernetes/sig-cli-maintainers 

/hold

Holding for a few days to make sure that people have time to read and digest.

```release-note
NONE
```
2018-04-25 11:53:21 -07:00
Marek Siarkowicz f0b5e2d7c5 Remove examples directory 2018-04-24 19:45:43 +01:00
David Eads 66a95a8f3e make describers more generic from the CLI 2018-04-19 16:22:42 -04:00
David Eads 484d81ab01 use recordFlags 2018-04-19 08:50:01 -04:00
David Eads e2a5c39b23 use record flags 2018-04-18 13:56:59 -04:00
Kubernetes Submit Queue a5958c4e39
Merge pull request #62300 from juanvallejo/jvallejo/wire-print-flags-delete-cmd
Automatic merge from submit-queue (batch tested with PRs 62748, 60536, 62300, 62661, 62731). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Wire PrintFlags through delete, replace, run commands

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

Wires PrintFlags through the `delete`, `replace`, and `run` commands.
All three commands grouped in this patch as they depend on DeleteOptions.

~~Tagged as WIP for now, as I still need to update tests.~~

cc @soltysh @deads2k
2018-04-17 19:53:18 -07:00
Kubernetes Submit Queue aba9d41ec0
Merge pull request #62664 from juanvallejo/jvallejo/add-record-flags-struct
Automatic merge from submit-queue (batch tested with PRs 62436, 62499, 62664, 62685, 62660). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

begin adding record flags struct

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

Begins wiring RecordFlags through the apply command.

cc @soltysh @deads2k
2018-04-17 17:31:16 -07:00
juanvallejo 813a854b99
begin adding record flags struct 2018-04-16 16:53:23 -04:00
juanvallejo 285d696157
add delete flags 2018-04-16 16:48:39 -04:00
Maciej Szulik d12a8a8d48
Move all create subcommands to its own subdirectory 2018-04-12 23:47:31 +02:00
Ayush Pateria a8c63b61ad Add basic generator for apps/v1 deployment 2018-04-11 00:44:29 +05:30
David Eads 1fec6980b6 segregate job scaling from everything else 2018-04-05 10:24:34 -04:00
Kubernetes Submit Queue 229d2df48a
Merge pull request #42873 from xilabao/add-apiresources-command
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add kubectl api-resources command

**What this PR does / why we need it**:
As the RBAC role need to be related to resources. I think we can use the command to get the supported resources. 

```
# ./cluster/kubectl.sh api-resources   
NAME                                  SHORTNAMES   APIGROUP                       NAMESPACED   KIND
bindings                                                                          true         Binding
componentstatuses                     cs                                          false        ComponentStatus
configmaps                            cm                                          true         ConfigMap
endpoints                             ep                                          true         Endpoints
events                                ev                                          true         Event
limitranges                           limits                                      true         LimitRange
namespaces                            ns                                          false        Namespace
nodes                                 no                                          false        Node
persistentvolumeclaims                pvc                                         true         PersistentVolumeClaim
persistentvolumes                     pv                                          false        PersistentVolume
pods                                  po                                          true         Pod
podtemplates                                                                      true         PodTemplate
replicationcontrollers                rc                                          true         ReplicationController
resourcequotas                        quota                                       true         ResourceQuota
secrets                                                                           true         Secret
serviceaccounts                       sa                                          true         ServiceAccount
services                              svc                                         true         Service
externaladmissionhookconfigurations                admissionregistration.k8s.io   false        ExternalAdmissionHookConfiguration
initializerconfigurations                          admissionregistration.k8s.io   false        InitializerConfiguration
customresourcedefinitions             crd          apiextensions.k8s.io           false        CustomResourceDefinition
apiservices                                        apiregistration.k8s.io         false        APIService
controllerrevisions                                apps                           true         ControllerRevision
daemonsets                            ds           apps                           true         DaemonSet
deployments                           deploy       apps                           true         Deployment
replicasets                           rs           apps                           true         ReplicaSet
statefulsets                          sts          apps                           true         StatefulSet
tokenreviews                                       authentication.k8s.io          false        TokenReview
localsubjectaccessreviews                          authorization.k8s.io           true         LocalSubjectAccessReview
selfsubjectaccessreviews                           authorization.k8s.io           false        SelfSubjectAccessReview
subjectaccessreviews                               authorization.k8s.io           false        SubjectAccessReview
horizontalpodautoscalers              hpa          autoscaling                    true         HorizontalPodAutoscaler
jobs                                               batch                          true         Job
certificatesigningrequests            csr          certificates.k8s.io            false        CertificateSigningRequest
daemonsets                            ds           extensions                     true         DaemonSet
deployments                           deploy       extensions                     true         Deployment
ingresses                             ing          extensions                     true         Ingress
networkpolicies                       netpol       extensions                     true         NetworkPolicy
podsecuritypolicies                   psp          extensions                     false        PodSecurityPolicy
replicasets                           rs           extensions                     true         ReplicaSet
networkpolicies                       netpol       networking.k8s.io              true         NetworkPolicy
poddisruptionbudgets                  pdb          policy                         true         PodDisruptionBudget
clusterrolebindings                                rbac.authorization.k8s.io      false        ClusterRoleBinding
clusterroles                                       rbac.authorization.k8s.io      false        ClusterRole
rolebindings                                       rbac.authorization.k8s.io      true         RoleBinding
roles                                              rbac.authorization.k8s.io      true         Role
podpresets                                         settings.k8s.io                true         PodPreset
storageclasses                        sc           storage.k8s.io                 false        StorageClass
```
**Which issue this PR fixes**: fixes https://github.com/kubernetes/kubernetes/issues/42932

**Special notes for your reviewer**:

**Release note**:

```release-note
add kubectl api-resources command to discovery of resources
```
2018-04-03 14:35:09 -07:00
p0lyn0mial 1f1d24005a removes custom scalers from kubectl 2018-03-26 19:33:42 +02:00
xilabao 110641b34c add kubectl api-resources command 2018-03-09 17:47:17 +08:00
Manuel de Brito Fontes 02370e529b
Remove cassandra example 2018-02-26 20:39:07 -03:00
Kubernetes Submit Queue f7c65005a4
Merge pull request #59042 from soltysh/issue25442
Automatic merge from submit-queue (batch tested with PRs 60302, 57921, 59042, 60126, 59561). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove pkg/client/unversioned

**What this PR does / why we need it**:
This is removing unused package, and moves the used bits into appropriate placeholders. 

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

**Special notes for your reviewer**:

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

/assign @deads2k 
/assign @sttts
2018-02-23 14:01:44 -08:00
Maciej Szulik 8bf4cfcf60
Add kubectl create job --from=cronjob/<name> 2018-02-22 14:30:37 +01:00
Edmund Rhudy 5b57c2db00
Fixes #47538: Add functionality for manually creating a Job instance from a CronJob
This changeset adds the command `kubectl create job` with the flag `--from-cronjob`, which allows a user to create a Job from a CronJob via the CLI.
2018-02-22 14:30:37 +01:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
Maciej Szulik 5d721bff81
Remove pkg/client/unversioned 2018-02-21 13:08:11 +01:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Frederic Branczyk b1448adb59
kubectl: Use metrics-server for kubectl top commands 2018-01-22 21:45:06 +01:00
linweibin fa8afc1d39 Remove unused code in UT files in pkg/ 2018-01-15 16:02:35 +08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
ymqytw 0b0004e0c0 support openapi in apply 2017-11-21 10:22:43 -08:00
Antoine Pelisse 1d99b763df Show openapi custom columns in `kubectl get`
Change the name of the flag to something slightly more user-friendly,
while making it default true. The flag is kept so that someone can
revert it temporarly if things go wrong.
2017-11-15 14:02:27 -08:00
Kubernetes Submit Queue 0ca74ef2e3
Merge pull request #54858 from wackxu/createpri
Automatic merge from submit-queue (batch tested with PRs 54460, 55258, 54858, 55506, 55510). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add create subcommand for priorityclass

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

add `create priorityclass` sub command


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

**Special notes for your reviewer**:

**Release note**:

```release-note
add create priorityclass sub command
```
2017-11-11 10:45:23 -08:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
wackxu 741c58be7f add create subcommand for priorityclass 2017-11-07 15:03:01 +08:00
Kubernetes Submit Queue 658024c2d7
Merge pull request #54846 from zjj2wry/remove-kubectl-dep
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove kubectl dependency internal version

**What this PR does / why we need it**:
ref kubernetes/kubectl#83

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

**Special notes for your reviewer**:
use `k8s.io/api/core/v1` replace `k8s.io/kubernetes/pkg/api`

use `k8s.io/client-go/kubernetes/typed/core/v1` replace `k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/internalversion`

**Release note**:

```release-note
NONE
```
2017-11-06 06:34:40 -08:00
Mengqi Yu b518a80cef add test for convert 2017-11-01 01:14:24 -07:00
zhengjiajin fe0f461cea remove dependency from top command 2017-10-31 16:15:32 +08:00
Clayton Coleman 93fed120fb
Move printing the valid resource types to a function
Should be calculated from discovery in the future. Also improve
descriptions on the affected commands.
2017-10-30 23:45:45 -04:00
ymqytw 4487cc5e15 switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
Ferran Rodenas c1802dc472 Update kubectl drain command to use policy V1Beta1 instead of unversioned API
Signed-off-by: Ferran Rodenas <frodenas@gmail.com>
2017-10-25 16:44:57 +02:00
Antoine Pelisse 011a45cde7 Implement `kubectl alpha diff` to diff resources
`kubectl alpha diff` lets you diff your resources against live
resources, or last applied, or even preview what changes are going to be
applied on the cluster.

This is still quite premature, and mostly untested.
2017-10-23 10:49:02 -07:00
Antoine Pelisse 3ed58475c4 Update openapi to use kube-openapi code 2017-10-20 09:21:06 -07:00
Dr. Stefan Schimanski cad0364e73 Update bazel 2017-10-18 17:24:04 +02:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Jordan Liggitt 0218cee931
Improve generated proxy URLs for cluster-info 2017-10-13 16:30:12 -04:00
zhengjiajin 7a57754921 RBAC: Add test for create clusterrolebindding 2017-10-09 13:59:01 +08:00
Antoine Pelisse 249caa95b5 Rewrite `kubectl explain` to use openapi
This removes all dependencies on swagger 1.2 for explain.
2017-10-03 09:44:11 -07:00
zhengjiajin 44f8bb1171 remove todo(#42787)Add fallback for cronjobs, and move some useful function to cmdutil 2017-09-04 18:41:19 +08:00
Maciej Szulik 6962427b35
Enable batch/v1beta1.CronJobs by default 2017-09-03 11:17:33 +02:00
Antoine Pelisse d7eec6b51d Revert "Enable batch/v1beta1.CronJobs by default" 2017-08-31 09:54:16 -07:00
Maciej Szulik 2de214b044
Enable batch/v1beta1.CronJobs by default 2017-08-29 09:31:39 +02:00
ymqytw b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07:00
shiywang d14660c271 remove deprecated command 'kubectl stop' 2017-08-16 08:34:44 +08:00