Feat: add the get started document (#628)

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
This commit is contained in:
barnettZQG 2022-04-27 08:50:30 +08:00 committed by GitHub
parent 255b9d241e
commit a6c494ea43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 446 additions and 181 deletions

View File

@ -1,6 +1,8 @@
---
title: Install kubectl plugin
draft: true
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
@ -21,10 +23,13 @@ values={[
1. [Install and set up](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) Krew on your machine.
2. Discover plugins available on Krew:
```shell
kubectl krew update
```
3. install kubectl vela:
```shell script
kubectl krew install vela
```
@ -33,6 +38,7 @@ kubectl krew install vela
<TabItem value="script">
**macOS/Linux**
```shell script
curl -fsSl https://kubevela.io/script/install-kubectl-vela.sh | bash
```
@ -43,8 +49,6 @@ Kubectl will discover it from your system path automatically.
</TabItem>
</Tabs>
## Usage
```shell
@ -55,4 +59,4 @@ Usage:
kubectl vela [flags]
kubectl vela [command]
```
```

View File

@ -1,5 +1,6 @@
---
title: Overview
draft: true
---
To achieve best user experience for your platform, we recommend platform builders to create simple and user friendly UI for end users instead of exposing full platform level details to them. Some common practices include building GUI console, adopting DSL, or creating a user friendly command line tool.

View File

@ -6,13 +6,11 @@ title: Deploy First Application
Welcome to KubeVela! In this section, we show you how to deliver your first app.
## Deploy a simple application via CLI
## Deploy a classic application via CLI
A simple deployment definition in KubeVela looks as below:
A classic application configuration in KubeVela looks as below, there are one component and one trait, to deploy a stateless service with one instance. More advanced, there are three policies and three workflow steps, to deploy the application to two targets.
```yaml
cat <<EOF | vela up -f -
# YAML begins
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
@ -23,16 +21,69 @@ spec:
type: webservice
properties:
image: crccheck/hello-world
ports:
ports:
- port: 8000
expose: true
# YAML ends
EOF
traits:
- type: scaler
properties:
replicas: 1
policies:
- name: target-default
type: topology
properties:
# The cluster with name local is installed the KubeVela.
clusters: ["local"]
namespace: "default"
- name: target-prod
type: topology
properties:
clusters: ["local"]
namespace: "prod"
- name: deploy-ha
type: override
properties:
components:
- type: webservice
traits:
- type: scaler
properties:
replicas: 2
workflow:
steps:
- name: deploy2default
type: deploy
properties:
policies: ["target-default"]
- name: deploy2prod
type: deploy
properties:
policies: ["target-prod", "deploy-ha"]
```
This command will deploy a web service component to target environment, which in our case is the Kubernetes cluster that KubeVela itself is installed.
* Starting deploy the application
```bash
$ vela up -f https://kubevela.net/example/applications/first-app.yaml
```
* View the process and status of the application deploy
```bash
$ vela status first-vela-app
```
The application will become a `workflowSuspend` status if the first step is successfully run.
* Resume the workflow
```bash
$ vela workflow resume first-vela-app
```
* Access the application
```bash
$ vela port-forward first-vela-app 8000:8000
<xmp>
Hello World

View File

@ -8,11 +8,9 @@ title: 交付第一个应用
## 通过 CLI 部署应用
一个基础的应用定义及部署方式如下所述:
下面给出了一个经典的 OAM 应用定义它包括了一个无状态服务组件和运维特征三个部署策略和带有三个部署的工作流。此应用描述的含义是将一个服务部署到两个目标命名空间并且在第一个目标部署完成后等待人工审核后部署到第二个目标且在第二个目标时部署2个实例。
```yaml
cat <<EOF | vela up -f -
# YAML begins
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
@ -23,16 +21,72 @@ spec:
type: webservice
properties:
image: crccheck/hello-world
ports:
ports:
- port: 8000
expose: true
# YAML ends
EOF
traits:
- type: scaler
properties:
replicas: 1
policies:
- name: target-default
type: topology
properties:
# local 集群即 Kubevela 所在的集群
clusters: ["local"]
namespace: "default"
- name: target-prod
type: topology
properties:
clusters: ["local"]
namespace: "prod"
- name: deploy-ha
type: override
properties:
components:
- type: webservice
traits:
- type: scaler
properties:
replicas: 2
workflow:
steps:
- name: deploy2default
type: deploy
properties:
policies: ["target-default"]
- type: suspend
- name: deploy2prod
type: deploy
properties:
policies: ["target-prod", "deploy-ha"]
```
复制上述命名并执行后,一个简单的应用即可完成部署,需要注意的是需要你的部署环境可以正常获取 `crccheck/hello-world` 镜像。部署完成后可以通过下述方式来访问该应用。
* 开始应用部署
```bash
$ vela up -f https://kubevela.net/example/applications/first-app.yaml
```
> 需要注意的是需要你的部署环境可以正常获取 `crccheck/hello-world` 镜像
* 查看部署状态
```bash
$ vela status first-vela-app
```
正常情况下应用完成第一个目标部署后进入暂停状态。
* 人工审核,批准应用进入第二个目标部署
```bash
$ vela workflow resume first-vela-app
```
* 通过下述方式来访问该应用
```bash
$ vela port-forward first-vela-app 8000:8000
<xmp>
Hello World
@ -49,7 +103,7 @@ Hello World
</xmp>
```
到这里,你已完成了第一个简单应用的部署,它仅包括一个组件,暂未涉及运维特征、工作流和多集群等特性
到这里,你已完成了第一个应用的部署。
> 目前,通过 CLI 创建的应用会同步到 UI 进行可视化,但它是只读的。

View File

@ -8,11 +8,9 @@ title: 交付第一个应用
## 通过 CLI 部署应用
一个基础的应用定义及部署方式如下所述:
下面给出了一个经典的 OAM 应用定义它包括了一个无状态服务组件和运维特征三个部署策略和带有三个部署的工作流。此应用描述的含义是将一个服务部署到两个目标命名空间并且在第一个目标部署完成后等待人工审核后部署到第二个目标且在第二个目标时部署2个实例。
```yaml
cat <<EOF | vela up -f -
# YAML begins
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
@ -23,16 +21,72 @@ spec:
type: webservice
properties:
image: crccheck/hello-world
ports:
ports:
- port: 8000
expose: true
# YAML ends
EOF
traits:
- type: scaler
properties:
replicas: 1
policies:
- name: target-default
type: topology
properties:
# local 集群即 Kubevela 所在的集群
clusters: ["local"]
namespace: "default"
- name: target-prod
type: topology
properties:
clusters: ["local"]
namespace: "prod"
- name: deploy-ha
type: override
properties:
components:
- type: webservice
traits:
- type: scaler
properties:
replicas: 2
workflow:
steps:
- name: deploy2default
type: deploy
properties:
policies: ["target-default"]
- type: suspend
- name: deploy2prod
type: deploy
properties:
policies: ["target-prod", "deploy-ha"]
```
复制上述命名并执行后,一个简单的应用即可完成部署,需要注意的是需要你的部署环境可以正常获取 `crccheck/hello-world` 镜像。部署完成后可以通过下述方式来访问该应用。
* 开始应用部署
```bash
$ vela up -f https://kubevela.net/example/applications/first-app.yaml
```
> 需要注意的是需要你的部署环境可以正常获取 `crccheck/hello-world` 镜像
* 查看部署状态
```bash
$ vela status first-vela-app
```
正常情况下应用完成第一个目标部署后进入暂停状态。
* 人工审核,批准应用进入第二个目标部署
```bash
$ vela workflow resume first-vela-app
```
* 通过下述方式来访问该应用
```bash
$ vela port-forward first-vela-app 8000:8000
<xmp>
Hello World
@ -49,7 +103,7 @@ Hello World
</xmp>
```
到这里,你已完成了第一个简单应用的部署,它仅包括一个组件,暂未涉及运维特征、工作流和多集群等特性
到这里,你已完成了第一个应用的部署。
> 目前,通过 CLI 创建的应用会同步到 UI 进行可视化,但它是只读的。

View File

@ -1,96 +1,94 @@
const { Component } = require("react");
const { Component } = require('react');
module.exports = {
docs: [
"getting-started/introduction",
"install",
'getting-started/introduction',
'install',
'quick-start',
{
type: "category",
label: "Basics",
collapsed: false,
items: [
"getting-started/core-concept",
"getting-started/architecture",
],
type: 'category',
label: 'Basics',
collapsed: true,
items: ['getting-started/core-concept', 'getting-started/architecture'],
},
{
type: "category",
label: "User Guide",
type: 'category',
label: 'User Guide',
collapsed: false,
items: [
"tutorials/webservice",
"tutorials/helm",
"tutorials/k8s-object",
"tutorials/consume-cloud-services",
'tutorials/webservice',
'tutorials/helm',
'tutorials/k8s-object',
'tutorials/consume-cloud-services',
{
type: "category",
label: "Deploy with more workload type",
type: 'category',
label: 'Deploy with more workload type',
collapsed: true,
items: [
"end-user/components/cue/task",
"end-user/components/kustomize",
"end-user/components/ref-objects",
"end-user/components/more",
'end-user/components/cue/task',
'end-user/components/kustomize',
'end-user/components/ref-objects',
'end-user/components/more',
],
},
"case-studies/multi-cluster",
"tutorials/jenkins",
"tutorials/trigger",
"case-studies/gitops",
'case-studies/multi-cluster',
'tutorials/jenkins',
'tutorials/trigger',
'case-studies/gitops',
{
type: "category",
label: "How-to Guides",
type: 'category',
label: 'How-to Guides',
collapsed: true,
items: [
{
"Cloud Resources": [
"end-user/components/cloud-services/provision-and-consume-cloud-services",
"end-user/components/cloud-services/provision-and-initiate-database",
"end-user/components/cloud-services/secure-your-database-connection",
"end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database",
'Cloud Resources': [
'end-user/components/cloud-services/provision-and-consume-cloud-services',
'end-user/components/cloud-services/provision-and-initiate-database',
'end-user/components/cloud-services/secure-your-database-connection',
'end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database',
],
},
{
"Deploy applications": [
"how-to/dashboard/application/create-application",
"how-to/dashboard/application/bind-new-environment",
"tutorials/workflows",
"how-to/dashboard/application/deploy-application",
"how-to/dashboard/application/get-application-instance",
"tutorials/scaler",
"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/recycle-environment",
"how-to/dashboard/application/delete-application",
'Deploy applications': [
'how-to/dashboard/application/create-application',
'how-to/dashboard/application/bind-new-environment',
'tutorials/workflows',
'how-to/dashboard/application/deploy-application',
'how-to/dashboard/application/get-application-instance',
'tutorials/scaler',
'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/recycle-environment',
'how-to/dashboard/application/delete-application',
],
},
{
"Day-2 Operations": [
"end-user/traits/rollout",
"end-user/traits/ingress",
"end-user/traits/service-binding",
"end-user/traits/sidecar",
"end-user/policies/health",
"end-user/workflow/webhook-notification",
"end-user/service-account-integration",
"how-to/dashboard/trigger/overview",
"end-user/traits/more",
'Day-2 Operations': [
'end-user/traits/rollout',
'end-user/traits/ingress',
'end-user/traits/service-binding',
'end-user/traits/sidecar',
'end-user/policies/health',
'end-user/workflow/webhook-notification',
'end-user/service-account-integration',
'how-to/dashboard/trigger/overview',
'end-user/traits/more',
],
},
{
"Manage integration configs": [
"how-to/dashboard/config/dex-connectors",
"how-to/dashboard/config/helm-repo",
'Manage integration configs': [
'how-to/dashboard/config/dex-connectors',
'how-to/dashboard/config/helm-repo',
],
},
{
"Advanced Features": [
"end-user/workflow/component-dependency-parameter",
"end-user/version-control",
"end-user/policies/apply-once",
"end-user/policies/gc",
'Advanced Features': [
'end-user/workflow/component-dependency-parameter',
'end-user/version-control',
'end-user/policies/apply-once',
'end-user/policies/gc',
],
},
],
@ -98,122 +96,122 @@ module.exports = {
],
},
{
type: "category",
label: "Operator Manual",
type: 'category',
label: 'Operator Manual',
items: [
"tutorials/sso",
"how-to/dashboard/user/user",
"how-to/dashboard/user/rbac",
"how-to/dashboard/user/project",
'tutorials/sso',
'how-to/dashboard/user/user',
'how-to/dashboard/user/rbac',
'how-to/dashboard/user/project',
{
"Manage resource": [
"platform-engineers/system-operation/managing-clusters",
"how-to/dashboard/target/overview",
'Manage resource': [
'platform-engineers/system-operation/managing-clusters',
'how-to/dashboard/target/overview',
],
},
"how-to/addon",
'how-to/addon',
{
"Install or upgrade": [
"platform-engineers/system-operation/bootstrap-parameters",
"platform-engineers/advanced-install",
"platform-engineers/system-operation/offline-installation",
'Install or upgrade': [
'platform-engineers/system-operation/bootstrap-parameters',
'platform-engineers/advanced-install',
'platform-engineers/system-operation/offline-installation',
],
},
"platform-engineers/system-operation/observability",
"platform-engineers/system-operation/performance-finetuning",
'platform-engineers/system-operation/observability',
'platform-engineers/system-operation/performance-finetuning',
{
type: "category",
label: "Extension",
type: 'category',
label: 'Extension',
collapsed: true,
items: [
{
type: "category",
label: "Learning OAM",
type: 'category',
label: 'Learning OAM',
collapsed: false,
items: [
"platform-engineers/oam/oam-model",
"platform-engineers/oam/x-definition",
'platform-engineers/oam/oam-model',
'platform-engineers/oam/x-definition',
],
},
{
"Learning CUE": [
"platform-engineers/cue/basic",
"platform-engineers/cue/definition-edit",
"platform-engineers/cue/advanced",
'Learning CUE': [
'platform-engineers/cue/basic',
'platform-engineers/cue/definition-edit',
'platform-engineers/cue/advanced',
],
},
{
Addons: ["platform-engineers/addon/intro"],
Addons: ['platform-engineers/addon/intro'],
},
"platform-engineers/components/custom-component",
'platform-engineers/components/custom-component',
{
"Cloud Resources": [
"platform-engineers/addon/terraform",
"platform-engineers/components/component-terraform",
'Cloud Resources': [
'platform-engineers/addon/terraform',
'platform-engineers/components/component-terraform',
],
},
{
type: "category",
label: "Traits System",
type: 'category',
label: 'Traits System',
items: [
"platform-engineers/traits/customize-trait",
"platform-engineers/traits/patch-trait",
"platform-engineers/traits/status",
"platform-engineers/traits/advanced",
'platform-engineers/traits/customize-trait',
'platform-engineers/traits/patch-trait',
'platform-engineers/traits/status',
'platform-engineers/traits/advanced',
],
},
{
"Workflow System": [
"platform-engineers/workflow/workflow",
"platform-engineers/workflow/cue-actions",
"platform-engineers/workflow/working-mechanism",
'Workflow System': [
'platform-engineers/workflow/workflow',
'platform-engineers/workflow/cue-actions',
'platform-engineers/workflow/working-mechanism',
],
},
"platform-engineers/system-operation/velaql",
"platform-engineers/debug/dry-run",
"platform-engineers/x-def-version",
'platform-engineers/system-operation/velaql',
'platform-engineers/debug/dry-run',
'platform-engineers/x-def-version',
],
},
],
},
"contributor/overview",
'contributor/overview',
{
type: "category",
label: "References",
type: 'category',
label: 'References',
items: [
"cli/vela",
'cli/vela',
{
type: "category",
label: "Built-in Addons",
type: 'category',
label: 'Built-in Addons',
items: [
"reference/addons/overview",
"reference/addons/velaux",
"reference/addons/terraform",
"reference/addons/ai",
'reference/addons/overview',
'reference/addons/velaux',
'reference/addons/terraform',
'reference/addons/ai',
],
},
"end-user/components/cloud-services/cloud-resources-list",
"end-user/components/references",
"end-user/traits/references",
"end-user/policies/references",
"end-user/workflow/built-in-workflow-defs",
"reference/ui-schema",
"reference/user-improvement-plan",
'end-user/components/cloud-services/cloud-resources-list',
'end-user/components/references',
'end-user/traits/references',
'end-user/policies/references',
'end-user/workflow/built-in-workflow-defs',
'reference/ui-schema',
'reference/user-improvement-plan',
{
label: "VelaUX API Doc",
type: "link",
href: "https://kubevela.stoplight.io/docs/kubevela/b3A6NDI5NzQxMzM-detail-definition",
label: 'VelaUX API Doc',
type: 'link',
href: 'https://kubevela.stoplight.io/docs/kubevela/b3A6NDI5NzQxMzM-detail-definition',
},
],
},
{
type: "category",
label: "Roadmap",
items: ["roadmap/README"],
type: 'category',
label: 'Roadmap',
items: ['roadmap/README'],
},
{
type: "doc",
id: "developers/references/devex/faq",
type: 'doc',
id: 'developers/references/devex/faq',
},
],
};

View File

@ -0,0 +1,47 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-app
spec:
components:
- name: express-server
type: webservice
properties:
image: crccheck/hello-world
ports:
- port: 8000
expose: true
traits:
- type: scaler
properties:
replicas: 1
policies:
- name: target-default
type: topology
properties:
clusters: ["local"]
namespace: "default"
- name: target-prod
type: topology
properties:
clusters: ["local"]
namespace: "prod"
- name: deploy-ha
type: override
properties:
components:
- type: webservice
traits:
- type: scaler
properties:
replicas: 2
workflow:
steps:
- name: deploy2default
type: deploy
properties:
policies: ["target-default"]
- name: deploy2prod
type: deploy
properties:
policies: ["target-prod", "deploy-ha"]

View File

@ -1,6 +1,8 @@
---
title: Install kubectl plugin
draft: true
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
@ -21,10 +23,13 @@ values={[
1. [Install and set up](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) Krew on your machine.
2. Discover plugins available on Krew:
```shell
kubectl krew update
```
3. install kubectl vela:
```shell script
kubectl krew install vela
```
@ -33,6 +38,7 @@ kubectl krew install vela
<TabItem value="script">
**macOS/Linux**
```shell script
curl -fsSl https://kubevela.io/script/install-kubectl-vela.sh | bash
```
@ -43,8 +49,6 @@ Kubectl will discover it from your system path automatically.
</TabItem>
</Tabs>
## Usage
```shell
@ -55,4 +59,4 @@ Usage:
kubectl vela [flags]
kubectl vela [command]
```
```

View File

@ -1,5 +1,6 @@
---
title: Overview
draft: true
---
To achieve best user experience for your platform, we recommend platform builders to create simple and user friendly UI for end users instead of exposing full platform level details to them. Some common practices include building GUI console, adopting DSL, or creating a user friendly command line tool.

View File

@ -6,13 +6,11 @@ title: Deploy First Application
Welcome to KubeVela! In this section, we show you how to deliver your first app.
## Deploy a simple application via CLI
## Deploy a classic application via CLI
A simple deployment definition in KubeVela looks as below:
A classic application configuration in KubeVela looks as below, there are one component and one trait, to deploy a stateless service with one instance. More advanced, there are three policies and three workflow steps, to deploy the application to two targets.
```yaml
cat <<EOF | vela up -f -
# YAML begins
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
@ -23,16 +21,69 @@ spec:
type: webservice
properties:
image: crccheck/hello-world
ports:
ports:
- port: 8000
expose: true
# YAML ends
EOF
traits:
- type: scaler
properties:
replicas: 1
policies:
- name: target-default
type: topology
properties:
# The cluster with name local is installed the KubeVela.
clusters: ["local"]
namespace: "default"
- name: target-prod
type: topology
properties:
clusters: ["local"]
namespace: "prod"
- name: deploy-ha
type: override
properties:
components:
- type: webservice
traits:
- type: scaler
properties:
replicas: 2
workflow:
steps:
- name: deploy2default
type: deploy
properties:
policies: ["target-default"]
- name: deploy2prod
type: deploy
properties:
policies: ["target-prod", "deploy-ha"]
```
This command will deploy a web service component to target environment, which in our case is the Kubernetes cluster that KubeVela itself is installed.
* Starting deploy the application
```bash
$ vela up -f https://kubevela.net/example/applications/first-app.yaml
```
* View the process and status of the application deploy
```bash
$ vela status first-vela-app
```
The application will become a `workflowSuspend` status if the first step is successfully run.
* Resume the workflow
```bash
$ vela workflow resume first-vela-app
```
* Access the application
```bash
$ vela port-forward first-vela-app 8000:8000
<xmp>
Hello World

View File

@ -5,18 +5,18 @@
"id": "version-v1.3/getting-started/introduction"
},
{
"collapsed": false,
"type": "doc",
"id": "version-v1.3/install"
},
{
"type": "doc",
"id": "version-v1.3/quick-start"
},
{
"collapsed": true,
"type": "category",
"label": "Getting Started",
"label": "Basics",
"items": [
{
"type": "doc",
"id": "version-v1.3/install"
},
{
"type": "doc",
"id": "version-v1.3/quick-start"
},
{
"type": "doc",
"id": "version-v1.3/getting-started/core-concept"