adding dry run and zh system-arch pic (#250)

* adding dry run and zh system-arch pic

* fix

* Update docs/platform-engineers/debug/dry-run.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update docs/platform-engineers/debug/dry-run.md

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* udpates

Co-authored-by: 段少 <duanwei.duan@alibaba-inc.com>
Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
This commit is contained in:
Wei (段少) 2021-09-08 16:57:05 +08:00 committed by GitHub
parent 20a213317d
commit 22ec6b7939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 245 additions and 9 deletions

View File

@ -4,7 +4,7 @@ title: Architecture
The overall architecture of KubeVela is shown as below:
![alt](../resources/arch.jpg)
![alt](../resources/system-arch.png)
## API

View File

@ -42,7 +42,7 @@ We also see that the PHASE of the app-delivering-chart APP is running and the ST
### Attributes
| Parameters | Description | Example |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- |
| --------------- | ----------- | ---------------------------------- |
| repoType | required, indicates where it's from | Helm |
| pullInterval | optional, synchronize with Helm Repo, tunning interval and 5 minutes by default | 10m |
| url | required, Helm Reop address, it supports http/https | https://charts.bitnami.com/bitnami |
@ -58,7 +58,7 @@ We also see that the PHASE of the app-delivering-chart APP is running and the ST
## Deploy From OSS bucket
| Parameters | Description | Example |
| ---------- | ----------- | ------- ||
| ---------- | ----------- | ------- |
| repoType | required, indicates where it's from | oss |
| pullInterval | optional, synchronize with bucket, tunning interval and 5 minutes by default | 10m |
| url | required, bucket's endpoint and no need to fill in with scheme | oss-cn-beijing.aliyuncs.com |
@ -105,7 +105,7 @@ spec:
## Deploy From Git Repo
| Parameters | Description | Example |
| ---------- | ----------- | ------- ||
| ---------- | ----------- | ------- |
| repoType | required, indicates where it's from | git |
| pullInterval | optional, synchronize with Git Repo, tunning interval and 5 minutes by default | 10m |
| url | required, Git Repo address | https://github.com/oam-dev/terraform-controller |

View File

@ -1,3 +1,107 @@
---
title: Dry Run
---
Dry run will help you to understand what are the real resources which will to be expanded and deployed
to the Kubernetes cluster. In other words, it will mock to run the same logic as KubeVela's controller
and output the results locally.
For example, let's dry-run the following application:
```yaml
# app.yaml
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: vela-app
spec:
components:
- name: express-server
type: webservice
properties:
image: crccheck/hello-world
port: 8000
traits:
- type: ingress
properties:
domain: testsvc.example.com
http:
"/": 8000
```
```shell
kubectl vela dry-run -f app.yaml
---
# Application(vela-app) -- Comopnent(express-server)
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.oam.dev/appRevision: ""
app.oam.dev/component: express-server
app.oam.dev/name: vela-app
workload.oam.dev/type: webservice
spec:
selector:
matchLabels:
app.oam.dev/component: express-server
template:
metadata:
labels:
app.oam.dev/component: express-server
spec:
containers:
- image: crccheck/hello-world
name: express-server
ports:
- containerPort: 8000
---
apiVersion: v1
kind: Service
metadata:
labels:
app.oam.dev/appRevision: ""
app.oam.dev/component: express-server
app.oam.dev/name: vela-app
trait.oam.dev/resource: service
trait.oam.dev/type: ingress
name: express-server
spec:
ports:
- port: 8000
targetPort: 8000
selector:
app.oam.dev/component: express-server
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
labels:
app.oam.dev/appRevision: ""
app.oam.dev/component: express-server
app.oam.dev/name: vela-app
trait.oam.dev/resource: ingress
trait.oam.dev/type: ingress
name: express-server
spec:
rules:
- host: testsvc.example.com
http:
paths:
- backend:
serviceName: express-server
servicePort: 8000
path: /
---
```
In this example, the definitions(`webservice` and `ingress`) which `vela-app` depends on are the built-in
components and traits of KubeVela. You can also use `-d `or `--definitions` to specify your local definition files.
`-d `or `--definitions` permits users to provide capability definitions used in the application from local files.
`dry-run` cmd will prioritize the provided capabilities than the living ones in the cluster.

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

View File

@ -2,15 +2,13 @@
title: 版本对比
---
更进一步的验证需求是,升级部署版本所带来的表现是否符合期望。但我们同样希望,这个验证在本地试运行时就可以完成。
KubeVela 提供版本对比Live-diff这个功能来满足你的需求。它可以让你不用真的对运行时集群进行操作在本地就为你提供应用升级时的预览来进行确认。
KubeVela 提供版本对比Live-diff这个功能来满足这样的需求它可以让你不用真的对运行时集群进行操作在本地就为你提供应用升级时的预览来进行确认。
预览所提供的信息,会包括应用部署计划的新增、修改和移除等信息,同时也包括其中的组件和运维特征的相关信息。
### 如何使用
我们同样使用如下的 YMAL 文件进行讲解:
我们使用如下的 YMAL 文件进行讲解:
```yaml
# app.yaml

View File

@ -0,0 +1,134 @@
---
title: 本地试运行
---
如果你是一个 DevOps 用户或者运维管理员,并且对 Kubernetes 有所了解,为了保证一个应用部署计划在 Kubernetes 运行时集群的表现符合期望,在开发调试阶段,你也可以通过下面的试运行功能提前确认这个部署计划背后的逻辑是否正确。
KubeVela 提供了本地试运行Dry-run的功能来满足你的这个需求。
### 如何使用
我们将以一个应用部署计划的示例,来进行讲解。
首先编写如下的 YAML 文件:
```yaml
# app.yaml
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: vela-app
spec:
components:
- name: express-server
type: webservice
properties:
image: crccheck/hello-world
port: 8000
traits:
- type: ingress
properties:
domain: testsvc.example.com
http:
"/": 8000
```
可以看到,我们的期望是交付一个 Web Service 的组件,使用来自 `crccheck/hello-world` 的镜像,并最终提供一个可供对外访问的网关,地址域名为 `testsvc.example.com`,端口号 8000。
然后打开本地试运行模式,使用如下命令:
```shell
kubectl vela dry-run -f app.yaml
```
```console
---
# Application(vela-app) -- Comopnent(express-server)
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.oam.dev/appRevision: ""
app.oam.dev/component: express-server
app.oam.dev/name: vela-app
workload.oam.dev/type: webservice
spec:
selector:
matchLabels:
app.oam.dev/component: express-server
template:
metadata:
labels:
app.oam.dev/component: express-server
spec:
containers:
- image: crccheck/hello-world
name: express-server
ports:
- containerPort: 8000
---
apiVersion: v1
kind: Service
metadata:
labels:
app.oam.dev/appRevision: ""
app.oam.dev/component: express-server
app.oam.dev/name: vela-app
trait.oam.dev/resource: service
trait.oam.dev/type: ingress
name: express-server
spec:
ports:
- port: 8000
targetPort: 8000
selector:
app.oam.dev/component: express-server
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
labels:
app.oam.dev/appRevision: ""
app.oam.dev/component: express-server
app.oam.dev/name: vela-app
trait.oam.dev/resource: ingress
trait.oam.dev/type: ingress
name: express-server
spec:
rules:
- host: testsvc.example.com
http:
paths:
- backend:
serviceName: express-server
servicePort: 8000
path: /
---
```
查看本地试运行模式给出的信息,我们可以进行确认:
1. Kubernetes 集群内部 Service 和我们期望的 `kind: Deployment` 部署,在相关的镜像地址、域名端口上,是否能匹配。
2. 最终对外的 Ingress 网关,与 Kubernetes 集群内部的 `Service`,在相关的镜像地址、域名端口上,是否能匹配。
在完成上述信息确认之后,我们就能进行后续的开发调试步骤了。
最后,你还可以通过 `kubectl vela dry-run -h` 来查看更多可用的本地试运行模式:
```
Usage:
vela dry-run
Examples:
kubectl vela dry-run
Flags:
-d, --definition string specify a definition file or directory, it will only be used in dry-run rather than applied to K8s cluster
-f, --file string application file name (default "./app.yaml")
-h, --help help for dry-run
-n, --namespace string specify namespace of the definition file, by default is default namespace (default "default")
```

View File

@ -86,4 +86,4 @@ $ kubectl get deployment myapp-demo-podinfo -o json | jq '.spec.template.spec.co
KubeVela 会根据 Helm Chart 中的 [`values.schema.json`](https://helm.sh/docs/topics/charts/#schema-files) 自动生成 OpenAPI v3 JSON schema并将其存储在一个 ` ConfigMap` 在与定义对象相同的 `namespace` 中。 此外,如果 Chart 作者未提供 `values.schema.json`KubeVela 将根据其 `values.yaml` 文件自动生成 OpenAPI v3 JSON 模式。
请查看 [Generate Forms from Definitions](/docs/platform-engineers/openapi-v3-json-schema) 指南,了解有关使用此架构呈现 GUI 表单的更多详细信息。
请查看 [Generate Forms from Definitions](/docs/platform-engineers/openapi-v3-json-schema) 指南,了解有关使用此架构呈现 GUI 表单的更多详细信息。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 454 KiB