From 8db418b7e131b8e301762cec14ff2dd47807d838 Mon Sep 17 00:00:00 2001 From: wuyan-dushang <1550693033@qq.com> Date: Wed, 13 Sep 2023 22:58:24 +0800 Subject: [PATCH] add docs and fix authorization --- .licenserc.yaml | 1 + app/dubboctl/cmd/create.go | 19 +- app/dubboctl/cmd/root_test.go | 11 +- .../internal/dubbo/repositories_test.go | 2 +- app/dubboctl/internal/testing/testing.go | 4 +- docs/cmd/dubboctl/Concepts.md | 186 ++++++++++++++++++ docs/cmd/dubboctl/Customize-Template.md | 121 ++++++++++++ docs/cmd/dubboctl/envs.md | 48 +++++ docs/cmd/dubboctl/quick_start.md | 31 +++ docs/cmd/dubboctl/reference/dubboctl.md | 21 ++ docs/cmd/dubboctl/reference/dubboctl_build.md | 22 +++ .../cmd/dubboctl/reference/dubboctl_create.md | 60 ++++++ .../dubboctl/reference/dubboctl_dashboard.md | 29 +++ .../reference/dubboctl_dashboard_admin.md | 30 +++ .../reference/dubboctl_dashboard_grafana.md | 28 +++ .../reference/dubboctl_dashboard_nacos.md | 28 +++ .../dubboctl_dashboard_prometheus.md | 28 +++ .../dubboctl_dashboard_skywalking.md | 28 +++ .../reference/dubboctl_dashboard_zipkin.md | 28 +++ .../cmd/dubboctl/reference/dubboctl_deploy.md | 42 ++++ .../dubboctl/reference/dubboctl_manifest.md | 23 +++ .../reference/dubboctl_manifest_diff.md | 24 +++ .../reference/dubboctl_manifest_generate.md | 26 +++ .../reference/dubboctl_manifest_install.md | 25 +++ .../reference/dubboctl_manifest_uninstall.md | 27 +++ .../dubboctl/reference/dubboctl_profile.md | 17 ++ .../reference/dubboctl_profile_diff.md | 22 +++ .../reference/dubboctl_profile_list.md | 22 +++ .../dubboctl/reference/dubboctl_repository.md | 136 +++++++++++++ .../reference/dubboctl_repository_add.md | 17 ++ .../reference/dubboctl_repository_list.md | 20 ++ .../reference/dubboctl_repository_remove.md | 20 ++ .../reference/dubboctl_repository_rename.md | 20 ++ go.mod | 3 +- pkg/dds/kube/crdclient/handler_test.go | 4 +- 35 files changed, 1148 insertions(+), 25 deletions(-) create mode 100644 docs/cmd/dubboctl/Concepts.md create mode 100644 docs/cmd/dubboctl/Customize-Template.md create mode 100644 docs/cmd/dubboctl/envs.md create mode 100644 docs/cmd/dubboctl/quick_start.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_build.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_create.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_dashboard.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_dashboard_admin.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_dashboard_grafana.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_dashboard_nacos.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_dashboard_prometheus.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_dashboard_skywalking.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_dashboard_zipkin.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_deploy.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_manifest.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_manifest_diff.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_manifest_generate.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_manifest_install.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_manifest_uninstall.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_profile.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_profile_diff.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_profile_list.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_repository.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_repository_add.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_repository_list.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_repository_remove.md create mode 100644 docs/cmd/dubboctl/reference/dubboctl_repository_rename.md diff --git a/.licenserc.yaml b/.licenserc.yaml index 3985b4938..d9f61f60d 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -81,6 +81,7 @@ header: - '**/templates/**' - '**/testdata/**' - '**/deploy.tpl' + - '**/docs/**' comment: on-failure license-location-threshold: 130 diff --git a/app/dubboctl/cmd/create.go b/app/dubboctl/cmd/create.go index 1ccb68930..edb8de38d 100644 --- a/app/dubboctl/cmd/create.go +++ b/app/dubboctl/cmd/create.go @@ -44,17 +44,17 @@ type ErrInvalidTemplate error func addCreate(baseCmd *cobra.Command, newClient ClientFactory) { cmd := &cobra.Command{ Use: "create", - Short: "Create a application", + Short: "Create an application", Long: ` NAME - {{.Name}} create - Create a function + {{.Name}} create - Create an application SYNOPSIS {{.Name}} create [-l|--language] [-t|--template] [-r|--repository] [-c|--confirm] [path] DESCRIPTION - Creates a new function project. + Creates a new application. $ {{.Name}} create -l go @@ -67,6 +67,9 @@ DESCRIPTION To complete this command interactively, use --confirm (-c): $ {{.Name}} create -c + Initialize the current project directly into a dubbo project without using a template + $ dubboctl create --init + Available Language Runtimes and Templates: {{ .Options | indent 2 " " | indent 1 "\t" }} @@ -78,11 +81,11 @@ EXAMPLES handles http events (the default template). $ {{.Name}} create -l java - o Create a java common in the directory 'myfunc'. - $ {{.Name}} create -l java myfunc + o Create a java common in the directory 'mydubbo'. + $ {{.Name}} create -l java mydubbo - o Create a Main common in ./myfunc. - $ {{.Name}} create -l go -t common myfunc + o Create a Main common in ./mydubbo. + $ {{.Name}} create -l go -t common mydubbo `, SuggestFor: []string{"vreate", "creaet", "craete", "new"}, PreRunE: bindEnv("language", "template", "repository", "confirm", "init"), @@ -97,7 +100,7 @@ EXAMPLES cmd.Flags().StringP("template", "t", "", "Application template. (see help text for list) ($DUBBO_TEMPLATE)") cmd.Flags().StringP("repository", "r", "", "URI to a Git repository containing the specified template ($DUBBO_REPOSITORY)") cmd.Flags().BoolP("init", "i", false, - "") + "Initialize the current project directly into a dubbo project without using a template") addConfirmFlag(cmd, false) diff --git a/app/dubboctl/cmd/root_test.go b/app/dubboctl/cmd/root_test.go index 839649332..1e929cfd9 100644 --- a/app/dubboctl/cmd/root_test.go +++ b/app/dubboctl/cmd/root_test.go @@ -18,7 +18,6 @@ package cmd import ( "io" "os" - "path/filepath" "strings" "testing" @@ -32,15 +31,7 @@ func fromTempDirectory(t *testing.T) string { t.Helper() ClearEnvs(t) - // We have to define KUBECONFIG, or the file at ~/.kube/config (if extant) - // will be used (disrupting tests by using the current user's environment). - // The test kubeconfig set below has the current namespace set to 'func' - // NOTE: the below settings affect unit tests only, and we do explicitly - // want all unit tests to start in an empty environment with tests "opting in" - // to config, not opting out. - t.Setenv("KUBECONFIG", filepath.Join(cwd(), "testdata", "default_kubeconfig")) - - // By default unit tests presum no config exists unless provided in testdata. + // By default unit tests presume no config exists unless provided in testdata. t.Setenv("XDG_CONFIG_HOME", t.TempDir()) // creates and CDs to a temp directory diff --git a/app/dubboctl/internal/dubbo/repositories_test.go b/app/dubboctl/internal/dubbo/repositories_test.go index d2c0f9820..c8afa23fe 100644 --- a/app/dubboctl/internal/dubbo/repositories_test.go +++ b/app/dubboctl/internal/dubbo/repositories_test.go @@ -76,7 +76,7 @@ func TestRepositories_Get(t *testing.T) { } // TestRepositories_All ensures repos are returned from -// .All accessor. Tests both builtin and buitlin+extensible cases. +// .All accessor. Tests both builtin and building+extensible cases. func TestRepositories_All(t *testing.T) { uri := ServeRepo(RepositoriesTestRepo, t) root, rm := Mktemp(t) diff --git a/app/dubboctl/internal/testing/testing.go b/app/dubboctl/internal/testing/testing.go index 8d671d752..e61083e8a 100644 --- a/app/dubboctl/internal/testing/testing.go +++ b/app/dubboctl/internal/testing/testing.go @@ -227,11 +227,11 @@ func Cwd() (cwd string) { // ClearEnvs sets all environment variables with the prefix of FUNC_ to // empty (unsets) for the duration of the test t and is used when -// a test needs to completely clear dubbo-releated envs prior to running. +// a test needs to completely clear dubbo-related envs prior to running. func ClearEnvs(t *testing.T) { t.Helper() for _, v := range os.Environ() { - if strings.HasPrefix(v, "FUNC_") { + if strings.HasPrefix(v, "DUBBO_") { parts := strings.SplitN(v, "=", 2) t.Setenv(parts[0], "") } diff --git a/docs/cmd/dubboctl/Concepts.md b/docs/cmd/dubboctl/Concepts.md new file mode 100644 index 000000000..32308c38c --- /dev/null +++ b/docs/cmd/dubboctl/Concepts.md @@ -0,0 +1,186 @@ +# Concepts + +## dubboctl Manifest and Profile + +### Manifest + +Dubbo-kubernetes, as a central control component, needs to launch various components such as Grafana, Prometheus, +Skywalking, Zipkin, Nacos, Zookeeper, etc., to provide additional functionality. In a Kubernetes environment, the +configuration YAML that describes these components is referred to as the "manifest." It's also the final result +processed by dubboctl, which can be used with tools like kubectl to directly launch the required components. + +Dubboctl utilizes the Helm API to render the Helm Charts for various components to generate the manifest. Among these, +the Helm Charts for Admin and Nacos are maintained by the Dubbo-admin community, while other mature components use Helm +Charts provided by their official sources. (For more information on how Helm works, please refer +to https://helm.sh/zh/docs/) + +### DubboConfig YAML (Profile) + +DubboConfig YAML and Profile essentially have the same format and field meanings in YAML configuration files. However, +they serve different purposes and are kept separate. DubboConfig YAML is user-facing and represents custom requirements, +whereas profiles are refined and provided by Dubbo-admin (users can also set custom profiles) to represent basic +configurations for different scenarios. Currently, the community offers two types of profiles: "default" and "demo." + +A typical DubboConfig YAML looks like this: + +```yaml +# DubboConfig example +apiVersion: dubbo.apache.org/v1alpha1 +kind: DubboConfig +metadata: + namespace: dubbo-system +spec: + # kubectl basic metadata + + # Profile specifies the base default configuration to use. If using the profile provided by Dubbo-admin, + # you can currently specify either "default" or "demo." + profile: default + namespace: dubbo-system + + # Metadata for configuring components. For components maintained by Dubbo-admin, you can configure "enabled," + # while other mature components can have repository URLs and Helm Chart versions. + componentsMeta: + # Components maintained by Dubbo-admin + admin: + enabled: true + # Mature components + grafana: + enabled: true + repoURL: https://grafana.github.io/helm-charts + version: 6.52.4 + + # Configure each component, where the values in components.admin and components.grafana fields + # will be mapped directly to the values.yaml of the respective Helm Chart. + components: + admin: + replicas: 2 + grafana: + testFramework: + enabled: true +``` + +The default profile is as follows: + +```yaml +apiVersion: dubbo.apache.org/v1alpha1 +kind: DubboOperator +metadata: + namespace: dubbo-system +spec: + profile: default + namespace: dubbo-system + # The default profile launches admin and zookeeper components by default + componentsMeta: + admin: + enabled: true + zookeeper: + enabled: true + repoURL: https://charts.bitnami.com/bitnami + version: 11.1.6 +``` + +The demo profile is as follows: + +```yaml +apiVersion: dubbo.apache.org/v1alpha1 +kind: DubboOperator +metadata: + namespace: dubbo-system +spec: + profile: demo + namespace: dubbo-system + # The demo profile launches all components by default + componentsMeta: + admin: + enabled: true + grafana: + enabled: true + repoURL: https://grafana.github.io/helm-charts + version: 6.52.4 + nacos: + enabled: true + zookeeper: + enabled: true + repoURL: https://charts.bitnami.com/bitnami + version: 11.1.6 + prometheus: + enabled: true + repoURL: https://prometheus-community.github.io/helm-charts + version: 20.0.2 + skywalking: + enabled: true + repoURL: https://apache.jfrog.io/artifactory/skywalking-helm + version: 4.3.0 + zipkin: + enabled: true + repoURL: https://openzipkin.github.io/zipkin + version: 0.3.0 +``` + +You can see that DubboConfig consists of three parts: dubboctl metadata, componentsMeta, and components. The dubboctl +metadata can specify the profile, componentsMeta controls the toggles for components, and mature components can have +repository addresses and Helm Chart versions specified. Here, let's focus on components. As mentioned in the manifest +section, dubboctl uses the Helm API to render Helm Charts, and the values.yaml required by each chart is derived from +the field values in the components section. For example, the values in components.admin will be directly mapped to the +values.yaml of the Dubbo-kubernetes +chart (https://github.com/apache/dubbo-kubernetes/blob/master/deploy/charts/dubbo-admin/values.yaml). + +### Overlay + +Profiles, as basic configuration items, can be applied over user-defined DubboConfig YAML using an Overlay mechanism. +For example, overlaying the DubboConfig YAML example from the previous section onto the default profile results in: + +```yaml +# DubboConfig example +apiVersion: dubbo.apache.org/v1alpha1 +kind: DubboConfig +metadata: + namespace: dubbo-system +spec: + # kubectl basic metadata + + # Profile specifies the base default configuration to use. If using the profile provided by Dubbo-admin, + # you can currently specify either "default" or "demo." + profile: default + namespace: dubbo-system + + # Metadata for configuring components. For components maintained by Dubbo-admin, you can configure "enabled," + # while other mature components can have repository URLs and Helm Chart versions. + componentsMeta: + # Components maintained by Dubbo-admin + admin: + enabled: true + # Mature components + grafana: + enabled: true + repoURL: https://grafana.github.io/helm-charts + version: 6.52.4 + zookeeper: + enabled: true + repoURL: https://charts.bitnami.com/bitnami + version: 11.1.6 + + # Configure each component, where the values in components.admin and components.grafana fields + # will be mapped directly to the values.yaml of the respective Helm Chart. + components: + admin: + replicas: 2 + grafana: + testFramework: + enabled: true +``` + +Currently, Overlay is implemented using JSON Merge Patch (https://datatracker.ietf.org/doc/html/rfc7396). + +## dubboctl Create + +### .dubbo Directory + +When you create an application using dubboctl in the correct manner, you'll notice that a ".dubbo" directory is +generated. The purpose of this hidden file is to determine whether the application needs to build an image. If the code +hasn't been changed, it won't build an image by default unless you include the "--force" flag. + +## dubbo.yaml + +dubbo.yaml is a metadata recording file that contains a portion of the data used by dubboctl when it runs. Some of your +actions will be recorded in dubbo.yaml, and it takes precedence when you use \ No newline at end of file diff --git a/docs/cmd/dubboctl/Customize-Template.md b/docs/cmd/dubboctl/Customize-Template.md new file mode 100644 index 000000000..e0788f59c --- /dev/null +++ b/docs/cmd/dubboctl/Customize-Template.md @@ -0,0 +1,121 @@ +# How to Customize and Build a Template + +You can refer to this project: https://github.com/sjmshsh/dubboctl-samples + +Here's the directory structure for `dubboctl-samples`: + +``` +shCopy code. +├── go +│ ├── grpc +│ │ ├── api +│ │ │ ├── generate.sh +│ │ │ ├── samples_api.pb.go +│ │ │ ├── samples_api.proto +│ │ │ └── samples_api_triple.pb.go +│ │ ├── cmd +│ │ │ └── client.go +│ │ ├── conf +│ │ │ └── dubbogo.yml +│ │ └── go.mod +│ └── mesh +│ ├── api +│ │ ├── generate.sh +│ │ ├── samples_api.pb.go +│ │ ├── samples_api.proto +│ │ └── samples_api_triple.pb.go +│ ├── cmd +│ │ └── client.go +│ ├── conf +│ │ └── dubbogo.yml +│ └── go.mod +└── java + ├── metrics + │ ├── case-configuration.yml + │ ├── case-versions.conf + │ ├── pom.xml + │ ├── README.md + │ └── src + │ ├── main + │ │ ├── java + │ │ │ └── org + │ │ │ └── apache + │ │ │ └── dubbo + │ │ │ └── samples + │ │ │ └── metrics + │ │ │ ├── api + │ │ │ │ └── DemoService.java + │ │ │ ├── EmbeddedZooKeeper.java + │ │ │ ├── impl + │ │ │ │ └── DemoServiceImpl.java + │ │ │ ├── MetricsConsumer.java + │ │ │ ├── MetricsProvider.java + │ │ │ └── model + │ │ │ ├── Result.java + │ │ │ └── User.java + │ │ └── resources + │ │ ├── log4j.properties + │ │ └── spring + │ │ ├── dubbo-demo-consumer.xml + │ │ └── dubbo-demo-provider.xml + │ └── test + │ └── java + │ └── org + │ └── apache + │ └── dubbo + │ └── samples + │ └── metrics + │ └── MetricsServiceIT.java + └── spring-xml + ├── case-configuration.yml + ├── case-versions.conf + ├── pom.xml + └── src + ├── main + │ ├── java + │ │ └── org + │ │ └── apache + │ │ └── dubbo + │ │ └── samples + │ │ ├── api + │ │ │ └── GreetingsService.java + │ │ ├── client + │ │ │ ├── AlwaysApplication.java + │ │ │ └── Application.java + │ │ └── provider + │ │ ├── Application.java + │ │ └── GreetingsServiceImpl.java + │ └── resources + │ ├── log4j.properties + │ └── spring + │ ├── dubbo-demo-consumer.xml + │ └── dubbo-demo-provider.xml + └── test + └── java + └── org + └── apache + └── dubbo + └── samples + └── test + └── GreetingsServiceIT.java +``` + +In a nutshell: + +``` +shCopy code. +├── go +│ ├── grpc +│ └── mesh +└── java + ├── metrics + └── spring-xml +``` + +"go" and "java" represent your runtime language. "grpc," "mesh," "metrics," and "spring-xml" are the application names. +The specific template code should be written in the "grpc," "mesh," "metrics," or "spring-xml" directories. + +Now that you've customized and built your template, you can proceed to read the instructions in the dubboctl repository +on how to add your custom-built template to the repository. + +This guide should help you understand the structure and process in a straightforward manner. \ No newline at end of file diff --git a/docs/cmd/dubboctl/envs.md b/docs/cmd/dubboctl/envs.md new file mode 100644 index 000000000..a1bb1c900 --- /dev/null +++ b/docs/cmd/dubboctl/envs.md @@ -0,0 +1,48 @@ +## Use of environment variables in projects + +Among the common commands create, repository, build and deploy. We will see that there are many flags. For example, the +deploy flags are as follows: + +```sh + -a, --apply Whether to apply the application to the k8s cluster by the way + -b, --builder-image string Specify a custom builder image for use by the builder other than its default. + --containerPort int The port of the deployment to listen on pod (required) + -e, --envs stringArray Environment variable to set in the form NAME=VALUE. This is for the environment variables passed in by the builderpack build method. + -f, --force Whether to force push + -h, --help help for deploy + -i, --image string Container image( [registry]/[namespace]/[name]:[tag] ) + --imagePullPolicy string The image pull policy of the deployment, default to IfNotPresent + --limitCpu int The limit cpu to deploy (default 1000) + --limitMem int The limit memory to deploy (default 1024) + --maxReplicas int The max replicas to deploy (default 10) + --minReplicas int The min replicas to deploy (default 3) + --name string The name of deployment (required) + -n, --namespace string Deploy into a specific namespace (default "dubbo-system") + --nobuild Skip the step of building the image. + --nodePort int The nodePort of the deployment to expose + -o, --output string output kubernetes manifest (default "kube.yaml") + -p, --path string Path to the application. Default is current directory ($DUBBO_PATH) + --push Whether to push the image to the registry center by the way + --replicas int The number of replicas to deploy (default 3) + --requestCpu int The request cpu to deploy (default 500) + --requestMem int The request memory to deploy (default 512) + --revisions int The number of replicas to deploy (default 5) + --secret string The secret to image pull from registry + --serviceAccount string TheServiceAccount for the deployment + --targetPort int The targetPort of the deployment, default to port + -d, --useDockerfile Use the dockerfile with the specified path to build +``` + +We can add it to the environment variable with the prefix of `DUBBO_` and the non-abbreviated notation of flags in all +capital letters. Subsequent operations will give priority to the value in the environment variable. The priority order +from large to small is: environment variables, command line flags, dubbo.yaml. + +As an example: + +```sh +export DUBBO_PUSH=true +``` + +Add the --push flag to the environment variables + +Therefore, future operations PUSH will always be true unless the setting of the environment variable is cancelled. \ No newline at end of file diff --git a/docs/cmd/dubboctl/quick_start.md b/docs/cmd/dubboctl/quick_start.md new file mode 100644 index 000000000..4492485e4 --- /dev/null +++ b/docs/cmd/dubboctl/quick_start.md @@ -0,0 +1,31 @@ +# Quick start + +## Install components + +Follow the components required by the dubbo project, such as admin and zookeeper. + +```sh +dubboctl manifest install +``` + +## Initialize dubbo project + +```sh +dubboctl create -l java +``` + +Initialize a java project in the current directory using the default template provided by dubboctl. Please make sure the current directory is an empty directory. + +## Deploy to k8s + +```sh +dubboctl deploy --containerPort 20000 --push --image docker.io/testuser/testdubbo:latest --apply +``` + + + +> If you do not plan to deploy the application to k8s, please use the build command to build the image and replace the third step with +> +> ```sh +> dubboctl build --push --image docker.io/testuser/testdubbo:latest +> ``` \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl.md b/docs/cmd/dubboctl/reference/dubboctl.md new file mode 100644 index 000000000..a8c53a5d0 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl.md @@ -0,0 +1,21 @@ +## dubboctl + +dubbo control interface + +### Synopsis + +dubbo control interface + +``` + -h, --help help for config +``` + +### SEE ALSO + +* [dubboctl manifest](dubboctl_manifest.md) - Commands help user to generate manifest and install manifest +* [dubboctl profile](dubboctl_profile.md) - Commands help user to list and describe profiles +* [dubboctl dashboard](dubboctl_dashboard.md) - Commands help user to open control plane components dashboards directly. +* [dubboctl repository](dubboctl_repository.md) - Manage set of installed repositories. +* [dubboctl create](dubboctl_create.md) - Create an application +* [dubboctl build](dubboctl_build.md) - Build an application container locally without deploying +* [dubboctl deploy](dubboctl_deploy.md) - Deploy an application \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_build.md b/docs/cmd/dubboctl/reference/dubboctl_build.md new file mode 100644 index 000000000..f8766e5c0 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_build.md @@ -0,0 +1,22 @@ +## dubboctl build + +Build an application container locally without deploying + +### Synopsis + + Usage: + dubboctl build [flags] + + Flags: + -b, --builder-image string Specify a custom builder image for use by the builder other than its default. + -e, --envs stringArray environment variable for an application, KEY=VALUE format + -f, --force Whether to force push + -h, --help help for build + -i, --image string Container image( [registry]/[namespace]/[name]:[tag] ) + -p, --path string Path to the application. Default is current directory ($DUBBO_PATH) + --push Whether to push the image to the registry center by the way + -d, --useDockerfile Use the dockerfile with the specified path to build + +### SEE ALSO + +* [dubboctl](dubboctl.md) - Management tool for dubbo-kubernetes \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_create.md b/docs/cmd/dubboctl/reference/dubboctl_create.md new file mode 100644 index 000000000..b510e7deb --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_create.md @@ -0,0 +1,60 @@ +## dubboctl create + +Create an application + +### Synopsis + + dubboctl create [-l|--language] [-t|--template] [-r|--repository] + [-c|--confirm] [path] + +### DESCRIPTION + + Creates a new function project. + + $ dubboctl create -l go + + Creates a function in the current directory '.' which is written in the + language/runtime 'go' common . + + If [path] is provided, the function is initialized at that path, creating + the path if necessary. + + To complete this command interactively, use --confirm (-c): + $ dubboctl create -c + + To install more language runtimes and their templates see 'dubboctl repository'. + +### EXAMPLES + + o Create a Node.js function in the current directory (the default path) which + handles http events (the default template). + $ dubboctl create -l java + + o Create a java common in the directory 'myfunc'. + $ dubboctl create -l java myfunc + + o Create a Main common in ./myfunc. + $ dubboctl create -l go -t common myfunc + +-t is followed by the warehouse name + application name. If it is the template provided by dubboctl by default, then there is only the application name, which is common. Otherwise, for example, if the user's warehouse is named ruiyi and the application is named mesh, -t should be followed by ruiyi/mesh. + +### Usage: + + dubboctl create [flags] + +### Aliases: + + create, init + +### Flags: + + -c, --confirm Prompt to confirm options interactively ($DUBBO_CONFIRM) + -h, --help help for create + -i, --init Initialize the current project directly into a dubbo project without using a template + -l, --language string Language Runtime (see help text for list) ($DUBBO_LANGUAGE) + -r, --repository string URI to a Git repository containing the specified template ($DUBBO_REPOSITORY) + -t, --template string Application template. (see help text for list) ($DUBBO_TEMPLATE) + +### SEE ALSO + +* [dubboctl](dubboctl.md) - Management tool for dubbo-kubernetes \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_dashboard.md b/docs/cmd/dubboctl/reference/dubboctl_dashboard.md new file mode 100644 index 000000000..3f5828fa3 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_dashboard.md @@ -0,0 +1,29 @@ +## dubboctl dashboard + +Commands help user to open control plane components dashboards directly. Now support Admin, Grafana, Nacos, Prometheus, +Skywalking and Zipkin + +### Synopsis + +Commands help user to open control plane components dashboards directly. Now support Admin, Grafana, Nacos, Prometheus, +Skywalking and Zipkin + +``` + -h, --help help for config +``` + +### SEE ALSO + +* [dubboctl](dubboctl.md) - Management tool for dubbo-kubernetes +* [dubboctl dashboard admin](dubboctl_dashboard_admin.md) - create PortForward between local address and target + component admin pod. +* [dubboctl dashboard grafana](dubboctl_dashboard_grafana.md) - create PortForward between local address and target + component grafana pod. +* [dubboctl dashboard nacos](dubboctl_dashboard_nacos.md) - create PortForward between local address and target + component nacos pod. +* [dubboctl dashboard prometheus](dubboctl_dashboard_prometheus.md) - create PortForward between local address and + target component prometheus pod. +* [dubboctl dashboard skywalking](dubboctl_dashboard_skywalking.md) - create PortForward between local address and + target component skywalking pod. +* [dubboctl dashboard zipkin](dubboctl_dashboard_zipkin.md) - create PortForward between local address and target + component zipkin pod. \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_dashboard_admin.md b/docs/cmd/dubboctl/reference/dubboctl_dashboard_admin.md new file mode 100644 index 000000000..70745e691 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_dashboard_admin.md @@ -0,0 +1,30 @@ +## dubboctl dashboard admin + +create PortForward between local address and target component admin pod. open browser by default + +### Synopsis + +create PortForward between local address and target component admin pod. open browser by default + +Typical use cases are: + +```sh + +dubboctl dashboard admin + +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|-----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|----------| +| --port | -p | Set the port for local monitoring connections. If not set, the default is the same as the Admin dashboard, 8080 | dubboctl dashboard nacos -p 8848 | No | +| --host | -h | Set the local host to listen for connections. If not set, the default is 127.0.0.1 | dubboctl dashboard nacos -h xxx.xxx.xxx.xxx | No | +| --openBrowser | | Set whether to automatically open the browser and open the dashboard, the default is true | dubboctl dashboard nacos --openBrowser false | No | +| --namespace | n | Set the namespace where Admin is located. If not set, the default is dubbo-system. | dubboctl dashboard nacos -n ns_user_specified | No | +| --kubeConfig | | The path to store kubeconfig | dubboctl dashboard nacos --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl dashboard nacos --context contextVal | No | + +### + +### SEE ALSO + +* [dubboctl dashboard](dubboctl_dashboard.md) - Commands help user to open control plane components dashboards directly. \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_dashboard_grafana.md b/docs/cmd/dubboctl/reference/dubboctl_dashboard_grafana.md new file mode 100644 index 000000000..4e4c601a5 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_dashboard_grafana.md @@ -0,0 +1,28 @@ +## dubboctl dashboard grafana + +create PortForward between local address and target component grafana pod. open browser by default + +### Synopsis + +create PortForward between local address and target component grafana pod. open browser by default + +Typical use cases are: + +```sh + +dubboctl dashboard grafana + +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|----------| +| --port | -p | Set the port for local monitoring connections. If not set, the default is the same as the Grafana dashboard, 3000 | dubboctl dashboard nacos -p 8848 | No | +| --host | -h | Set the local host to listen for connections. If not set, the default is 127.0.0.1 | dubboctl dashboard nacos -h xxx.xxx.xxx.xxx | No | +| --openBrowser | | Set whether to automatically open the browser and open the dashboard, the default is true | dubboctl dashboard nacos --openBrowser false | No | +| --namespace | n | Set the namespace where Grafana is located. If not set, the default is dubbo-system. | dubboctl dashboard nacos -n ns_user_specified | No | +| --kubeConfig | | The path to store kubeconfig | dubboctl dashboard nacos --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl dashboard nacos --context contextVal | No | + +### SEE ALSO + +* [dubboctl dashboard](dubboctl_dashboard.md) - Commands help user to open control plane components dashboards directly. \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_dashboard_nacos.md b/docs/cmd/dubboctl/reference/dubboctl_dashboard_nacos.md new file mode 100644 index 000000000..676aea794 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_dashboard_nacos.md @@ -0,0 +1,28 @@ +## dubboctl dashboard nacos + +create PortForward between local address and target component nacos pod. open browser by default + +### Synopsis + +create PortForward between local address and target component nacos pod. open browser by default + +Typical use cases are: + +```sh + +dubboctl dashboard nacos + +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|-----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|----------| +| --port | -p | Set the port for local monitoring connections. If not set, the default is the same as the Nacos dashboard, 3000 | dubboctl dashboard nacos -p 8848 | No | +| --host | -h | Set the local host to listen for connections. If not set, the default is 127.0.0.1 | dubboctl dashboard nacos -h xxx.xxx.xxx.xxx | No | +| --openBrowser | | Set whether to automatically open the browser and open the dashboard, the default is true | dubboctl dashboard nacos --openBrowser false | No | +| --namespace | n | Set the namespace where Nacos is located. If not set, the default is dubbo-system. | dubboctl dashboard nacos -n ns_user_specified | No | +| --kubeConfig | | The path to store kubeconfig | dubboctl dashboard nacos --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl dashboard nacos --context contextVal | No | + +### SEE ALSO + +* [dubboctl dashboard](dubboctl_dashboard.md) - Commands help user to open control plane components dashboards directly. \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_dashboard_prometheus.md b/docs/cmd/dubboctl/reference/dubboctl_dashboard_prometheus.md new file mode 100644 index 000000000..3f6a4c025 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_dashboard_prometheus.md @@ -0,0 +1,28 @@ +## dubboctl dashboard prometheus + +create PortForward between local address and target component prometheus pod. open browser by default + +### Synopsis + +create PortForward between local address and target component prometheus pod. open browser by default + +Typical use cases are: + +```sh + +dubboctl dashboard prometheus + +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|----------| +| --port | -p | Set the port for local monitoring connections. If not set, the default is the same as the prometheus dashboard, 3000 | dubboctl dashboard nacos -p 8848 | No | +| --host | -h | Set the local host to listen for connections. If not set, the default is 127.0.0.1 | dubboctl dashboard nacos -h xxx.xxx.xxx.xxx | No | +| --openBrowser | | Set whether to automatically open the browser and open the dashboard, the default is true | dubboctl dashboard nacos --openBrowser false | No | +| --namespace | n | Set the namespace where prometheus is located. If not set, the default is dubbo-system. | dubboctl dashboard nacos -n ns_user_specified | No | +| --kubeConfig | | The path to store kubeconfig | dubboctl dashboard nacos --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl dashboard nacos --context contextVal | No | + +### SEE ALSO + +* [dubboctl dashboard](dubboctl_dashboard.md) - Commands help user to open control plane components dashboards directly. \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_dashboard_skywalking.md b/docs/cmd/dubboctl/reference/dubboctl_dashboard_skywalking.md new file mode 100644 index 000000000..5bee615de --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_dashboard_skywalking.md @@ -0,0 +1,28 @@ +## dubboctl dashboard skywalking + +create PortForward between local address and target component skywalking pod. open browser by default + +### Synopsis + +create PortForward between local address and target component skywalking pod. open browser by default + +Typical use cases are: + +```sh + +dubboctl dashboard skywalking + +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|----------| +| --port | -p | Set the port for local monitoring connections. If not set, the default is the same as the skywalking dashboard, 3000 | dubboctl dashboard nacos -p 8848 | No | +| --host | -h | Set the local host to listen for connections. If not set, the default is 127.0.0.1 | dubboctl dashboard nacos -h xxx.xxx.xxx.xxx | No | +| --openBrowser | | Set whether to automatically open the browser and open the dashboard, the default is true | dubboctl dashboard nacos --openBrowser false | No | +| --namespace | n | Set the namespace where skywalking is located. If not set, the default is dubbo-system. | dubboctl dashboard nacos -n ns_user_specified | No | +| --kubeConfig | | The path to store kubeconfig | dubboctl dashboard nacos --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl dashboard nacos --context contextVal | No | + +### SEE ALSO + +* [dubboctl dashboard](dubboctl_dashboard.md) - Commands help user to open control plane components dashboards directly. \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_dashboard_zipkin.md b/docs/cmd/dubboctl/reference/dubboctl_dashboard_zipkin.md new file mode 100644 index 000000000..331a89fd0 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_dashboard_zipkin.md @@ -0,0 +1,28 @@ +## dubboctl dashboard zipkin + +create PortForward between local address and target component zipkin pod. open browser by default + +### Synopsis + +create PortForward between local address and target component zipkin pod. open browser by default + +Typical use cases are: + +```sh + +dubboctl dashboard zipkin + +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|----------| +| --port | -p | Set the port for local monitoring connections. If not set, the default is the same as the zipkin dashboard, 3000 | dubboctl dashboard nacos -p 8848 | No | +| --host | -h | Set the local host to listen for connections. If not set, the default is 127.0.0.1 | dubboctl dashboard nacos -h xxx.xxx.xxx.xxx | No | +| --openBrowser | | Set whether to automatically open the browser and open the dashboard, the default is true | dubboctl dashboard nacos --openBrowser false | No | +| --namespace | n | Set the namespace where zipkin is located. If not set, the default is dubbo-system. | dubboctl dashboard nacos -n ns_user_specified | No | +| --kubeConfig | | The path to store kubeconfig | dubboctl dashboard nacos --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl dashboard nacos --context contextVal | No | + +### SEE ALSO + +* [dubboctl dashboard](dubboctl_dashboard.md) - Commands help user to open control plane components dashboards directly. \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_deploy.md b/docs/cmd/dubboctl/reference/dubboctl_deploy.md new file mode 100644 index 000000000..6204f86b3 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_deploy.md @@ -0,0 +1,42 @@ +## dubboctl deploy + +Deploy an application + +### Synopsis + + Usage: + dubboctl deploy [flags] + + Flags: + -a, --apply Whether to apply the application to the k8s cluster by the way + -b, --builder-image string Specify a custom builder image for use by the builder other than its default. + --containerPort int The port of the deployment to listen on pod (required) + -e, --envs stringArray Environment variable to set in the form NAME=VALUE. This is for the environment variables passed + in by the builderpack build method. + -f, --force Whether to force push + -h, --help help for deploy + -i, --image string Container image( [registry]/[namespace]/[name]:[tag] ) + --imagePullPolicy string The image pull policy of the deployment, default to IfNotPresent + --limitCpu int The limit cpu to deploy (default 1000) + --limitMem int The limit memory to deploy (default 1024) + --maxReplicas int The max replicas to deploy (default 10) + --minReplicas int The min replicas to deploy (default 3) + --name string The name of deployment (required) + -n, --namespace string Deploy into a specific namespace (default "dubbo-system") + --nobuild Skip the step of building the image. + --nodePort int The nodePort of the deployment to expose + -o, --output string output kubernetes manifest (default "kube.yaml") + -p, --path string Path to the application. Default is current directory ($DUBBO_PATH) + --push Whether to push the image to the registry center by the way + --replicas int The number of replicas to deploy (default 3) + --requestCpu int The request cpu to deploy (default 500) + --requestMem int The request memory to deploy (default 512) + --revisions int The number of replicas to deploy (default 5) + --secret string The secret to image pull from registry + --serviceAccount string TheServiceAccount for the deployment + --targetPort int The targetPort of the deployment, default to port + -d, --useDockerfile Use the dockerfile with the specified path to build + +### SEE ALSO + +* [dubboctl](dubboctl.md) - Management tool for dubbo-kubernetes \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_manifest.md b/docs/cmd/dubboctl/reference/dubboctl_manifest.md new file mode 100644 index 000000000..cb11b8aff --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_manifest.md @@ -0,0 +1,23 @@ +## dubboctl manifest + +Commands help user to generate manifest and install manifest + +### Synopsis + +Commands help user to generate manifest and install manifest + +``` + -h, --help help for config +``` + +### SEE ALSO + +* [dubboctl](dubboctl.md) - Management tool for dubbo-kubernetes +* [dubboctl manifest diff](dubboctl_manifest_diff.md) - show the difference between two files or dirs +* [dubboctl manifest generate](dubboctl_manifest_generate.md) - Generate the manifest of the required components. +* [dubboctl manifest install](dubboctl_manifest_install.md) - Install the required components directly to the k8s + cluster. +* [dubboctl manifest uninstall](dubboctl_manifest_uninstall.md) - Uninstall the specified component. Unconditional + uninstallation is currently not supported (this means that users cannot force deletion if they do not know the + DubboConfig yaml or set parameters used in dubboctl manifest intall, and need to use kubectl and other tools to delete + it). \ No newline at end of file diff --git a/docs/cmd/dubboctl/reference/dubboctl_manifest_diff.md b/docs/cmd/dubboctl/reference/dubboctl_manifest_diff.md new file mode 100644 index 000000000..8c00f36df --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_manifest_diff.md @@ -0,0 +1,24 @@ +## dubboctl manifest diff + +show the difference between two files or dirs + +### Synopsis + +Show the differences between the two manifests, split the manifest into multiple k8s objects, compare objects with the +same namespace:kind:name, and output the redundant objects and objects with parsing errors in the manifest; if you show +the differences between the two directories , perform the above processing on manifests with the same name, and output +the redundant manifests in the directory and the manifests with parsing errors. + +Typical use cases are: + +```sh +dubboctl manifest diff path/to/file0 path/to/file1 +``` + +| parameter | shorthand | describe | Example | required | +|--------------|-----------|--------------------------------------|---------------------------------------------------------------|----------| +| --compareDir | | Compare manifests in two directories | dubboctl manifest diff path/to/dir0 path/to/dir1 --compareDir | No | + +### SEE ALSO + +* [dubboctl manifest](dubboctl_manifest.md) - Commands help user to generate manifest and install manifest diff --git a/docs/cmd/dubboctl/reference/dubboctl_manifest_generate.md b/docs/cmd/dubboctl/reference/dubboctl_manifest_generate.md new file mode 100644 index 000000000..326580ccf --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_manifest_generate.md @@ -0,0 +1,26 @@ +## dubboctl manifest diff generate + +Generate the manifest of the required components. + +### Synopsis + +Generate the manifest of the required components. +Typical use cases are: + +```sh +dubboctl manifest generate | kubectl apply -f - +``` + +| parameter | shorthand | describe | Example | required | +|--------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|----------| +| --filenames | -f | Specify one or more user-defined DubboConfig yaml paths. When parsing, follow the order from left to right. Overlay | dubboctl manifest generate -f path/to/file0.yaml, path/to/file1.yaml | No | +| --charts | | The directory where Helm Charts are stored. If the user does not specify it, /deploy/charts is used by default | dubboctl manifest generate --charts path/to/charts | No | +| --profiles | | The directory where profiles are stored. If the user does not specify it, /deploy/profiles is used by default | dubboctl manifest generate --profiles path/to/profiles | No | +| --set | -s | Set one or more key-value pairs in DubboConfig yaml. The priority is set flags > user-defined DubboConfig yaml > profile. It is recommended not to use set | dubboctl manifest generate --set components.admin.replicas=2,components in production. admin.rbac.enabled=false | No | +| --kubeConfig | | The path where kubeconfig is stored | dubboctl manifest generate --kubeConfig path/to/kubeConfig | No | +| --context | | Specify the context in kubeconfig | dubboctl manifest generate --context contextVal | No | +| --output | -o | Specify the output path for the final generated manifest. If not set, the output will be output to the console by default | dubboctl manifest generate -o path/to/target/directory | No | + +### SEE ALSO + +* [dubboctl manifest](dubboctl_manifest.md) - Commands help user to generate manifest and install manifest diff --git a/docs/cmd/dubboctl/reference/dubboctl_manifest_install.md b/docs/cmd/dubboctl/reference/dubboctl_manifest_install.md new file mode 100644 index 000000000..91b3a849a --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_manifest_install.md @@ -0,0 +1,25 @@ +## dubboctl manifest install + +Install the required components directly to the k8s cluster. + +### Synopsis + +Install the required components directly to the k8s cluster. +Typical use cases are: + +```sh +dubboctl manifset install +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|----------| +| --filenames | -f | Specify one or more user-defined DubboConfig yaml paths, and overlay them in order from left to right when parsing. | dubboctl manifest install -f path/to/file0.yaml, path/to/file1.yaml | No | +| --charts | | The directory where Helm Charts are stored. If the user does not specify it, /deploy/charts is used by default. | dubboctl manifest install --charts path/to/charts | No | +| --profiles | | The directory where profiles are stored. If the user does not specify it, /deploy/profiles is used by default. | dubboctl manifest install --profiles path/to/profiles | No | +| --set | -s | Set one or more key-value pairs in DubboConfig yaml. The priority is set flags > profile > user-defined DubboOperator yaml. It is recommended not to use set in production. | dubboctl manifest install --set components.admin.replicas=2,components.admin.rbac.enabled=false | 否 | +| --ku beConfig | | The path to store kubeconfig | dubboctl manifest install --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl manifest install --context contextVal | No | + +### SEE ALSO + +* [dubboctl manifest](dubboctl_manifest.md) - Commands help user to generate manifest and install manifest diff --git a/docs/cmd/dubboctl/reference/dubboctl_manifest_uninstall.md b/docs/cmd/dubboctl/reference/dubboctl_manifest_uninstall.md new file mode 100644 index 000000000..e88e48a6c --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_manifest_uninstall.md @@ -0,0 +1,27 @@ +## dubboctl manifest uninstall + +uninstall dubbo control plane + +### Synopsis + +Uninstall the specified component. Unconditional uninstallation is currently not supported (this means that users cannot +force deletion if they do not know the DubboConfig yaml or set parameters used in dubboctl manifest intall, and need to +use kubectl and other tools to delete it). +Typical use cases are: + +```sh +dubboctl manifest uninstall +``` + +| parameter | shorthand | describe | Example | required | +|---------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|----------| +| --filenames | -f | Specify one or more user-defined DubboConfig yaml paths, and overlay them in order from left to right when parsing. | dubboctl manifest install -f path/to/file0.yaml, path/to/file1.yaml | No | +| --charts | | The directory where Helm Charts are stored. If the user does not specify it, /deploy/charts is used by default. | dubboctl manifest install --charts path/to/charts | No | +| --profiles | | The directory where profiles are stored. If the user does not specify it, /deploy/profiles is used by default. | dubboctl manifest install --profiles path/to/profiles | No | +| --set | -s | Set one or more key-value pairs in DubboConfig yaml. The priority is set flags > profile > user-defined DubboOperator yaml. It is recommended not to use set in production. | dubboctl manifest install --set components.admin.replicas=2,components.admin.rbac.enabled=false | 否 | +| --ku beConfig | | The path to store kubeconfig | dubboctl manifest install --kubeConfig path/to/kubeConfig | No | +| --context | | Specify to use the context in kubeconfig | dubboctl manifest install --context contextVal | No | + +### SEE ALSO + +* [dubboctl manifest](dubboctl_manifest.md) - Commands help user to generate manifest and install manifest diff --git a/docs/cmd/dubboctl/reference/dubboctl_profile.md b/docs/cmd/dubboctl/reference/dubboctl_profile.md new file mode 100644 index 000000000..02e9ced91 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_profile.md @@ -0,0 +1,17 @@ +## dubboctl profile + +Commands help user to list and describe profiles + +### Synopsis + +Commands help user to list and describe profiles + +``` + -h, --help help for config +``` + +### SEE ALSO + +* [dubboctl](dubboctl.md) - Management tool for dubbo-kubernetes +* [dubboctl profile diff](dubboctl_profile_diff.md) - Show the difference between two profiles +* [dubboctl profile list](dubboctl_profile_list.md) - List all existing profiles specification diff --git a/docs/cmd/dubboctl/reference/dubboctl_profile_diff.md b/docs/cmd/dubboctl/reference/dubboctl_profile_diff.md new file mode 100644 index 000000000..a526c3f10 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_profile_diff.md @@ -0,0 +1,22 @@ +## dubboctl profile diff + +Show the difference between two profiles + +### Synopsis + +Show the difference between two profiles +Typical use cases are: + +```sh + +dubboctl profile diff default demo + +``` + +| parameter | shorthand | describe | Example | required | +|------------|-----------|-------------------------------------------------|---------------------------------------------------|----------| +| --profiles | | Specify the directory where profiles are stored | dubboctl profile list --profiles path/to/profiles | No | + +### SEE ALSO + +* [dubboctl profile](dubboctl_profile.md) - Commands help user to list and describe profiles diff --git a/docs/cmd/dubboctl/reference/dubboctl_profile_list.md b/docs/cmd/dubboctl/reference/dubboctl_profile_list.md new file mode 100644 index 000000000..94c7b0311 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_profile_list.md @@ -0,0 +1,22 @@ +## dubboctl profile list + +List all existing profiles specification + +### Synopsis + +Displays which profiles are in the profiles directory and displays the content of the specified profile. +Typical use cases are: + +```sh +dubboctl profile list + +dubboctl profile list default +``` + +| parameter | shorthand | describe | Example | required | +|------------|-----------|-------------------------------------------------|---------------------------------------------------|----------| +| --profiles | | Specify the directory where profiles are stored | dubboctl profile list --profiles path/to/profiles | No | + +### SEE ALSO + +* [dubboctl profile](dubboctl_profile.md) - Commands help user to list and describe profiles diff --git a/docs/cmd/dubboctl/reference/dubboctl_repository.md b/docs/cmd/dubboctl/reference/dubboctl_repository.md new file mode 100644 index 000000000..3e3182c8e --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_repository.md @@ -0,0 +1,136 @@ +## dubboctl repository + +Manage set of installed repositories. + +### Synopsis + + dubboctl repo [-c|--confirm] + dubboctl repo list [-r|--repositories] [-c|--confirm] + dubboctl repo add [-r|--repositories] [-c|--confirm] + dubboctl repo rename [-r|--repositories] [-c|--confirm] + dubboctl repo remove [-r|--repositories] [-c|--confirm] + +### Description + + Manage template repositories installed on disk at either the default location + (~/.config/dubbo/repositories) or the location specified by the --repository + flag. Once added, a template from the repository can be used when creating + a new Dubbo. + + Interactive Prompts: + To complete these commands interactively, pass the --confirm (-c) flag to + the 'repository' command, or any of the inidivual subcommands. + + The Default Repository: + The default repository is not stored on disk, but embedded in the binary and + can be used without explicitly specifying the name. The default repository + is always listed first, and is assumed when creating a new function without + specifying a repository name prefix. + For example, to create a new one using the 'common' template from the + default repository. + $ dubboctl create -l go -t common + + The Repository Flag: + Installing repositories locally is optional. To use a template from a remote + repository directly, it is possible to use the --repository flag on create. + This leaves the local disk untouched. For example, To create a scaffold using + the dubboctl-samples http template without installing the template + repository locally, use the --repository (-r) flag on create: + $ dubboctl create -l go \ + --template http \ + --repository https://github.com/sjmshsh/dubboctl-samples + + Alternative Repositories Location: + Repositories are stored on disk in ~/.config/dubbo/repositories by default. + This location can be altered by setting the DUBBO_REPOSITORIES_PATH + environment variable. + +### COMMANDS + + With no arguments, this help text is shown. To manage repositories with + an interactive prompt, use the use the --confirm (-c) flag. + $ dubboctl repository -c + + add + Add a new repository to the installed set. + $ dubboctl repository add + + For Example, to add the ruiyi Project repository: + $ dubboctl repository add ruiyi https://github.com/sjmshsh/dubboctl-samples + + Once added, a function can be created with templates from the new repository + by prefixing the template name with the repository. For example, to create + a new function using the dubbogo template: + $ dubboctl create -l go -t ruiyi/dubbogo + + list + List all available repositories, including the installed default + repository. Repositories available are listed by name. + + rename + Rename a previously installed repository from to . Only installed + repositories can be renamed. + $ dubboctl repository rename + + remove + Remove a repository by name. Removes the repository from local storage + entirely. When in confirm mode (--confirm) it will confirm before + deletion, but in regular mode this is done immediately, so please use + caution, especially when using an altered repositories location + (via the DUBBO_REPOSITORIES_PATH environment variable). + $ dubboctl repository remove + +### EXAMPLES + + o Run in confirmation mode (interactive prompts) using the --confirm flag + $ dubboctl repository -c + + o Add a repository and create a new function using a template from it: + $ dubboctl repository add ruiyi https://github.com/sjmshsh/dubboctl-samples + $ dubboctl repository list + default + functastic + $ dubboctl create -l go -t ruiyi/dubbogo + ... + + o Add a repository specifying the branch to use (dubboctl): + $ dubboctl repository add ruiyi https://github.com/sjmshsh/dubboctl-samples#dubboctl + $ dubboctl repository list + default + ruiyi + $ dubboctl create -l go -t http + ... + + o List all repositories including the URL from which remotes were installed + $ dubboctl repository list -v + default + master https://github.com/sjmshsh/dubboctl-samples#master + + o Rename an installed repository + $ dubboctl repository list + default + ruiyi + $ dubboctl repository rename ruiyi dubboTest + $ dubboctl repository list + default + dubboTest + + o Remove an installed repository + $ dubboctl repository list + default + dubboTest + $ dubboctl repository remove dubboTest + $ dubboctl repository list + default + +Flags: +-c, --confirm Prompt to confirm options interactively ($DUBBO_CONFIRM) +-h, --help help for repository + +### SEE ALSO + +* [dubboctl](dubboctl.md) - Management tool for dubbo-kubernetes +* [dubboctl repository add](dubboctl_repository_add.md) +* [dubboctl repository list](dubboctl_repository_add.md) +* [dubboctl repository remove](dubboctl_repository_remove.md) +* [dubboctl repository rename](dubboctl_repository_rename.md) diff --git a/docs/cmd/dubboctl/reference/dubboctl_repository_add.md b/docs/cmd/dubboctl/reference/dubboctl_repository_add.md new file mode 100644 index 000000000..95536a729 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_repository_add.md @@ -0,0 +1,17 @@ +## dubboctl repository add + +Manage set of installed repositories. + +### Synopsis + +Usage: +dubboctl repository add [flags] + +Flags: +-c, --confirm Prompt to confirm options interactively ($DUBBO_CONFIRM) +-h, --help help for add + +### SEE ALSO + +* [dubboctl repository](dubboctl_repository.md) - Manage set of installed repositories. + diff --git a/docs/cmd/dubboctl/reference/dubboctl_repository_list.md b/docs/cmd/dubboctl/reference/dubboctl_repository_list.md new file mode 100644 index 000000000..12393b807 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_repository_list.md @@ -0,0 +1,20 @@ +## dubboctl repository list + +Manage set of installed repositories. + +### Synopsis + +Usage: +dubboctl repository list [flags] + +Aliases: +list, ls + +Flags: +-c, --confirm Prompt to confirm options interactively ($DUBBO_CONFIRM) +-h, --help help for list + +### SEE ALSO + +* [dubboctl repository](dubboctl_repository.md) - Manage set of installed repositories. + diff --git a/docs/cmd/dubboctl/reference/dubboctl_repository_remove.md b/docs/cmd/dubboctl/reference/dubboctl_repository_remove.md new file mode 100644 index 000000000..5ee33e8b4 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_repository_remove.md @@ -0,0 +1,20 @@ +## dubboctl repository remove + +Manage set of installed repositories. + +### Synopsis + +Usage: +dubboctl repository remove [flags] + +Aliases: +remove, rm + +Flags: +-c, --confirm Prompt to confirm options interactively ($DUBBO_CONFIRM) +-h, --help help for remove + +### SEE ALSO + +* [dubboctl repository](dubboctl_repository.md) - Manage set of installed repositories. + diff --git a/docs/cmd/dubboctl/reference/dubboctl_repository_rename.md b/docs/cmd/dubboctl/reference/dubboctl_repository_rename.md new file mode 100644 index 000000000..de00689e0 --- /dev/null +++ b/docs/cmd/dubboctl/reference/dubboctl_repository_rename.md @@ -0,0 +1,20 @@ +## dubboctl repository rename + +Manage set of installed repositories. + +### Synopsis + +Usage: +dubboctl repository rename [flags] + +Aliases: +rename, mv + +Flags: +-c, --confirm Prompt to confirm options interactively ($DUBBO_CONFIRM) +-h, --help help for rename + +### SEE ALSO + +* [dubboctl repository](dubboctl_repository.md) - Manage set of installed repositories. + diff --git a/go.mod b/go.mod index d1f18acaf..ef7c2118e 100644 --- a/go.mod +++ b/go.mod @@ -51,9 +51,9 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/hashicorp/go-multierror v1.1.1 github.com/heroku/color v0.0.6 - github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec github.com/kylelemons/godebug v1.1.0 github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91 + github.com/moby/term v0.5.0 github.com/onsi/gomega v1.27.10 github.com/ory/viper v1.7.5 github.com/pkg/errors v0.9.1 @@ -257,7 +257,6 @@ require ( github.com/moby/spdystream v0.2.0 // indirect github.com/moby/sys/mountinfo v0.6.2 // indirect github.com/moby/sys/sequential v0.5.0 // indirect - github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect diff --git a/pkg/dds/kube/crdclient/handler_test.go b/pkg/dds/kube/crdclient/handler_test.go index e951c9038..3e3484eef 100644 --- a/pkg/dds/kube/crdclient/handler_test.go +++ b/pkg/dds/kube/crdclient/handler_test.go @@ -93,7 +93,7 @@ func TestAuthentication(t *testing.T) { func TestAuthorization(t *testing.T) { configName := "name" - configNamespace := "namespace" + configNamespace := "test-namespace" c := collections.DubboApacheOrgV1Alpha1AuthorizationPolicy name := c.Resource().Kind() t.Run(name, func(t *testing.T) { @@ -188,7 +188,7 @@ func TestAuthorization(t *testing.T) { func TestAuthorizationNilField(t *testing.T) { configName := "name" - configNamespace := "namespace" + configNamespace := "ns" c := collections.DubboApacheOrgV1Alpha1AuthorizationPolicy name := c.Resource().Kind() t.Run(name, func(t *testing.T) {