fix docs (#24)

Signed-off-by: hantmac <hantmac@outlook.com>
This commit is contained in:
Jeremy 2021-10-22 10:23:15 +08:00 committed by GitHub
parent 5b20eb99cd
commit 65a8d4b1f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 16 deletions

View File

@ -26,17 +26,24 @@ By now the `rollout` cmd such as `rollout undo`, `rollout status`, `rollout hist
$kubectl-kruise --help
kubectl-kruise controls the OpenKruise manager.
Find more information at: https://openkruise.io/en-us/docs/what_is_openkruise.html
Find more information at: https://openkruise.io/
Aliases:
kubectl-kruise, kk
CloneSet Commands:
rollout Manage the rollout of a resource
scale Set a new size for a Deployment, ReplicaSet or Replication Controller
autoscale Auto-scale a Deployment, ReplicaSet, or ReplicationController
set Set specific features on objects
migrate Migrate from K8s original workloads to Kruise workloads
AdvancedStatefulSet Commands:
rollout Manage the rollout of a resource
set Set specific features on objects
Basic Commands:
scale Set a new size for a CloneSet, Deployment, ReplicaSet or Replication Controller
autoscale Auto-scale a CloneSet, Deployment, ReplicaSet, or ReplicationController
Cluster Management Commands:
certificate Modify certificate resources.
cluster-info Display cluster info
@ -74,7 +81,6 @@ Usage:
Use "kubectl-kruise <command> --help" for more information about a given command.
Use "kubectl-kruise options" for a list of global command-line options (applies to all commands).
```
Currently it also supports to migrate Pods from Deployment to CloneSet by `kruise migrate [options]`.
@ -112,12 +118,17 @@ $ kubectl-kruise migrate --help
--user string The name of the kubeconfig user to use
--username string Username for basic authentication to the API server
Use "kruise [command] --help" for more information about a command.
Use "kubectl-kruise [command] --help" for more information about a command.
```
### TODO
#### kubectl kruise migrate
* [x] migrate [options]
> kubectl-kruise migrate demo
```bash
kubectl kruise migrate CloneSet --from Deployment --src-name deployment-demo --dst-name cloneset-demo --create --copy
```
#### kubectl kruise rollout for CloneSet workload
* [x] undo

View File

@ -18,14 +18,13 @@ package cmd
import (
"flag"
"github.com/openkruise/kruise-tools/pkg/cmd/migrate"
"io"
"os"
"github.com/openkruise/kruise-tools/pkg/cmd/migrate"
krollout "github.com/openkruise/kruise-tools/pkg/cmd/rollout"
"github.com/spf13/cobra"
kset "github.com/openkruise/kruise-tools/pkg/cmd/set"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/tools/clientcmd"
cliflag "k8s.io/component-base/cli/flag"
@ -325,7 +324,7 @@ func NewKubectlCommand(in io.Reader, out, err io.Writer) *cobra.Command {
kubectl-kruise controls the OpenKruise manager.
Find more information at:
https://openkruise.io/en-us/docs/what_is_openkruise.html`),
https://openkruise.io/`),
Run: runHelp,
// Hook before and after Run initialize and write profiles to disk,
// respectively.
@ -375,19 +374,27 @@ func NewKubectlCommand(in io.Reader, out, err io.Writer) *cobra.Command {
ioStreams := genericclioptions.IOStreams{In: in, Out: out, ErrOut: err}
groups := templates.CommandGroups{
{
Message: "Basic Commands:",
Commands: []*cobra.Command{
kset.NewCmdSet(f, ioStreams),
},
},
{
Message: "CloneSet Commands:",
Commands: []*cobra.Command{
krollout.NewCmdRollout(f, ioStreams),
kset.NewCmdSet(f, ioStreams),
migrate.NewCmdMigrate(f, ioStreams),
},
},
{
Message: "AdvancedStatefulSet Commands:",
Commands: []*cobra.Command{
krollout.NewCmdRollout(f, ioStreams),
kset.NewCmdSet(f, ioStreams),
},
},
{
Message: "Basic Commands:",
Commands: []*cobra.Command{
scale.NewCmdScale(f, ioStreams),
autoscale.NewCmdAutoscale(f, ioStreams),
migrate.NewCmdMigrate(f, ioStreams),
},
},
{