How to for application (#437)

* Docs: add how to doc about managing app

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Docs: add how to doc about managing app

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Docs: hidde jenkins doc

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* translate and refine how-to dashboard

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* application configure expose page

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Docs: add some screenshots for deploy app doc

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* finish the application how-to (#436)

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
This commit is contained in:
Jianbo Sun 2022-01-13 20:47:33 +08:00 committed by GitHub
parent 43f5e97a3f
commit 50a906e05f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 360 additions and 137 deletions

View File

@ -53,6 +53,7 @@ Here we're unlocking new skills! Modify the parameters of the application. For a
After modifying the deployment parameters, the workflow of the environment must be executed to make the modified parameters take effect in the specified environment. Due to the existence of Revision, the configuration parameters will be saved in each historical version.
At this point, Helm Chart in KubeVela is no stranger to you, go ahead and try more!
<!--
## Next step
TODO v1.2

View File

@ -12,7 +12,6 @@ This article introduces how companies deliver business applications based on Kub
> In the future, KubeVela plans to provide the image-build-up solution for multi-langs
- Place your business image at a hub that KubeVela can access to
- Make it clear what environment variables your business needs to set, and whether there are other middleware dependencies (such as databases, caches, etc.). If so, please deploy the middleware service first.
## Creating an application

View File

@ -1,3 +1,23 @@
---
title: How to bind new environment
title: Bind application with environment
---
We can specify bind with one or more environments before deploy.
After we have created application and configured the baseline well, we can bind an application with environment to deploy.
You can bind with one environment as `dev` environment for develop and debug. When everything works well, you can bind with the production environment.
The operation likes below:
![bind-new-env](../../../resources/bind-new-env.jpg)
As the picture shows, in the application management page, click `Bind Environment`, choose the environment prepared.
If there's no environment, you can click the `Create new environment` for creation.
After choose well, click the `submit` button, it will show the new environment created on the right side of the baseline config as a tab.
KubeVela will automatically generate the deploy workflow for the newly created environments.
In the environment tab, you can click `Deploy` button to deploy the application.

View File

@ -1,4 +1,33 @@
---
title: How to create an application
title: Create application
description: create an application by kubevela dashboard
---
### Configure the basic information
Enter the `Applications` page, click `New Application` button, you can see the basic application configuration page.
### Choose your application(component) type
Currently we only support one component for one application in VelaUX,
so the application type here is actually component type.
There're many component types supported in KubeVela including cloud resources and container based service type. New component types can be easily extended by KubeVela addons or component definition.
- We recommend to use `webservice` for your container based application.
- For helm packages, you can choose `helm` type.
### Configure the component
After you choose component type well, KubeVela will render the configuration
page according to the component type.
Different component types are different significantly, you can fill in the forms with the help of UI. For example, below is the configuration page for `webservice` type.
![create-app](../../../resources/set-webservice.jpg)
### Submit your application
After you finished configuring the application, click "Submit" to create the application. This means the application configuration was saved.
You should choose to [bind environment](./bind-new-environment) to do real deployment.

View File

@ -1,4 +1,12 @@
---
title: How to delete an application
description: delete an application by kubevela dashboard
title: Delete application
description: delete an application by KubeVela dashboard
---
Before you delete an application, you should recycle all instances bond in environments.
After all application instance were recycled, you can click `Remove` for deletion.
![delete application](../../../resources/app-delete.jpg)
As the picture shows, the `Remove` button is hidden in the application detail.

View File

@ -1,4 +1,34 @@
---
title: How to deploy an application
description: deploy an application to environment by kubevela dashboard
title: Deploy application
description: deploy an application to environment by KubeVela dashboard
---
After application created and bond with an environment, you can deploy the application instance.
### First time deploy
You can view the application detail page by click the application name or the UI card.
The tabs on the right side of the `Baseline Config` are environments which bond by the application. Choose one of the environment you want to deploy. Click that tab, you'll see the picture below.
![app-not-deploy](../../../resources/app-not-deploy.jpg)
If this is the first time deploy, you'll see the Deploy button in the middle of the environment page, just click the `Deploy` button to deploy.
Then the workflow start to running, you can see the workflow status on the top right corner.
If you have configured a suspend workflow step, it will run and stop in that state. It will wait until you have checked your application well and click the approve button.
![workflow-suspend](../../../resources/workflow-suspend.jpg)
If there's something wrong with the workflow step, the workflow node will become red. Move your mouse to hover that area, you'll see the error reason.
![workflow-error](../../../resources/workflow-error.jpg)
### Upgrade the application
There's a `Deploy` button on the top right corner, you can click that for deploy. On the right side of the button, there's detail button, you can choose which workflow to run if there's multiple environments configured.
![select-workflow](../../../resources/select-workflow.jpg)
You can upgrade the application in any state, as KubeVela is a declarative system. There will be a kindly reminder for you if the workflow is running when you want to upgrade.

View File

@ -1,4 +1,38 @@
---
title: How to view an application endpoint
description: View an application endpoints by kubevela dashboard
title: Expose application for public access
description: View an application endpoints by KubeVela dashboard
---
### Expose your application for public access
You can configure your application for public access.
There're mainly three ways to expose your service.
1. Choose `webservice` Type and configure the service type to be `LoadBalancer` or `NodePort`.
2. Configure `gateway` trait, it works for `webservice`, `worker` and `task` component types. `gateway` trait must configure a domain and works only for HTTP/HTTPs protocols.
3. Case by case component configurations.
#### Expose service for `webservice` typed component
You can modify `ExposeType` to choose the way, and you should configure the `Service Ports` to listen the ports and turn on the `Expose` radio.
![webservice](../../../resources/webservice-port.jpg)
#### Add `gateway` trait
The `gateway` trait requires you have `Ingress Controller` available in your cluster. You can add this trait to expose your service and configure a domain.
![trait](../../../resources/gateway-trait-add.jpg)
As the picture shows, the `Domain` field configure your domain, please configure your DNS for domain to route to the Kubernetes cluster gateway IP.
In the `Http` section, you can configure the routing rules. For example, set `/`:`80` means the domain index page will route to the port `80`. You can configure this rule as you need.
Other component types can also be able to configure the service expose, but they're usually case by case, especially for helm charts.
### Get the service endpoint
After the application deployed with service exposed configuration, you can see a `Service Endpoint` button on the left of the `Recycle` button. You'll see the endpoint when hover your mouse there.
![service endpoint](../../../resources/service-endpoint.jpg)

View File

@ -1,4 +1,16 @@
---
title: How to view an application instances
description: View an application instances by kubevela dashboard
title: Check application state
description: View an application instances by KubeVela dashboard
---
Different tabs of environment will show different application instances inside.
By default, it will display all instances deployed in the environment, you can filter the status by select targets.
![pod list](../../../resources/pod-list.jpg)
As the picture shows, check the application pod details by click the expand button("+") on the left. You can view the pod status including the events and error message about it.
For cloud resources, there will be a link to the cloud console for management.
![rds-instances](../../../resources/rds-instances.jpg)

View File

@ -1,4 +1,15 @@
---
title: How to view an application log
description: View an application log by kubevela dashboard
title: View application logs
description: View an application log by KubeVela dashboard
---
You can view the logs of application in the environment tab.
Click the icon in the `Action` column, you'll see the running logs for pod.
![pod log](../../../resources/pod-log.jpg)
![pod log](../../../resources/log-show.jpg)
By default, the logs will refresh every 5s. If your logs didn't have timestamp, you can click the `Show timestamps` to see.

View File

@ -1,4 +1,12 @@
---
title: How to view an application revision
description: View an application revision by kubevela dashboard
title: View application revision
description: View an application revision by KubeVela dashboard
---
Every time a deploy happens, there will be a revision generated automatically.
You can check the application revision in the `Revisions` tab inside the baseline config tab.
![app-revision](../../../resources/app-revisions.jpg)
Manually upgrade or triggered by webhooks will all list here.

View File

@ -1,21 +0,0 @@
---
title: Overview
---
### [How to create an application](./create-application)
### [How to deploy an application](./deploy-application)
### [How to view an application instances](./get-application-instance)
### [How to view an application log](./get-application-log)
### [How to view an application endpoint](./get-application-endpoint)
### [How to view an application revision](./get-application-revision)
### [How to bind new environment](./bind-new-environment)
### [How to recycle an environment](./recycle-environment)
### [How to delete an application](./delete-application)

View File

@ -1,3 +1,15 @@
---
title: How to recycle an environment
title: Recycle application instance
---
When you want to delete the application instance in some environment, you can click the `Recycle` button in that environment.
![pod list](../../../resources/pod-list.jpg)
It will delete the whole application instance with related resources.
> Note that recycle means delete an application, data can't be recovered automatically. Please make sure you have back up all the important data of this instance before recycle it.
### Delete the environment binding
After the application instance recycled, there will be a `Delete` button, click this button means unbound the environment for application.

View File

@ -0,0 +1,9 @@
---
title: View application created resources
---
If you want to learn the resources created by the applications, you can click `Check the details` text button, it will provide a window to show the resources.
![app-resources](../../../resources/app-resources.jpg)
There're three kinds of information including `Applied Resources`,`Conditions` and `Component Status`. The `Applied Resources` are all resources created by the applications.

View File

@ -11,7 +11,7 @@ import TabItem from "@theme/TabItem";
Requirements:
- Kubernetes cluster >= v1.18.
- Kubernetes cluster >= v1.18 && < v1.22
- [Kubectl](https://kubernetes.io/docs/tasks/tools/) && [Helm v3](https://helm.sh/docs/intro/install/).
KubeVela relies on Kubernetes as a control plane. The control plane could be any managed Kubernetes offering or your cluster.
@ -120,7 +120,7 @@ nodes:
EOF
```
<details> <summary> Install ingress to enable service route </summary>
<details> <summary> Install ingress controller to enable service route </summary>
```shell script
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
@ -264,15 +264,19 @@ sudo mv ./vela /usr/local/bin/vela
```shell script
vela addon enable velaux
```
expected output:
```
Addon: velaux enabled Successfully.
```
By default, velaux didn't have any exposed port, you can view it by:
```
vela port-forward addon-velaux -n vela-system
```
Choose `> Cluster: local | Namespace: vela-system | Component: velaux | Kind: Service` for visit.
If you have loadbalaner or ingress, please refer to [VelaUX addon docs](./reference/addons/velaux) for more advanced installation ways.

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

BIN
docs/resources/log-show.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

BIN
docs/resources/pod-log.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -2,3 +2,15 @@
title: 发布应用到新环境
description: 发布应用到新的环境
---
应用在创建完成后,需要绑定到 1 个或多个环境才能正式发布。
你可以绑定到开发环境做测试,然后在测试完成后绑定到生产环境做发布,不同的环境之间彼此隔离、互不影响。
创建完成应用后,在应用管理页面点击 `Bind Environment`就会出现如下弹窗:
![bind-new-env](../../../resources/bind-new-env.jpg)
在弹窗中选择需要发布的环境。如果环境还没创建,可点击下方的 `Create new environment` 创建新的环境。
点击确认即完成绑定,`Baseline Config` 右侧环境选项区域出现新的环境,且在工作流管理页面将自动生成新环境的部署工作流。切换到新环境视图下点击 `Deploy` 即可将应用发布到该环境。

View File

@ -2,3 +2,9 @@
title: 删除应用
description: 应用删除的操作方式
---
应用需要完成所有环境的资源回收,完成后即可进行删除操作。
![delete application](../../../resources/app-delete.jpg)
如上图所示,回到应用列表页面,鼠标移动到应用名称右侧的操作图标上,点击 Remove 选项即可完成应用的删除操作。

View File

@ -11,10 +11,18 @@ description: 指定用户将创建的应用部署到指定的环境。
![app-not-deploy](../../../resources/app-not-deploy.jpg)
环境处于未部署状态时将显示部署按钮,点击按钮即可开始执行当前环境的部署工作流。工作流执行状态显示在页面的右上方。如果你设置了审核的步骤,到达该步骤时页面中将弹出审核窗口。如果部署步骤出现故障,该步骤显示为红色,鼠标移动到该步骤上将显示故障原因。
环境处于未部署状态时将显示部署按钮,点击按钮即可开始执行当前环境的部署工作流。工作流执行状态显示在页面的右上方。如果你设置了审核的步骤,到达该步骤时页面中将弹出审核窗口。
![workflow-suspend](../../../resources/workflow-suspend.jpg)
如果部署步骤出现故障,该步骤显示为红色,鼠标移动到该步骤上将显示故障原因。
![workflow-error](../../../resources/workflow-error.jpg)
### 更新部署
应用详情页面的右上方有一个常驻的 `Deploy` 按钮,点击该按钮执行默认工作流。按钮右边三点按钮为选择不同的环境工作流,鼠标移动到其上方即可显示多个工作流选项。
![select-workflow](../../../resources/select-workflow.jpg)
更新部署可以在任意状态下进行选择执行某一个流水线后将使用最新的应用配置进行部署。如果该环境正在执行部署UI 将提示你是否强制进行新的部署。

View File

@ -1,4 +1,31 @@
---
title: 访问应用
description: 获取应用的访问地址并访问应用。
description: 通过 Dashboard 设置应用访问方式,获取应用的访问地址并访问应用。
---
### 设置应用访问方式
交付的 Kubernetes 集群的应用需要设置访问方式即可生成访问地址,常见支持的方式如下:
1. 设置 Service 的暴露类型,比如 `LoadBalancer``NodePort`。适用于所有应用协议。
2. 设置 Ingress 策略,仅适用于 HTTP/HTTPs 协议。
#### `webservice` 类型的应用
在部署参数中可以修改 `ExposeType` 字段参数来设置其暴露方式,同时在 `Service Ports` 中设置应用的监听端口,并将 `Expose` 设置为 True。
![webservice](../../../resources/webservice-port.jpg)
如果你的集群中存在 `Ingress Controller`,在应用 `Baseline Config` 页面中,新增 `gateway` 运维特征来设置访问域名。
![trait](../../../resources/gateway-trait-add.jpg)
如上图所示,在 `Domain` 中配置你的域名,注意请将该域名 DNS 解析到目标集群的网关 IP 之上。在 `Http` 模块下配置路由规则,默认你需要设置 `/`:`80`,根据你的应用监听端口设置。
其他部署类型的应用,一般存在对应的部署参数设置选项,根据部署参数设置即可。
### 获取访问地址
设置完应用访问方式后,执行应用部署,然后切换到环境视图下即可看到 `Service Endpoint` 按钮,鼠标移动到上方即可显示该应用的访问地址。
![service endpoint](../../../resources/service-endpoint.jpg)

View File

@ -2,3 +2,17 @@
title: 查看应用运行实例
description: 通过 Dashboard 查看应用运行实例,掌握应用运行状态。
---
查看应用运行实例信息是掌握应用运行状态的直接方式。
![pod list](../../../resources/pod-list.jpg)
如上图所示,应用的运行实例页面处在应用环境视图下。切换不同的环境即可查询不同环境下部署的实例。
默认情况下,实例列表显示该应用在当前环境下的所有实例。通过实例列表上方的交付目标筛选,可以查询不同交付目标的实例列表。在实例列表中显示版本、状态等信息。
对于交付的 Kubernetes 集群的应用,用户可以点击实例行前方的 + 号展开一个实例的详情,即 Pod 详情,包括了容器状态及资源消耗情况,如果实例的拉起故障,可以从事件列表中查看到详细信息。
对于交付的 云服务 应用,用户可通过点击实例名称跳转到云服务商管理页面。
![rds-instances](../../../resources/rds-instances.jpg)

View File

@ -2,3 +2,11 @@
title: 查看应用运行日志
description: 通过查看应用的运行日志是排查故障的最直接方式
---
![pod log](../../../resources/pod-log.jpg)
如上图所示,交付到 Kubernetes 集群的应用支持查询容器运行日志,通过展开实例信息,点击容器列表 Actions 列下的日志按钮,即可查询该容器的运行日志。
![pod log](../../../resources/log-show.jpg)
日志查询页面默认为每 5 秒自动刷新,查看最新的日志。若你的应用日志中没有时间信息,可点击 `Show timestamps` 展示日志记录时间。

View File

@ -2,3 +2,9 @@
title: 查看应用部署版本
description: 查看应用当前部署版本和历史部署版本。
---
应用每执行一次部署即可生成一个版本,通过应用 `Baseline Config` 视图下的 `Revisions` 页面展示应用的历史部署版本。
![app-revision](../../../resources/app-revisions.jpg)
通过 Webhook Trigger 触发部署的版本,如果携带了代码信息,版本号可与代码 Commit 信息进行关联。

View File

@ -1,39 +0,0 @@
---
title: Overview
---
### [创建应用](./create-application)
通过 Dashboard 创建各种类型的应用的操作方式。
### [应用部署到指定环境](./deploy-application)
操作应用部署到指定的环境。
### [查看应用实例](./get-application-instance)
对于已部署的应用,查看指定环境的应用实例信息。
### [查看应用运行日志](./get-application-log)
查看运行应用的容器日志的操作方式。
### [访问应用](./get-application-endpoint)
获取应用的访问地址,并访问应用。
### [查看应用部署版本](./get-application-revision)
查看应用的当前部署版本和历史版本。
### [发布到新环境](./bind-new-environment)
发布已有应用到新环境的操作方式。
### [回收环境](./recycle-environment)
回收一个应用在某个环境的部署实例的操作方式
### [删除应用](./delete-application)
删除一个应用的操作方式。

View File

@ -1,4 +1,16 @@
---
title: 回收应用部署的实例
title: 回收应用部署的环境
description: 操作应用从某个环境回收,释放占用的资源。
---
当你需要将应用在某个环境的部署资源回收,即关闭应用时,参考下述操作。
![pod list](../../../resources/pod-list.jpg)
如上图所示,完成部署的环境视图下回出现 `Recycle` 按钮,点击该按钮确认后即可将该环境部署的资源进行回收删除。
> 请注意,回收意味着对应的资源将删除,对于需要有状态存储的应用,该操作会导致数据丢失。纯无状态应用可通过重新部署后恢复。
### 删除应用和环境的绑定关系
应用如果成功从该环境回收后,操作区域将存在 `Delete` 按钮,点击该按钮即可删除应用与环境的绑定关系。

View File

@ -0,0 +1,13 @@
---
title: 查看应用部署的资源列表
---
如果你希望查询应用在各集群部署了哪些资源,可通过下述操作方式查询。
进入应用实例列表页面,点击应用状态展示区域的 `Check the details` 文字按钮,即可弹出如下页面:
![app-resources](../../../resources/app-resources.jpg)
弹窗中展示了应用的 `Applied Resources` `Conditions``Component Status` 三方面信息,其中 `Applied Resources` 即是应用部署的资源列表。
在列表中呈现了包括资源类型、名称、所在集群和 Namespace 等信息。

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -30,7 +30,7 @@ module.exports = {
"deliver-app/consume-cloud-services",
"deliver-app/scaler",
"deliver-app/workflows",
"case-studies/jenkins-cicd",
// "case-studies/jenkins-cicd",
"case-studies/gitops",
"case-studies/trigger",
// "case-studies/canary-blue-green",
@ -42,25 +42,25 @@ module.exports = {
collapsed: true,
items: [
// TODO:
// {
// type: "category",
// label: "Dashboard",
// collapsed: true,
// items: [
// {
// "Manage application": [
// "how-to/dashboard/application/overview",
// "how-to/dashboard/application/create-application",
// "how-to/dashboard/application/deploy-application",
// "how-to/dashboard/application/get-application-instance",
// "how-to/dashboard/application/get-application-log",
// "how-to/dashboard/application/get-application-endpoint",
// "how-to/dashboard/application/get-application-revision",
// "how-to/dashboard/application/bind-new-environment",
// "how-to/dashboard/application/recycle-environment",
// "how-to/dashboard/application/delete-application",
// ],
// },
{
type: "category",
label: "Dashboard",
collapsed: false,
items: [
{
"Manage application": [
"how-to/dashboard/application/create-application",
"how-to/dashboard/application/deploy-application",
"how-to/dashboard/application/get-application-instance",
"how-to/dashboard/application/get-application-log",
"how-to/dashboard/application/get-application-endpoint",
"how-to/dashboard/application/view-application-resource",
"how-to/dashboard/application/get-application-revision",
"how-to/dashboard/application/bind-new-environment",
"how-to/dashboard/application/recycle-environment",
"how-to/dashboard/application/delete-application",
],
},
// {
// "Manage workflow": ["how-to/dashboard/workflow/overview"],
// },
@ -85,12 +85,12 @@ module.exports = {
// {
// "Manage addon": ["how-to/dashboard/addon/overview"],
// },
// ],
// },
],
},
{
type: "category",
label: "CLI",
collapsed: false,
collapsed: true,
items: [
"end-user/quick-start-cli",
"end-user/traits/ingress",