refine zh docs
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
This commit is contained in:
parent
237fc9aa48
commit
757d3b02d7
|
@ -67,7 +67,13 @@ EOF
|
|||
You can check the deploy result by running `vela status`
|
||||
|
||||
```bash
|
||||
$ vela status basic-topology -n examples
|
||||
vela status basic-topology -n examples
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>expected output</summary>
|
||||
|
||||
```
|
||||
About:
|
||||
|
||||
Name: basic-topology
|
||||
|
@ -103,6 +109,7 @@ Services:
|
|||
Traits:
|
||||
✅ expose
|
||||
```
|
||||
</details>
|
||||
|
||||
### Debugging Multi-cluster Application
|
||||
|
||||
|
|
|
@ -5,13 +5,24 @@ description: This section introduces some scenarios of cloud resources managemen
|
|||
|
||||
Here're the scenarios KubeVela already supported by Using Terraform.
|
||||
|
||||
## Before Starting
|
||||
|
||||
- Make sure you have [terraform addon](../../../reference/addons/terraform) enabled.
|
||||
```
|
||||
vela addon enable terraform
|
||||
```
|
||||
|
||||
:::tip
|
||||
When you're using a specific cloud, you should also enable the corresponding cloud provider addon to make the component types exist.
|
||||
:::
|
||||
|
||||
## Provision ECS
|
||||
|
||||
- [Provision ECS with EIP for proxy Intranet Service](https://kubevela.io/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
- [Provision ECS with EIP for proxy Intranet Service](/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
|
||||
## Provision and use databases
|
||||
|
||||
- [Provision and Binding Cloud Resources](../../../tutorials/consume-cloud-services).
|
||||
- [Provision and Binding Cloud Resources](./provision-and-consume-database).
|
||||
- [Secure your Database Connection](./secure-your-database-connection).
|
||||
- [Provision an RDS instance with more than one database](./provision-an-RDS-instance-with-more-than-one-database).
|
||||
- [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database).
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: Provision an RDS instance with more than one database
|
||||
---
|
||||
|
||||
:::tip
|
||||
This section requires your platform engineers have already enabled [terraform addon](../../../reference/addons/terraform).
|
||||
:::
|
||||
|
||||
In the guide [Provision and Binding Cloud Resources](../../../tutorials/consume-cloud-services) and [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database),
|
||||
only one database will be created in an RDS instance. This tutorial will show you how to create more than one database in an RDS instance.
|
||||
|
||||
|
@ -24,16 +28,13 @@ contains the following attributes: name, character_set, description.
|
|||
]
|
||||
```
|
||||
|
||||
| Name | Description | Type | Required | Default |
|
||||
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|----------|---------|
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
| Name | Description | Type | Required | Default |
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- | -------- | ------- |
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
|
||||
Applying the following application can create more than one database in an RDS instance.
|
||||
|
||||
:::caution
|
||||
This section requires your platform engineers have already enabled [cloud resources addon](../../../reference/addons/terraform).
|
||||
:::
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
title: Provision and Binding Database
|
||||
---
|
||||
|
||||
This tutorial will talk about how to provision and consume Alibaba Cloud RDS (and OSS) by Terraform.
|
||||
|
||||
:::caution
|
||||
This section requires your platform engineers have already enabled [cloud resources addon](../../../reference/addons/terraform).
|
||||
:::tip
|
||||
This section requires your platform engineers have already enabled [terraform addon](../../../reference/addons/terraform).
|
||||
:::
|
||||
|
||||
This tutorial will talk about how to provision and consume Alibaba Cloud RDS (and OSS) by Terraform.
|
||||
|
||||
Let's deploy the [application](https://github.com/kubevela/kubevela/tree/master/docs/examples/terraform/cloud-resource-provision-and-consume/application.yaml)
|
||||
below to provision Alibaba Cloud OSS and RDS cloud resources, and consume them by the web component.
|
||||
|
||||
|
|
|
@ -273,6 +273,11 @@ For enabled addons, if no applications to use definitions, you can click the dis
|
|||
|
||||
If you're a system infra or operator, you can refer to extension documents to learn how to [make your own addon and registry](../../platform-engineers/addon/intro), including [extend cloud resources by addon](../../platform-engineers/addon/terraform).
|
||||
|
||||
:::tip
|
||||
Here's a blog introduces [how to build addon from scratch using redis operator as example](/blog/2022/10/18/building-addon-introduction), you can read it as an end to end tutorial!
|
||||
:::
|
||||
|
||||
|
||||
## Extend KubeVela as a Developer
|
||||
|
||||
If you're extremely interested in KubeVela, you can also extend more features as a developer.
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: Make Your Own Addon
|
||||
---
|
||||
|
||||
:::tip
|
||||
Here's a blog introduces [how to build addon from scratch using redis operator as example](/blog/2022/10/18/building-addon-introduction), you can read it as an end to end tutorial!
|
||||
:::
|
||||
|
||||
A KubeVela addon is a collection that can contain the following three types of files;
|
||||
* `Basic information file` that contains `metadata.yaml` and `README.md`.
|
||||
* `OAM module file` that defines KubeVela extensibility points, including [Definitions](../../getting-started/definition), [UI-Schema](../../reference/ui-schema) or [topology-rules](../../reference/topology-rule).
|
||||
|
@ -38,7 +42,9 @@ Not all of these directories or files are necessary, let's explain them one by o
|
|||
|
||||
### Basic information file
|
||||
|
||||
> This type of file is required in an addon.
|
||||
:::caution
|
||||
This type of file is required in an addon.
|
||||
:::
|
||||
|
||||
#### metadata.yaml
|
||||
|
||||
|
@ -69,18 +75,18 @@ invisible: false
|
|||
|
||||
Here's the usage of every field:
|
||||
|
||||
| Field | Required | Type | Usage |
|
||||
|:----:|:---:|:--:|:------:|
|
||||
| name | yes | string | The name of the addon. |
|
||||
| version | yes | string | The version of addon, increase for every change and follow [SemVer](https://semver.org/) rule. |
|
||||
| description | yes | string | Description of the addon. |
|
||||
| icon | no | string | Icon of the addon, will display in addon dashboard. |
|
||||
| url | no | string | The official website of the project behind the addon. |
|
||||
| tags | no | []string | The tags to display and organize the addon. |
|
||||
| dependencies | no | []{ name: string } | Names of other addons it depends on. KubeVela will make sure these dependencies are enabled before installing this addon. |
|
||||
| system.vela | no | string | Required version of vela controller, vela CLI will block the installation if vela controller can't match the requirements. |
|
||||
| system.kubernetes | no | string | Required version of Kubernetes, vela CLI will block the installation if Kubernetes cluster can't match the requirements. |
|
||||
| deployTo.runtimeCluster | no | bool | By default, the addon will not be installed in the managed clusters. If it's `true`, it will be delivered to all managed clusters automatically. (This field only take effect when application template file is YAML typed) |
|
||||
| Field | Required | Type | Usage |
|
||||
| :---------------------: | :------: | :----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| name | yes | string | The name of the addon. |
|
||||
| version | yes | string | The version of addon, increase for every change and follow [SemVer](https://semver.org/) rule. |
|
||||
| description | yes | string | Description of the addon. |
|
||||
| icon | no | string | Icon of the addon, will display in addon dashboard. |
|
||||
| url | no | string | The official website of the project behind the addon. |
|
||||
| tags | no | []string | The tags to display and organize the addon. |
|
||||
| dependencies | no | []{ name: string } | Names of other addons it depends on. KubeVela will make sure these dependencies are enabled before installing this addon. |
|
||||
| system.vela | no | string | Required version of vela controller, vela CLI will block the installation if vela controller can't match the requirements. |
|
||||
| system.kubernetes | no | string | Required version of Kubernetes, vela CLI will block the installation if Kubernetes cluster can't match the requirements. |
|
||||
| deployTo.runtimeCluster | no | bool | By default, the addon will not be installed in the managed clusters. If it's `true`, it will be delivered to all managed clusters automatically. (This field only take effect when application template file is YAML typed) |
|
||||
|
||||
#### README.md (Required)
|
||||
|
||||
|
@ -95,13 +101,17 @@ There is no restrict rules for an [experimental addon](https://github.com/kubeve
|
|||
|
||||
### OAM module file
|
||||
|
||||
> This type of file isn't required in an addon.
|
||||
:::tip
|
||||
This type of file is optional in an addon.
|
||||
:::
|
||||
|
||||
#### Definition files (`definitions/` folder)
|
||||
|
||||
The `definitions/` folder is used to store `Definition`, which can be a YAML file of ComponentDefinition, TraitDefinitions or WorkflowStepDefinitions Kubernetes CustomResource. It can also be a CUE file that defines KubeVela [Definitions](../../getting-started/definition), which will be rendered into the corresponding Kubernetes objects and applied to the cluster when enabling the addon.
|
||||
|
||||
> Please notice: These definitions will only be applied to the control plane.
|
||||
:::note
|
||||
These definitions will only be applied to the control plane.
|
||||
:::
|
||||
|
||||
#### UI-Schema (`schemas/` folder)
|
||||
|
||||
|
@ -109,7 +119,9 @@ The `schemas/` folder is used to store the [UI schema](../../reference/ui-schema
|
|||
|
||||
### Application description file
|
||||
|
||||
> This type of file isn't required in an addon.
|
||||
:::tip
|
||||
This type of file is optional in an addon.
|
||||
:::
|
||||
|
||||
Through the above introduction, we know that the Definition of an addon usually should be supported by a Kubernetes operator. The operator should be defined in a KubeVela application and installed by KubeVela application controller. So the function of application description file is describing this application. Application description file contains two types of file: application template file (template.yaml or template.cue) and resources files which under `resources/` folder.
|
||||
|
||||
|
|
|
@ -51,33 +51,33 @@ Here's a list about images or helm charts of all community addons that should be
|
|||
|
||||
You need sync these images to your own image registry, and modify the related addon files to reference you own registry.
|
||||
|
||||
|Images|files|
|
||||
|:----:|:----:|
|
||||
| fluxcd/helm-controller:v0.11.1| fluxcd/resources/deployment/helm-controller.yaml|
|
||||
| fluxcd/image-automation-controller:v0.14.0|fluxcd/resources/deployment/image-automation-controller.yaml |
|
||||
|fluxcd/image-reflector-controller:v0.11.0|fluxcd/resources/deployment/image-reflector-controller.yaml|
|
||||
|fluxcd/kustomize-controller:v0.13.1|fluxcd/resources/deployment/kustomize-controller.yaml|
|
||||
|fluxcd/source-controller:v0.15.3|fluxcd/resources/deployment/source-controller.yaml|
|
||||
| Images | files |
|
||||
| :----------------------------------------: | :----------------------------------------------------------: |
|
||||
| fluxcd/helm-controller:v0.11.1 | fluxcd/resources/deployment/helm-controller.yaml |
|
||||
| fluxcd/image-automation-controller:v0.14.0 | fluxcd/resources/deployment/image-automation-controller.yaml |
|
||||
| fluxcd/image-reflector-controller:v0.11.0 | fluxcd/resources/deployment/image-reflector-controller.yaml |
|
||||
| fluxcd/kustomize-controller:v0.13.1 | fluxcd/resources/deployment/kustomize-controller.yaml |
|
||||
| fluxcd/source-controller:v0.15.3 | fluxcd/resources/deployment/source-controller.yaml |
|
||||
|
||||
### 2. OCM
|
||||
|
||||
|Images|files|
|
||||
| :----:| :----: |
|
||||
|quay.io/open-cluster-management/registration-operator:latest|ocm-cluster-manager/resources/operator/operator.yaml|
|
||||
| Images | files |
|
||||
| :----------------------------------------------------------: | :--------------------------------------------------: |
|
||||
| quay.io/open-cluster-management/registration-operator:latest | ocm-cluster-manager/resources/operator/operator.yaml |
|
||||
|
||||
### 3. VelaUX
|
||||
|
||||
There is no need to modify the addon files for enabling this addon, you only need to sync these images and enable this addon with repo args to reference your own registry.
|
||||
|
||||
|Images|
|
||||
| :----:|
|
||||
|oamdev/vela-apiserver:v1.2.3|
|
||||
|oamdev/oamdev/velaux::v1.2.3|
|
||||
| Images |
|
||||
| :--------------------------: |
|
||||
| oamdev/vela-apiserver:v1.2.3 |
|
||||
| oamdev/oamdev/velaux::v1.2.3 |
|
||||
|
||||
eg:
|
||||
|
||||
```yaml
|
||||
$ vela addon enable addons/velaux/ repo=<仓库地址>
|
||||
$ vela addon enable addons/velaux/ repo=<addon-registry-url>
|
||||
```
|
||||
|
||||
### 4. Terraform
|
||||
|
|
|
@ -24,7 +24,7 @@ The official KubeVela CLI Docker image is hosted on DockerHub in the `oamdev/vel
|
|||
To run the KubeVela CLI Docker image, use the `docker run` command.
|
||||
|
||||
```
|
||||
$ docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
```
|
||||
|
||||
This is how the command functions:
|
||||
|
|
|
@ -11,13 +11,13 @@ This section will introduce how to use OCM with KubeVela.
|
|||
The installation of OCM is directly available through `vela addon`. There are two addons you need to install if you want to use KubeVela with OCM.
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-hub-control-plane
|
||||
vela addon enable ocm-hub-control-plane
|
||||
```
|
||||
|
||||
This addon allows you to use the basic capabilities provided by OCM. For example, you can create OCM ManifestWorks to dispatch resources directly. But KubeVela will not use OCM for its application management for now.
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-gateway-manager-addon
|
||||
vela addon enable ocm-gateway-manager-addon
|
||||
```
|
||||
|
||||
Enabling the second addon will allow you to let KubeVela use the underlying OCM managed clusters through cluster gateway.
|
||||
|
|
|
@ -12,7 +12,10 @@ Starting from here, you will learn to use the KubeVela Addons to install plug-in
|
|||
|
||||
- Choose a Helm Chart you want to deploy. In the tutorial, we take [bitnami/redis](https://github.com/bitnami/charts/tree/master/bitnami/redis) as an example.
|
||||
- Ensure that the cluster you deliver has a usable default StorageClass. Most of our delivery middleware requires data persistence, and the default StorageClass is needed to allocate PV.
|
||||
- Enable the VelaUX addon for UI console. If you are only CLI users, you can skip to [Deploy via CLI](#deploy-via-cli)
|
||||
- Make sure you have VelaUX addon enabled for UI console. If you are only CLI users, you can skip to [Deploy via CLI](#deploy-via-cli)
|
||||
```
|
||||
vela addon enable velaux
|
||||
```
|
||||
|
||||
## Enable fluxcd addon
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ In this section, we will introduce how to deploy a container-based application w
|
|||
## Before starting
|
||||
|
||||
- Containerize your business, you need a container image within your image registry that can be accessed by KubeVela.
|
||||
- Enable the [VelaUX addon](../reference/addons/velaux) by running command `vela addon enable velaux`.
|
||||
- Make sure you have [VelaUX addon](../reference/addons/velaux) enabled.
|
||||
```
|
||||
vela addon enable velaux
|
||||
```
|
||||
|
||||
## Creating an application
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ func main() {
|
|||
if idx < 1 {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(s, "http://") || strings.HasPrefix(s, "https://") || strings.HasPrefix(s, "#") {
|
||||
if strings.HasPrefix(s, "http://") || strings.HasPrefix(s, "https://") || strings.HasPrefix(s, "#") || strings.HasPrefix(s, "/blog") || strings.HasPrefix(s, "/zh/blog") {
|
||||
continue
|
||||
}
|
||||
d := strings.Index(s, ")")
|
||||
|
|
|
@ -1,16 +1,29 @@
|
|||
---
|
||||
title: 概览
|
||||
title: Terraform 云资源概览
|
||||
description: 该部分介绍云资源管理的一些场景
|
||||
---
|
||||
|
||||
本节将介绍如何基于 KubeVela 和 terraform 扩展云资源能力,以及以及在社区支持的部分云厂商和资源。
|
||||
|
||||
## 开始之前
|
||||
|
||||
- 确定你已经启用了 [terraform 插件](../../../reference/addons/terraform) 。
|
||||
```
|
||||
vela addon enable terraform
|
||||
```
|
||||
|
||||
:::tip
|
||||
当你使用具体某个云厂商的资源时,你还要启用对应的厂商 provider 插件。具体可以参考[terraform 插件](../../../reference/addons/terraform) 文档了解详情。
|
||||
:::
|
||||
|
||||
## Provision ECS
|
||||
|
||||
- [Provision ECS with EIP for proxy Intranet Service](https://kubevela.io/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
- [创建 ECS 资源并结合 EIP 搭建一个内网穿透服务示例](/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
|
||||
## 部署和使用数据库
|
||||
|
||||
- [创建和使用云资源](../../../tutorials/consume-cloud-services)
|
||||
- [创建和使用云资源](./provision-and-consume-database)
|
||||
- [安全访问数据库](./secure-your-database-connection)
|
||||
- [RDS 实例创建多数据库](./provision-an-RDS-instance-with-more-than-one-database)
|
||||
- [数据库创建和初始化](./provision-and-initiate-database)
|
||||
|
||||
- [创建一个数据库示例并被不同应用共享](./provision-instance-and-database-separately).
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: RDS 实例创建多数据库
|
||||
---
|
||||
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
指南 [创建和使用云资源](./provision-and-consume-database)和[数据库创建和初始化](./provision-and-initiate-database)里,在一个
|
||||
RDS 实例中,只创建了一个数据库。本教程将告诉你如何在一个 RDS 实例中创建多个数据库。
|
||||
|
||||
|
@ -23,14 +27,13 @@ RDS 实例中,只创建了一个数据库。本教程将告诉你如何在一
|
|||
]
|
||||
```
|
||||
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|-------|-----|
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- | -------- | ------ |
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
|
||||
执行以下 Yaml 文件可以在 RDS 实例中创建多个数据库。
|
||||
|
||||
> ⚠️ 请确认管理员已经安装了 [云资源插件](../../../reference/addons/terraform)。
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
title: 创建和使用数据库
|
||||
---
|
||||
|
||||
本教程将介绍如何通过 Terraform 部署阿里云 RDS (和 OSS)。
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
> ⚠️ 请确认管理员已经安装了 [云资源插件](../../../reference/addons/terraform)。
|
||||
本教程将介绍如何通过 Terraform 部署阿里云 RDS (和 OSS)。
|
||||
|
||||
下面我们以阿里云关系型数据库(RDS)的例子,作为示例进行讲解。
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: 数据库创建和初始化
|
||||
---
|
||||
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
本教程将讨论如何为一个关系型数据库导入 SQL 文件完成初始化,并启动一个依赖数据库的应用程序。
|
||||
|
||||
[Favorite Links](https://github.com/kubevela-contrib/nodejs-mysql-links)是一个有趣的项目,它可以将所有你最喜欢的网络链接在一个应用程序中。
|
||||
|
@ -18,7 +22,7 @@ title: 数据库创建和初始化
|
|||
阿里云 RDS 预览版支持在创建 RDS 实例时导入具有这些属性的SQL文件。
|
||||
|
||||
| Name | Description | Type | Required | Default |
|
||||
|---------------------|-----------------------------------------------------------------|--------|----------|---------|
|
||||
| ------------------- | --------------------------------------------------------------- | ------ | -------- | ------- |
|
||||
| sql_file | The name of SQL file in the bucket, like `db.sql` | string | false | |
|
||||
| sql_bucket_name | The bucket name of the SQL file. like `oss://example` | string | false | |
|
||||
| sql_bucket_endpoint | The endpoint of the bucket. like `oss-cn-hangzhou.aliyuncs.com` | string | false | |
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
---
|
||||
title: Provision Instance and Database Separately
|
||||
---
|
||||
|
||||
In the guide [Provision and Binding Cloud Resources](../../../tutorials/consume-cloud-services) and [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database),
|
||||
We create an RDS instance and a database together. However, you can create an RDS instance and more than one database on it.
|
||||
This pattern is useful when you want to save costs of creating multiple instances.
|
||||
|
||||
This guide will take Alibaba Cloud RDS as an example to show how to create an RDS instance more than one database separately.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. `terraform` addon has been enabled
|
||||
2. `terraform-alibaba` addon has been enabled, version >= 1.0.3
|
||||
3. Credentials have been configured using `vela provider add terraform-alibaba`
|
||||
If you have problems, you can follow to this [instruction](../../../reference/addons/terraform) to setup.
|
||||
|
||||
## Steps
|
||||
|
||||
### Provision the RDS instance
|
||||
|
||||
Using the following Application to create an RDS instance.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: app-rds-instance
|
||||
spec:
|
||||
components:
|
||||
- name: rds-instance
|
||||
type: alibaba-rds-instance
|
||||
properties:
|
||||
instance_name: test_single_instance
|
||||
```
|
||||
|
||||
Now you can get the RDS instance ID by running the following command:
|
||||
|
||||
```shell
|
||||
kubectl get configuration -n default rds-instance -ojson | jq -r .status.apply.outputs.instance_id.value
|
||||
```
|
||||
|
||||
The result will be like
|
||||
|
||||
```shell
|
||||
rm-bp1du0wif7kXXXXX
|
||||
```
|
||||
|
||||
|
||||
### Provision the RDS database
|
||||
|
||||
Using the following Application to create an RDS database. Remember to replace `<your-region>` and `<your-instance-id>` with the real values.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: app-db-1
|
||||
spec:
|
||||
components:
|
||||
- name: demo-database-1
|
||||
type: alibaba-rds-database
|
||||
properties:
|
||||
region: <your-region>
|
||||
existing_instance_id: <your-instance-id>
|
||||
database_name: first_database
|
||||
password: fake_password
|
||||
account_name: first_db_account
|
||||
```
|
||||
|
||||
About 2 minutes later, you can check the app status by running `vela status`:
|
||||
|
||||
```shell
|
||||
vela status app-db-1 -n default
|
||||
```
|
||||
|
||||
## Conclusion
|
||||
|
||||
You have learnt how to create an RDS instance and a database with different applications. As a platform engineer, you can
|
||||
use this pattern to provide database sharing the same instance to your users. When the business is growing, you can migrate
|
||||
database to an exclusive instance.
|
|
@ -2,6 +2,10 @@
|
|||
title: 安全访问数据库
|
||||
---
|
||||
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
在指南 [创建和使用云资源](./provision-and-consume-database)和[数据库创建和初始化](./provision-and-initiate-database),业务组件
|
||||
使用数据库的公网连接 `DB_PUBLIC_HOS` 来访问数据库。当你想试用,创建 PoC,或在云提供商集群之外使用数据库时,这是必要的。但是,对于数据库的生产使用来说,它是不安全的。
|
||||
|
||||
|
@ -11,10 +15,10 @@ title: 安全访问数据库
|
|||
|
||||
在[阿里云 RDS 参考文档](./terraform/alibaba-rds)中,这两个属性非常重要。
|
||||
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------|--------|-------|-----|
|
||||
| vswitch_id | The vswitch id of the RDS instance. If set, the RDS instance will be created in VPC, or it will be created in classic network. | string | false | |
|
||||
| allocate_public_connection | Whether to allocate public connection for a RDS instance. | bool | false | |
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------ | -------- | ------ |
|
||||
| vswitch_id | The vswitch id of the RDS instance. If set, the RDS instance will be created in VPC, or it will be created in classic network. | string | false | |
|
||||
| allocate_public_connection | Whether to allocate public connection for a RDS instance. | bool | false | |
|
||||
|
||||
将 `vswitch_id` 设置为与你的 ACK 集群的子网之一,或属于集群 VPC 的一个新子网。
|
||||
将 `allocation_public_connection` 设置为 `false` 以禁止创建互联网连接。
|
||||
|
|
|
@ -21,9 +21,14 @@ KubeVela 安装时就自带了很多开箱即用的功能,可以查看如下
|
|||
|
||||
KubeVela 官方团队维护了一个默认的插件仓库 (https://addons.kubevela.net) ,默认情况下会从这个仓库实时发现。
|
||||
|
||||
|
||||
```shell
|
||||
$ vela addon list
|
||||
vela addon list
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
NAME REGISTRY DESCRIPTION AVAILABLE-VERSIONS STATUS
|
||||
ocm-gateway-manager-addon KubeVela ocm-gateway-manager-addon is the OCM addon automates the cluster-gateway apiserver. [1.3.2, 1.3.0, 1.1.11] disabled
|
||||
rollout KubeVela Provides basic batch publishing capability. [1.3.0, 1.2.4, 1.2.3] disabled
|
||||
|
@ -42,11 +47,18 @@ fluxcd KubeVela Extended workload to do continuo
|
|||
velaux KubeVela KubeVela User Experience (UX). An extensible, application-oriented delivery and management Dashboard. [v1.3.0, v1.3.0-beta.2, 1.2.4] enabled (v1.3.0)
|
||||
terraform-alibaba KubeVela Kubernetes Terraform Controller for Alibaba Cloud [1.0.2, 1.0.1] disabled
|
||||
```
|
||||
</details>
|
||||
|
||||
### 安装插件
|
||||
|
||||
```
|
||||
$ vela addon enable fluxcd
|
||||
vela addon enable fluxcd
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
I0111 21:45:24.553174 89345 apply.go:106] "creating object" name="addon-fluxcd" resource="core.oam.dev/v1beta1, Kind=Application"
|
||||
I0111 21:45:25.258914 89345 apply.go:106] "creating object" name="helm" resource="core.oam.dev/v1beta1, Kind=ComponentDefinition"
|
||||
I0111 21:45:25.342731 89345 apply.go:106] "creating object" name="kustomize-json-patch" resource="core.oam.dev/v1beta1, Kind=TraitDefinition"
|
||||
|
@ -56,6 +68,7 @@ I0111 21:45:25.625815 89345 apply.go:106] "creating object" name="kustomize-st
|
|||
I0111 21:45:25.660129 89345 apply.go:106] "creating object" name="component-uischema-helm" resource="/v1, Kind=ConfigMap"
|
||||
Addon: fluxcd enabled Successfully.
|
||||
```
|
||||
</details>
|
||||
|
||||
#### 安装特定版本的插件
|
||||
|
||||
|
@ -84,7 +97,13 @@ vela addon enable velaux repo=<your repo address>
|
|||
如果你想获取插件的详细信息,或者查看插件支持哪些启用参数等其他信息,你就可以用 `addon status` 的命令。 例如:
|
||||
|
||||
```shell
|
||||
$ vela addon enable velaux --verbose
|
||||
vela addon enable velaux --verbose
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
velaux: disabled
|
||||
KubeVela User Experience (UX). An extensible, application-oriented delivery and management Dashboard.
|
||||
==> Registry Name
|
||||
|
@ -115,6 +134,7 @@ KubeVela
|
|||
default: "kubevela-vela-core"
|
||||
required: ✔
|
||||
```
|
||||
</details>
|
||||
|
||||
如上所示, 命令结果包含了一个插件的参数详细信息,可用版本,依赖的其他的插件等信息。
|
||||
|
||||
|
@ -122,7 +142,9 @@ KubeVela
|
|||
|
||||
### 删除/卸载已安装的插件
|
||||
|
||||
> 删除前请确认插件对应的能力没有被任何应用使用。
|
||||
:::caution
|
||||
删除前请确认插件对应的能力没有被任何应用使用。
|
||||
:::
|
||||
|
||||
```
|
||||
$ vela addon disable fluxcd
|
||||
|
@ -132,10 +154,17 @@ Successfully disable addon:fluxcd
|
|||
### 查看插件的下载仓库
|
||||
|
||||
```
|
||||
$ vela addon registry list
|
||||
vela addon registry list
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Name Type URL
|
||||
KubeVela helm https://addons.kubevela.net
|
||||
```
|
||||
</details>
|
||||
|
||||
KubeVela 社区在 Github 上维护了一个官方的[正式插件包仓库](https://github.com/kubevela/catalog/tree/master/addons) 和一个[试验阶段插件包仓库](https://github.com/kubevela/catalog/tree/master/experimental) 。你在相应的仓库中找到插件包的定义文件。
|
||||
|
||||
|
@ -146,26 +175,47 @@ KubeVela 社区在 Github 上维护了一个官方的[正式插件包仓库](htt
|
|||
你可以添加自己的插件包仓库,目前支持 OSS 和 Github 两种仓库类型。
|
||||
|
||||
```
|
||||
$ vela addon registry add experimental --type OSS --endpoint=https://addons.kubevela.net --path=experimental/
|
||||
vela addon registry add experimental --type OSS --endpoint=https://addons.kubevela.net --path=experimental/
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Successfully add an addon registry experimental
|
||||
```
|
||||
</details>
|
||||
|
||||
### 删除一个插件包仓库
|
||||
|
||||
```
|
||||
$ vela addon registry delete experimental
|
||||
vela addon registry delete experimental
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Successfully delete an addon registry experimental
|
||||
```
|
||||
</details>
|
||||
|
||||
### 多集群环境中启用插件包
|
||||
|
||||
如果你的环境中添加了若干个子集群,启用插件包时会默认在管控集群和所有子集群中安装此插件包。但如果子集群在某个插件包启用之后加入环境当中,则需要通过升级操作在新加入集群中安装此插件包。如下所示
|
||||
|
||||
```
|
||||
$ vela addon upgrade velaux
|
||||
vela addon upgrade velaux
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Addon:
|
||||
enabled Successfully
|
||||
```
|
||||
</details>
|
||||
|
||||
### 离线安装插件包
|
||||
|
||||
|
@ -195,7 +245,8 @@ Addon: velaux enabled Successfully
|
|||
|
||||
### 编写自己的插件包
|
||||
|
||||
请参考[插件包制作文档](../../platform-engineers/addon/intro)。
|
||||
- 参考博客教程[手把手教你制作一个 Redis 插件](/zh/blog/2022/10/18/building-addon-introduction)。
|
||||
- 参考[插件包制作文档](../../platform-engineers/addon/intro)了解插件的功能细节。
|
||||
|
||||
## 作为开发者自定义和扩展
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
title: 引用资源做多集群分发
|
||||
---
|
||||
|
||||
> 开始这部分之前需要你先了解使用如何进行多集群应用的部署。你可以参考 [多集群应用交付](../../case-studies/multi-cluster) 章节了解相关基础细节.
|
||||
:::tip
|
||||
开始这部分之前需要你先了解使用如何进行多集群应用的部署。你可以参考 [多集群应用交付](../../case-studies/multi-cluster) 章节了解相关基础细节.
|
||||
:::
|
||||
|
||||
你可以使用 KubeVela 引用已有的 Kubernetes 对象并将它们分发到其他位置来完成以下场景:
|
||||
|
||||
|
|
|
@ -200,8 +200,9 @@ hangzhou2 ─── examples ─── Deployment/podinfo updated 2022-04-13
|
|||
|
||||
### 重新发布历史版本
|
||||
|
||||
> 这个功能在 KubeVela v1.3.1 之后被引入。
|
||||
|
||||
:::note
|
||||
这个功能在 KubeVela v1.3.1+ 版本生效。
|
||||
:::
|
||||
|
||||
版本回滚可以让你直接回退到上一次成功的状态。另一种方式是重新发布一个旧版本,这种方式的区别在于它可以回退到任一可用的历史版本中(不只是最近成功的),但是会触发工作流的重新运行。
|
||||
|
||||
|
@ -226,4 +227,6 @@ podinfo-v4 beta1 true 65844934c2d07288 2022-04-
|
|||
|
||||
你会发现 *beta1* 版本和 *alpha1* 版本的哈希值完全一致。
|
||||
|
||||
> 默认情况下,应用最多能持有 10 个历史版本。如果你想要修改这个数字,可以在控制器启动参数中设置 `--application-revision-limit`。
|
||||
:::caution
|
||||
默认情况下,应用最多能持有 10 个历史版本。如果你想要修改这个数字,可以在控制器启动参数中设置 `--application-revision-limit`。
|
||||
:::
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: 核心概念
|
||||
title: OAM 应用(Application)
|
||||
---
|
||||
|
||||
KubeVela 围绕着云原生应用交付和管理场景展开,背后的应用交付模型是 [Open Application Model](../platform-engineers/oam/oam-model),简称 OAM 。
|
||||
|
@ -66,7 +66,3 @@ spec:
|
|||
### 不再配置漂移
|
||||
|
||||
除了扩展性和效率以外,许多围绕 IaC 的工具都会引发生产环境和配置中心数据不一致的问题,业界称之为“配置漂移”,引起配置漂移的核心原因往往来自于生产环境的配置修改有多个来源、平台对配置的覆盖不完整等。KubeVela 通过一个 Application 对象涵盖了所有应用涉及的配置、并通过 [Kubernetes 控制循环](https://kubernetes.io/docs/concepts/architecture/controller/) 来维护状态,并基于此始终面向终态维护配置的一致性、消除配置漂移的问题,且保留基于 IaC 模式的扩展性和灵活性。
|
||||
|
||||
## 下一步
|
||||
|
||||
- 查看 [架构文档](./architecture),了解 KubeVela 的整体架构。
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: 模块定义
|
||||
title: 模块定义(Definition)
|
||||
---
|
||||
|
||||
模块定义是组成 KubeVela 平台的基本扩展能力单元,一个模块定义就像乐高积木,它将底层的能力封装成抽象的模块,使得这些能力可以被最终用户快速理解、使用并和其他能力组装、衔接,最终构成一个具有丰富功能的业务应用。模块定义最大的优势是可以被**分发**和**共享**,在不同的业务应用中重复使用,在基于 KubeVela 的不同平台上均能执行。
|
||||
|
@ -165,7 +165,9 @@ Application 也是一种 Kubernetes 的 CRD,你可以通过 `kubectl` 工具
|
|||
|
||||
### 自定义
|
||||
|
||||
> **⚠️ 请注意,在多数情况下,你不需要编写自定义模块,除非你的目的是扩展 KubeVela 的系统能力。在此之前,我们建议你先查看 KubeVela 内置的模块定义以及扩展插件,可能它们已经足够满足你的需求。**
|
||||
:::caution
|
||||
在多数情况下,你不需要编写自定义模块,除非你的目的是扩展 KubeVela 的系统能力。在此之前,我们建议你先查看 KubeVela 内置的模块定义以及扩展插件,可能它们已经足够满足你的需求。
|
||||
:::
|
||||
|
||||
KubeVela 使用 [CUE 配置语言](https://cuelang.org/)来编写自定义模块,如果你对 CUE 语言还不熟悉也不必担心,可以查看 [CUE 入门指南](../platform-engineers/cue/basic),花 15 分钟即可了解基本的实用操作。
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: 自定义插件
|
||||
---
|
||||
|
||||
:::tip
|
||||
如果你喜欢手把手教程,你可以阅读[这篇博客](/zh/blog/2022/10/18/building-addon-introduction),它以 Redis Operator 为例教你如何制作一个插件并介绍用户的使用体验。
|
||||
:::
|
||||
|
||||
一个 KubeVela 插件就是一个主要包含了以下三类文件的集合:
|
||||
* 插件的`基本信息文件` 包括元数据文件(metadata.yaml)和插件介绍文档(README.md)。
|
||||
* 定义 KubeVela 的`OAM 模型文件`。包括[模块化能力](../../getting-started/definition), [UI 扩展](../../reference/ui-schema),[资源拓扑规则](../../reference/topology-rule)等。
|
||||
|
@ -71,18 +75,18 @@ invisible: false
|
|||
|
||||
所有的字段及其作用如下:
|
||||
|
||||
| Field | Required | Type | Usage |
|
||||
|:----:|:---:|:--:|:------:|
|
||||
| name | yes | string | 名称 |
|
||||
| version | yes | string | 版本,每次变更递增且符合 [SemVer](https://semver.org/) 规范 |
|
||||
| description | yes | string | 描述 |
|
||||
| icon | no | string | 图标,图标将在 VelaUX 的插件页面展示 |
|
||||
| url | no | string | 插件所包含项目的官网地址 |
|
||||
| tags | no | []string | 标签 |
|
||||
| dependencies | no | []{ name: string } | 依赖的其他插件,安装是 KubeVela 会保证依赖插件均已安装 |
|
||||
| system.vela | no | string | 环境中所要求的 KubeVela 的版本,如果不满足,安装将会被拒绝 |
|
||||
| system.kubernetes | no | string | 环境中所要求的 Kubernetes 的版本 |
|
||||
| deployTo.runtimeCluster | no | bool | 插件是否可以安装到子集群,默认不设置该字段插件不会安装在任何子集群中 (只在 YAML 描述插件应用时生效) |
|
||||
| Field | Required | Type | Usage |
|
||||
| :---------------------: | :------: | :----------------: | :---------------------------------------------------------------------------------------------------: |
|
||||
| name | yes | string | 名称 |
|
||||
| version | yes | string | 版本,每次变更递增且符合 [SemVer](https://semver.org/) 规范 |
|
||||
| description | yes | string | 描述 |
|
||||
| icon | no | string | 图标,图标将在 VelaUX 的插件页面展示 |
|
||||
| url | no | string | 插件所包含项目的官网地址 |
|
||||
| tags | no | []string | 标签 |
|
||||
| dependencies | no | []{ name: string } | 依赖的其他插件,安装是 KubeVela 会保证依赖插件均已安装 |
|
||||
| system.vela | no | string | 环境中所要求的 KubeVela 的版本,如果不满足,安装将会被拒绝 |
|
||||
| system.kubernetes | no | string | 环境中所要求的 Kubernetes 的版本 |
|
||||
| deployTo.runtimeCluster | no | bool | 插件是否可以安装到子集群,默认不设置该字段插件不会安装在任何子集群中 (只在 YAML 描述插件应用时生效) |
|
||||
|
||||
#### 介绍文档 (README.md)
|
||||
|
||||
|
|
|
@ -4,9 +4,10 @@ title: 基本机制
|
|||
|
||||
KubeVela 从 v1.4 版本引入认证和应用程序交付和管理授权。这篇文章将深入理解根本原理,并展示它如何运作。
|
||||
|
||||
> 这一基本机制主要侧重于 KubeVela 的应用。 VelaUX 在它上面构建了自己的认证和授权。
|
||||
|
||||
> 这篇文章讨论了范围较广的 KubeVela 认证和授权,包括设计、实现和高级用法。 实际使用并不需要阅读并了解所有材料。
|
||||
:::tip
|
||||
本文档讨论了范围较广的 KubeVela 认证和授权,包括设计、实现和高级用法。 实际使用并不需要阅读并了解所有材料。
|
||||
这一基本机制主要侧重于 KubeVela 的应用。 VelaUX 在它上面构建了自己的认证和授权。
|
||||
:::
|
||||
|
||||
## 背景知识
|
||||
|
||||
|
@ -204,11 +205,11 @@ KubeVela 的多集群应用模拟依赖于 ClusterGateway 的 ClientIdentityPene
|
|||
|
||||
默认情况下,KubeVela 不会将所有身份信息传递给 Header。 你可以通过控制器起始参数或 helm 值来控制它。
|
||||
|
||||
| Controller Flags | Helm Values | Type | Default | Explanation |
|
||||
| ---------------------------- | ---------------------------- | ------- | ------------------ | ----------------------------------------------------------------------------------------------------------- |
|
||||
| Controller Flags | Helm Values | Type | Default | Explanation |
|
||||
| ---------------------------- | ---------------------------- | ------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| authentication-with-user | .authentication.withUser | boolean | false | 如果此标志被设置为false,则身份中的用户字段将不会被传递到 Header 中。 只有选定的组才会传递。 在管理集群和控制台由不同的人操作的情况下,控制台操作者可能不想让管理下的集群知道其用户和群之间的对应关系。 |
|
||||
| authentication-default-user | .authentication.defaultUser | string | kubevela:vela-core | 如果身份中的用户字段不用于模拟,此字段将作为模拟的用户使用。 |
|
||||
| authentication-group-pattern | .authentication.groupPattern | string | kubevela:* | 这个字段定义了从身份的 Header 中传递的组模式。 这将有助于控制台使用者限制哪些组应该传入请求到管理的集群。 |
|
||||
| authentication-default-user | .authentication.defaultUser | string | kubevela:vela-core | 如果身份中的用户字段不用于模拟,此字段将作为模拟的用户使用。 |
|
||||
| authentication-group-pattern | .authentication.groupPattern | string | kubevela:* | 这个字段定义了从身份的 Header 中传递的组模式。 这将有助于控制台使用者限制哪些组应该传入请求到管理的集群。 |
|
||||
|
||||
简而言之, 如果你的身份信息的透明度要求很低(如组集群和管理集群由同一团队操作), 你可以设置 `--authentication-user=true` 和 `--authentication-group-pattern=*`。 默认配置使用最安全和最不透明的选项。
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ Docker version 20.10.13, build a224086
|
|||
使用 `docker run` 命令来运行 KubeVela 命令行镜像。
|
||||
|
||||
```
|
||||
$ docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
```
|
||||
|
||||
该命令的作用方式如下:
|
||||
|
|
|
@ -11,13 +11,13 @@ title: 使用 OCM
|
|||
OCM的安装可以通过命令`vela addon`来完成。但在 KubeVela 的环境下使用 OCM,有两个插件必须要安装。
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-hub-control-plane
|
||||
vela addon enable ocm-hub-control-plane
|
||||
`````
|
||||
|
||||
这个插件旨在提供 OCM 的基本功能。例如,你可以通过创建 OCM ManifestWorks 来直接分配资源。 但是目前 KubeVela 并不会使用 OCM 来管理应用。
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-gateway-manager-addon
|
||||
vela addon enable ocm-gateway-manager-addon
|
||||
```
|
||||
|
||||
安装第二个应用可以让 KubeVela 通过 cluster gateway 来使用 OCM的托管集群。
|
||||
|
|
|
@ -1,16 +1,29 @@
|
|||
---
|
||||
title: 概览
|
||||
title: Terraform 云资源概览
|
||||
description: 该部分介绍云资源管理的一些场景
|
||||
---
|
||||
|
||||
本节将介绍如何基于 KubeVela 和 terraform 扩展云资源能力,以及以及在社区支持的部分云厂商和资源。
|
||||
|
||||
## 开始之前
|
||||
|
||||
- 确定你已经启用了 [terraform 插件](../../../reference/addons/terraform) 。
|
||||
```
|
||||
vela addon enable terraform
|
||||
```
|
||||
|
||||
:::tip
|
||||
当你使用具体某个云厂商的资源时,你还要启用对应的厂商 provider 插件。具体可以参考[terraform 插件](../../../reference/addons/terraform) 文档了解详情。
|
||||
:::
|
||||
|
||||
## Provision ECS
|
||||
|
||||
- [Provision ECS with EIP for proxy Intranet Service](https://kubevela.io/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
- [创建 ECS 资源并结合 EIP 搭建一个内网穿透服务示例](/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
|
||||
## 部署和使用数据库
|
||||
|
||||
- [创建和使用云资源](../../../tutorials/consume-cloud-services)
|
||||
- [创建和使用云资源](./provision-and-consume-database)
|
||||
- [安全访问数据库](./secure-your-database-connection)
|
||||
- [RDS 实例创建多数据库](./provision-an-RDS-instance-with-more-than-one-database)
|
||||
- [数据库创建和初始化](./provision-and-initiate-database)
|
||||
|
||||
- [创建一个数据库示例并被不同应用共享](./provision-instance-and-database-separately).
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: RDS 实例创建多数据库
|
||||
---
|
||||
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
指南 [创建和使用云资源](./provision-and-consume-database)和[数据库创建和初始化](./provision-and-initiate-database)里,在一个
|
||||
RDS 实例中,只创建了一个数据库。本教程将告诉你如何在一个 RDS 实例中创建多个数据库。
|
||||
|
||||
|
@ -23,14 +27,13 @@ RDS 实例中,只创建了一个数据库。本教程将告诉你如何在一
|
|||
]
|
||||
```
|
||||
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|-------|-----|
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- | -------- | ------ |
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
|
||||
执行以下 Yaml 文件可以在 RDS 实例中创建多个数据库。
|
||||
|
||||
> ⚠️ 请确认管理员已经安装了 [云资源插件](../../../reference/addons/terraform)。
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
title: 创建和使用数据库
|
||||
---
|
||||
|
||||
本教程将介绍如何通过 Terraform 部署阿里云 RDS (和 OSS)。
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
> ⚠️ 请确认管理员已经安装了 [云资源插件](../../../reference/addons/terraform)。
|
||||
本教程将介绍如何通过 Terraform 部署阿里云 RDS (和 OSS)。
|
||||
|
||||
下面我们以阿里云关系型数据库(RDS)的例子,作为示例进行讲解。
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: 数据库创建和初始化
|
||||
---
|
||||
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
本教程将讨论如何为一个关系型数据库导入 SQL 文件完成初始化,并启动一个依赖数据库的应用程序。
|
||||
|
||||
[Favorite Links](https://github.com/kubevela-contrib/nodejs-mysql-links)是一个有趣的项目,它可以将所有你最喜欢的网络链接在一个应用程序中。
|
||||
|
@ -18,7 +22,7 @@ title: 数据库创建和初始化
|
|||
阿里云 RDS 预览版支持在创建 RDS 实例时导入具有这些属性的SQL文件。
|
||||
|
||||
| Name | Description | Type | Required | Default |
|
||||
|---------------------|-----------------------------------------------------------------|--------|----------|---------|
|
||||
| ------------------- | --------------------------------------------------------------- | ------ | -------- | ------- |
|
||||
| sql_file | The name of SQL file in the bucket, like `db.sql` | string | false | |
|
||||
| sql_bucket_name | The bucket name of the SQL file. like `oss://example` | string | false | |
|
||||
| sql_bucket_endpoint | The endpoint of the bucket. like `oss-cn-hangzhou.aliyuncs.com` | string | false | |
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
---
|
||||
title: Provision Instance and Database Separately
|
||||
---
|
||||
|
||||
In the guide [Provision and Binding Cloud Resources](../../../tutorials/consume-cloud-services) and [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database),
|
||||
We create an RDS instance and a database together. However, you can create an RDS instance and more than one database on it.
|
||||
This pattern is useful when you want to save costs of creating multiple instances.
|
||||
|
||||
This guide will take Alibaba Cloud RDS as an example to show how to create an RDS instance more than one database separately.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. `terraform` addon has been enabled
|
||||
2. `terraform-alibaba` addon has been enabled, version >= 1.0.3
|
||||
3. Credentials have been configured using `vela provider add terraform-alibaba`
|
||||
If you have problems, you can follow to this [instruction](../../../reference/addons/terraform) to setup.
|
||||
|
||||
## Steps
|
||||
|
||||
### Provision the RDS instance
|
||||
|
||||
Using the following Application to create an RDS instance.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: app-rds-instance
|
||||
spec:
|
||||
components:
|
||||
- name: rds-instance
|
||||
type: alibaba-rds-instance
|
||||
properties:
|
||||
instance_name: test_single_instance
|
||||
```
|
||||
|
||||
Now you can get the RDS instance ID by running the following command:
|
||||
|
||||
```shell
|
||||
kubectl get configuration -n default rds-instance -ojson | jq -r .status.apply.outputs.instance_id.value
|
||||
```
|
||||
|
||||
The result will be like
|
||||
|
||||
```shell
|
||||
rm-bp1du0wif7kXXXXX
|
||||
```
|
||||
|
||||
|
||||
### Provision the RDS database
|
||||
|
||||
Using the following Application to create an RDS database. Remember to replace `<your-region>` and `<your-instance-id>` with the real values.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: app-db-1
|
||||
spec:
|
||||
components:
|
||||
- name: demo-database-1
|
||||
type: alibaba-rds-database
|
||||
properties:
|
||||
region: <your-region>
|
||||
existing_instance_id: <your-instance-id>
|
||||
database_name: first_database
|
||||
password: fake_password
|
||||
account_name: first_db_account
|
||||
```
|
||||
|
||||
About 2 minutes later, you can check the app status by running `vela status`:
|
||||
|
||||
```shell
|
||||
vela status app-db-1 -n default
|
||||
```
|
||||
|
||||
## Conclusion
|
||||
|
||||
You have learnt how to create an RDS instance and a database with different applications. As a platform engineer, you can
|
||||
use this pattern to provide database sharing the same instance to your users. When the business is growing, you can migrate
|
||||
database to an exclusive instance.
|
|
@ -2,6 +2,10 @@
|
|||
title: 安全访问数据库
|
||||
---
|
||||
|
||||
:::tip
|
||||
请确认管理员已经安装了 [Terraform 插件](../../../reference/addons/terraform)。
|
||||
:::
|
||||
|
||||
在指南 [创建和使用云资源](./provision-and-consume-database)和[数据库创建和初始化](./provision-and-initiate-database),业务组件
|
||||
使用数据库的公网连接 `DB_PUBLIC_HOS` 来访问数据库。当你想试用,创建 PoC,或在云提供商集群之外使用数据库时,这是必要的。但是,对于数据库的生产使用来说,它是不安全的。
|
||||
|
||||
|
@ -11,10 +15,10 @@ title: 安全访问数据库
|
|||
|
||||
在[阿里云 RDS 参考文档](./terraform/alibaba-rds)中,这两个属性非常重要。
|
||||
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------|--------|-------|-----|
|
||||
| vswitch_id | The vswitch id of the RDS instance. If set, the RDS instance will be created in VPC, or it will be created in classic network. | string | false | |
|
||||
| allocate_public_connection | Whether to allocate public connection for a RDS instance. | bool | false | |
|
||||
| 名称 | 描述 | 类型 | 是否必须 | 默认值 |
|
||||
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------ | -------- | ------ |
|
||||
| vswitch_id | The vswitch id of the RDS instance. If set, the RDS instance will be created in VPC, or it will be created in classic network. | string | false | |
|
||||
| allocate_public_connection | Whether to allocate public connection for a RDS instance. | bool | false | |
|
||||
|
||||
将 `vswitch_id` 设置为与你的 ACK 集群的子网之一,或属于集群 VPC 的一个新子网。
|
||||
将 `allocation_public_connection` 设置为 `false` 以禁止创建互联网连接。
|
||||
|
|
|
@ -21,9 +21,14 @@ KubeVela 安装时就自带了很多开箱即用的功能,可以查看如下
|
|||
|
||||
KubeVela 官方团队维护了一个默认的插件仓库 (https://addons.kubevela.net) ,默认情况下会从这个仓库实时发现。
|
||||
|
||||
|
||||
```shell
|
||||
$ vela addon list
|
||||
vela addon list
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
NAME REGISTRY DESCRIPTION AVAILABLE-VERSIONS STATUS
|
||||
ocm-gateway-manager-addon KubeVela ocm-gateway-manager-addon is the OCM addon automates the cluster-gateway apiserver. [1.3.2, 1.3.0, 1.1.11] disabled
|
||||
rollout KubeVela Provides basic batch publishing capability. [1.3.0, 1.2.4, 1.2.3] disabled
|
||||
|
@ -42,11 +47,18 @@ fluxcd KubeVela Extended workload to do continuo
|
|||
velaux KubeVela KubeVela User Experience (UX). An extensible, application-oriented delivery and management Dashboard. [v1.3.0, v1.3.0-beta.2, 1.2.4] enabled (v1.3.0)
|
||||
terraform-alibaba KubeVela Kubernetes Terraform Controller for Alibaba Cloud [1.0.2, 1.0.1] disabled
|
||||
```
|
||||
</details>
|
||||
|
||||
### 安装插件
|
||||
|
||||
```
|
||||
$ vela addon enable fluxcd
|
||||
vela addon enable fluxcd
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
I0111 21:45:24.553174 89345 apply.go:106] "creating object" name="addon-fluxcd" resource="core.oam.dev/v1beta1, Kind=Application"
|
||||
I0111 21:45:25.258914 89345 apply.go:106] "creating object" name="helm" resource="core.oam.dev/v1beta1, Kind=ComponentDefinition"
|
||||
I0111 21:45:25.342731 89345 apply.go:106] "creating object" name="kustomize-json-patch" resource="core.oam.dev/v1beta1, Kind=TraitDefinition"
|
||||
|
@ -56,6 +68,7 @@ I0111 21:45:25.625815 89345 apply.go:106] "creating object" name="kustomize-st
|
|||
I0111 21:45:25.660129 89345 apply.go:106] "creating object" name="component-uischema-helm" resource="/v1, Kind=ConfigMap"
|
||||
Addon: fluxcd enabled Successfully.
|
||||
```
|
||||
</details>
|
||||
|
||||
#### 安装特定版本的插件
|
||||
|
||||
|
@ -84,7 +97,13 @@ vela addon enable velaux repo=<your repo address>
|
|||
如果你想获取插件的详细信息,或者查看插件支持哪些启用参数等其他信息,你就可以用 `addon status` 的命令。 例如:
|
||||
|
||||
```shell
|
||||
$ vela addon enable velaux --verbose
|
||||
vela addon enable velaux --verbose
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
velaux: disabled
|
||||
KubeVela User Experience (UX). An extensible, application-oriented delivery and management Dashboard.
|
||||
==> Registry Name
|
||||
|
@ -115,6 +134,7 @@ KubeVela
|
|||
default: "kubevela-vela-core"
|
||||
required: ✔
|
||||
```
|
||||
</details>
|
||||
|
||||
如上所示, 命令结果包含了一个插件的参数详细信息,可用版本,依赖的其他的插件等信息。
|
||||
|
||||
|
@ -122,7 +142,9 @@ KubeVela
|
|||
|
||||
### 删除/卸载已安装的插件
|
||||
|
||||
> 删除前请确认插件对应的能力没有被任何应用使用。
|
||||
:::caution
|
||||
删除前请确认插件对应的能力没有被任何应用使用。
|
||||
:::
|
||||
|
||||
```
|
||||
$ vela addon disable fluxcd
|
||||
|
@ -132,10 +154,17 @@ Successfully disable addon:fluxcd
|
|||
### 查看插件的下载仓库
|
||||
|
||||
```
|
||||
$ vela addon registry list
|
||||
vela addon registry list
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Name Type URL
|
||||
KubeVela helm https://addons.kubevela.net
|
||||
```
|
||||
</details>
|
||||
|
||||
KubeVela 社区在 Github 上维护了一个官方的[正式插件包仓库](https://github.com/kubevela/catalog/tree/master/addons) 和一个[试验阶段插件包仓库](https://github.com/kubevela/catalog/tree/master/experimental) 。你在相应的仓库中找到插件包的定义文件。
|
||||
|
||||
|
@ -146,26 +175,47 @@ KubeVela 社区在 Github 上维护了一个官方的[正式插件包仓库](htt
|
|||
你可以添加自己的插件包仓库,目前支持 OSS 和 Github 两种仓库类型。
|
||||
|
||||
```
|
||||
$ vela addon registry add experimental --type OSS --endpoint=https://addons.kubevela.net --path=experimental/
|
||||
vela addon registry add experimental --type OSS --endpoint=https://addons.kubevela.net --path=experimental/
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Successfully add an addon registry experimental
|
||||
```
|
||||
</details>
|
||||
|
||||
### 删除一个插件包仓库
|
||||
|
||||
```
|
||||
$ vela addon registry delete experimental
|
||||
vela addon registry delete experimental
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Successfully delete an addon registry experimental
|
||||
```
|
||||
</details>
|
||||
|
||||
### 多集群环境中启用插件包
|
||||
|
||||
如果你的环境中添加了若干个子集群,启用插件包时会默认在管控集群和所有子集群中安装此插件包。但如果子集群在某个插件包启用之后加入环境当中,则需要通过升级操作在新加入集群中安装此插件包。如下所示
|
||||
|
||||
```
|
||||
$ vela addon upgrade velaux
|
||||
vela addon upgrade velaux
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>期望输出</summary>
|
||||
|
||||
```
|
||||
Addon:
|
||||
enabled Successfully
|
||||
```
|
||||
</details>
|
||||
|
||||
### 离线安装插件包
|
||||
|
||||
|
@ -195,7 +245,8 @@ Addon: velaux enabled Successfully
|
|||
|
||||
### 编写自己的插件包
|
||||
|
||||
请参考[插件包制作文档](../../platform-engineers/addon/intro)。
|
||||
- 参考博客教程[手把手教你制作一个 Redis 插件](/zh/blog/2022/10/18/building-addon-introduction)。
|
||||
- 参考[插件包制作文档](../../platform-engineers/addon/intro)了解插件的功能细节。
|
||||
|
||||
## 作为开发者自定义和扩展
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
title: 引用资源做多集群分发
|
||||
---
|
||||
|
||||
> 开始这部分之前需要你先了解使用如何进行多集群应用的部署。你可以参考 [多集群应用交付](../../case-studies/multi-cluster) 章节了解相关基础细节.
|
||||
:::tip
|
||||
开始这部分之前需要你先了解使用如何进行多集群应用的部署。你可以参考 [多集群应用交付](../../case-studies/multi-cluster) 章节了解相关基础细节.
|
||||
:::
|
||||
|
||||
你可以使用 KubeVela 引用已有的 Kubernetes 对象并将它们分发到其他位置来完成以下场景:
|
||||
|
||||
|
|
|
@ -200,8 +200,9 @@ hangzhou2 ─── examples ─── Deployment/podinfo updated 2022-04-13
|
|||
|
||||
### 重新发布历史版本
|
||||
|
||||
> 这个功能在 KubeVela v1.3.1 之后被引入。
|
||||
|
||||
:::note
|
||||
这个功能在 KubeVela v1.3.1+ 版本生效。
|
||||
:::
|
||||
|
||||
版本回滚可以让你直接回退到上一次成功的状态。另一种方式是重新发布一个旧版本,这种方式的区别在于它可以回退到任一可用的历史版本中(不只是最近成功的),但是会触发工作流的重新运行。
|
||||
|
||||
|
@ -226,4 +227,6 @@ podinfo-v4 beta1 true 65844934c2d07288 2022-04-
|
|||
|
||||
你会发现 *beta1* 版本和 *alpha1* 版本的哈希值完全一致。
|
||||
|
||||
> 默认情况下,应用最多能持有 10 个历史版本。如果你想要修改这个数字,可以在控制器启动参数中设置 `--application-revision-limit`。
|
||||
:::caution
|
||||
默认情况下,应用最多能持有 10 个历史版本。如果你想要修改这个数字,可以在控制器启动参数中设置 `--application-revision-limit`。
|
||||
:::
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: 核心概念
|
||||
title: OAM 应用(Application)
|
||||
---
|
||||
|
||||
KubeVela 围绕着云原生应用交付和管理场景展开,背后的应用交付模型是 [Open Application Model](../platform-engineers/oam/oam-model),简称 OAM 。
|
||||
|
@ -66,7 +66,3 @@ spec:
|
|||
### 不再配置漂移
|
||||
|
||||
除了扩展性和效率以外,许多围绕 IaC 的工具都会引发生产环境和配置中心数据不一致的问题,业界称之为“配置漂移”,引起配置漂移的核心原因往往来自于生产环境的配置修改有多个来源、平台对配置的覆盖不完整等。KubeVela 通过一个 Application 对象涵盖了所有应用涉及的配置、并通过 [Kubernetes 控制循环](https://kubernetes.io/docs/concepts/architecture/controller/) 来维护状态,并基于此始终面向终态维护配置的一致性、消除配置漂移的问题,且保留基于 IaC 模式的扩展性和灵活性。
|
||||
|
||||
## 下一步
|
||||
|
||||
- 查看 [架构文档](./architecture),了解 KubeVela 的整体架构。
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: 模块定义
|
||||
title: 模块定义(Definition)
|
||||
---
|
||||
|
||||
模块定义是组成 KubeVela 平台的基本扩展能力单元,一个模块定义就像乐高积木,它将底层的能力封装成抽象的模块,使得这些能力可以被最终用户快速理解、使用并和其他能力组装、衔接,最终构成一个具有丰富功能的业务应用。模块定义最大的优势是可以被**分发**和**共享**,在不同的业务应用中重复使用,在基于 KubeVela 的不同平台上均能执行。
|
||||
|
@ -165,7 +165,9 @@ Application 也是一种 Kubernetes 的 CRD,你可以通过 `kubectl` 工具
|
|||
|
||||
### 自定义
|
||||
|
||||
> **⚠️ 请注意,在多数情况下,你不需要编写自定义模块,除非你的目的是扩展 KubeVela 的系统能力。在此之前,我们建议你先查看 KubeVela 内置的模块定义以及扩展插件,可能它们已经足够满足你的需求。**
|
||||
:::caution
|
||||
在多数情况下,你不需要编写自定义模块,除非你的目的是扩展 KubeVela 的系统能力。在此之前,我们建议你先查看 KubeVela 内置的模块定义以及扩展插件,可能它们已经足够满足你的需求。
|
||||
:::
|
||||
|
||||
KubeVela 使用 [CUE 配置语言](https://cuelang.org/)来编写自定义模块,如果你对 CUE 语言还不熟悉也不必担心,可以查看 [CUE 入门指南](../platform-engineers/cue/basic),花 15 分钟即可了解基本的实用操作。
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: 自定义插件
|
||||
---
|
||||
|
||||
:::tip
|
||||
如果你喜欢手把手教程,你可以阅读[这篇博客](/zh/blog/2022/10/18/building-addon-introduction),它以 Redis Operator 为例教你如何制作一个插件并介绍用户的使用体验。
|
||||
:::
|
||||
|
||||
一个 KubeVela 插件就是一个主要包含了以下三类文件的集合:
|
||||
* 插件的`基本信息文件` 包括元数据文件(metadata.yaml)和插件介绍文档(README.md)。
|
||||
* 定义 KubeVela 的`OAM 模型文件`。包括[模块化能力](../../getting-started/definition), [UI 扩展](../../reference/ui-schema),[资源拓扑规则](../../reference/topology-rule)等。
|
||||
|
@ -71,18 +75,18 @@ invisible: false
|
|||
|
||||
所有的字段及其作用如下:
|
||||
|
||||
| Field | Required | Type | Usage |
|
||||
|:----:|:---:|:--:|:------:|
|
||||
| name | yes | string | 名称 |
|
||||
| version | yes | string | 版本,每次变更递增且符合 [SemVer](https://semver.org/) 规范 |
|
||||
| description | yes | string | 描述 |
|
||||
| icon | no | string | 图标,图标将在 VelaUX 的插件页面展示 |
|
||||
| url | no | string | 插件所包含项目的官网地址 |
|
||||
| tags | no | []string | 标签 |
|
||||
| dependencies | no | []{ name: string } | 依赖的其他插件,安装是 KubeVela 会保证依赖插件均已安装 |
|
||||
| system.vela | no | string | 环境中所要求的 KubeVela 的版本,如果不满足,安装将会被拒绝 |
|
||||
| system.kubernetes | no | string | 环境中所要求的 Kubernetes 的版本 |
|
||||
| deployTo.runtimeCluster | no | bool | 插件是否可以安装到子集群,默认不设置该字段插件不会安装在任何子集群中 (只在 YAML 描述插件应用时生效) |
|
||||
| Field | Required | Type | Usage |
|
||||
| :---------------------: | :------: | :----------------: | :---------------------------------------------------------------------------------------------------: |
|
||||
| name | yes | string | 名称 |
|
||||
| version | yes | string | 版本,每次变更递增且符合 [SemVer](https://semver.org/) 规范 |
|
||||
| description | yes | string | 描述 |
|
||||
| icon | no | string | 图标,图标将在 VelaUX 的插件页面展示 |
|
||||
| url | no | string | 插件所包含项目的官网地址 |
|
||||
| tags | no | []string | 标签 |
|
||||
| dependencies | no | []{ name: string } | 依赖的其他插件,安装是 KubeVela 会保证依赖插件均已安装 |
|
||||
| system.vela | no | string | 环境中所要求的 KubeVela 的版本,如果不满足,安装将会被拒绝 |
|
||||
| system.kubernetes | no | string | 环境中所要求的 Kubernetes 的版本 |
|
||||
| deployTo.runtimeCluster | no | bool | 插件是否可以安装到子集群,默认不设置该字段插件不会安装在任何子集群中 (只在 YAML 描述插件应用时生效) |
|
||||
|
||||
#### 介绍文档 (README.md)
|
||||
|
||||
|
|
|
@ -4,9 +4,10 @@ title: 基本机制
|
|||
|
||||
KubeVela 从 v1.4 版本引入认证和应用程序交付和管理授权。这篇文章将深入理解根本原理,并展示它如何运作。
|
||||
|
||||
> 这一基本机制主要侧重于 KubeVela 的应用。 VelaUX 在它上面构建了自己的认证和授权。
|
||||
|
||||
> 这篇文章讨论了范围较广的 KubeVela 认证和授权,包括设计、实现和高级用法。 实际使用并不需要阅读并了解所有材料。
|
||||
:::tip
|
||||
本文档讨论了范围较广的 KubeVela 认证和授权,包括设计、实现和高级用法。 实际使用并不需要阅读并了解所有材料。
|
||||
这一基本机制主要侧重于 KubeVela 的应用。 VelaUX 在它上面构建了自己的认证和授权。
|
||||
:::
|
||||
|
||||
## 背景知识
|
||||
|
||||
|
@ -204,11 +205,11 @@ KubeVela 的多集群应用模拟依赖于 ClusterGateway 的 ClientIdentityPene
|
|||
|
||||
默认情况下,KubeVela 不会将所有身份信息传递给 Header。 你可以通过控制器起始参数或 helm 值来控制它。
|
||||
|
||||
| Controller Flags | Helm Values | Type | Default | Explanation |
|
||||
| ---------------------------- | ---------------------------- | ------- | ------------------ | ----------------------------------------------------------------------------------------------------------- |
|
||||
| Controller Flags | Helm Values | Type | Default | Explanation |
|
||||
| ---------------------------- | ---------------------------- | ------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| authentication-with-user | .authentication.withUser | boolean | false | 如果此标志被设置为false,则身份中的用户字段将不会被传递到 Header 中。 只有选定的组才会传递。 在管理集群和控制台由不同的人操作的情况下,控制台操作者可能不想让管理下的集群知道其用户和群之间的对应关系。 |
|
||||
| authentication-default-user | .authentication.defaultUser | string | kubevela:vela-core | 如果身份中的用户字段不用于模拟,此字段将作为模拟的用户使用。 |
|
||||
| authentication-group-pattern | .authentication.groupPattern | string | kubevela:* | 这个字段定义了从身份的 Header 中传递的组模式。 这将有助于控制台使用者限制哪些组应该传入请求到管理的集群。 |
|
||||
| authentication-default-user | .authentication.defaultUser | string | kubevela:vela-core | 如果身份中的用户字段不用于模拟,此字段将作为模拟的用户使用。 |
|
||||
| authentication-group-pattern | .authentication.groupPattern | string | kubevela:* | 这个字段定义了从身份的 Header 中传递的组模式。 这将有助于控制台使用者限制哪些组应该传入请求到管理的集群。 |
|
||||
|
||||
简而言之, 如果你的身份信息的透明度要求很低(如组集群和管理集群由同一团队操作), 你可以设置 `--authentication-user=true` 和 `--authentication-group-pattern=*`。 默认配置使用最安全和最不透明的选项。
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ Docker version 20.10.13, build a224086
|
|||
使用 `docker run` 命令来运行 KubeVela 命令行镜像。
|
||||
|
||||
```
|
||||
$ docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
```
|
||||
|
||||
该命令的作用方式如下:
|
||||
|
|
|
@ -11,13 +11,13 @@ title: 使用 OCM
|
|||
OCM的安装可以通过命令`vela addon`来完成。但在 KubeVela 的环境下使用 OCM,有两个插件必须要安装。
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-hub-control-plane
|
||||
vela addon enable ocm-hub-control-plane
|
||||
`````
|
||||
|
||||
这个插件旨在提供 OCM 的基本功能。例如,你可以通过创建 OCM ManifestWorks 来直接分配资源。 但是目前 KubeVela 并不会使用 OCM 来管理应用。
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-gateway-manager-addon
|
||||
vela addon enable ocm-gateway-manager-addon
|
||||
```
|
||||
|
||||
安装第二个应用可以让 KubeVela 通过 cluster gateway 来使用 OCM的托管集群。
|
||||
|
|
12
sidebars.js
12
sidebars.js
|
@ -76,7 +76,7 @@ module.exports = {
|
|||
{
|
||||
type: 'category',
|
||||
label: 'Terraform',
|
||||
collapsed: false,
|
||||
collapsed: true,
|
||||
link: {
|
||||
type: "doc",
|
||||
id: 'end-user/components/cloud-services/cloud-resource-scenarios',
|
||||
|
@ -246,8 +246,14 @@ module.exports = {
|
|||
},
|
||||
items: [
|
||||
{
|
||||
Addons: [
|
||||
'platform-engineers/addon/intro',
|
||||
type: 'category',
|
||||
label: 'Addons',
|
||||
collapsed: true,
|
||||
link: {
|
||||
type: "doc",
|
||||
id: 'platform-engineers/addon/intro',
|
||||
},
|
||||
items: [
|
||||
'platform-engineers/addon/addon-cue',
|
||||
'platform-engineers/addon/addon-yaml',
|
||||
'reference/topology-rule',
|
||||
|
|
|
@ -67,7 +67,13 @@ EOF
|
|||
You can check the deploy result by running `vela status`
|
||||
|
||||
```bash
|
||||
$ vela status basic-topology -n examples
|
||||
vela status basic-topology -n examples
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>expected output</summary>
|
||||
|
||||
```
|
||||
About:
|
||||
|
||||
Name: basic-topology
|
||||
|
@ -103,6 +109,7 @@ Services:
|
|||
Traits:
|
||||
✅ expose
|
||||
```
|
||||
</details>
|
||||
|
||||
### Debugging Multi-cluster Application
|
||||
|
||||
|
|
|
@ -5,13 +5,24 @@ description: This section introduces some scenarios of cloud resources managemen
|
|||
|
||||
Here're the scenarios KubeVela already supported by Using Terraform.
|
||||
|
||||
## Before Starting
|
||||
|
||||
- Make sure you have [terraform addon](../../../reference/addons/terraform) enabled.
|
||||
```
|
||||
vela addon enable terraform
|
||||
```
|
||||
|
||||
:::tip
|
||||
When you're using a specific cloud, you should also enable the corresponding cloud provider addon to make the component types exist.
|
||||
:::
|
||||
|
||||
## Provision ECS
|
||||
|
||||
- [Provision ECS with EIP for proxy Intranet Service](https://kubevela.io/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
- [Provision ECS with EIP for proxy Intranet Service](/blog/2022/06/27/terraform-integrate-with-vela#part-2-fixing-the-developer-experience-of-kubernetes-port-forwarding).
|
||||
|
||||
## Provision and use databases
|
||||
|
||||
- [Provision and Binding Cloud Resources](../../../tutorials/consume-cloud-services).
|
||||
- [Provision and Binding Cloud Resources](./provision-and-consume-database).
|
||||
- [Secure your Database Connection](./secure-your-database-connection).
|
||||
- [Provision an RDS instance with more than one database](./provision-an-RDS-instance-with-more-than-one-database).
|
||||
- [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database).
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: Provision an RDS instance with more than one database
|
||||
---
|
||||
|
||||
:::tip
|
||||
This section requires your platform engineers have already enabled [terraform addon](../../../reference/addons/terraform).
|
||||
:::
|
||||
|
||||
In the guide [Provision and Binding Cloud Resources](../../../tutorials/consume-cloud-services) and [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database),
|
||||
only one database will be created in an RDS instance. This tutorial will show you how to create more than one database in an RDS instance.
|
||||
|
||||
|
@ -24,16 +28,13 @@ contains the following attributes: name, character_set, description.
|
|||
]
|
||||
```
|
||||
|
||||
| Name | Description | Type | Required | Default |
|
||||
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|----------|---------|
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
| Name | Description | Type | Required | Default |
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- | -------- | ------- |
|
||||
| database_name | Database name | string | false | |
|
||||
| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | |
|
||||
|
||||
Applying the following application can create more than one database in an RDS instance.
|
||||
|
||||
:::caution
|
||||
This section requires your platform engineers have already enabled [cloud resources addon](../../../reference/addons/terraform).
|
||||
:::
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
title: Provision and Binding Database
|
||||
---
|
||||
|
||||
This tutorial will talk about how to provision and consume Alibaba Cloud RDS (and OSS) by Terraform.
|
||||
|
||||
:::caution
|
||||
This section requires your platform engineers have already enabled [cloud resources addon](../../../reference/addons/terraform).
|
||||
:::tip
|
||||
This section requires your platform engineers have already enabled [terraform addon](../../../reference/addons/terraform).
|
||||
:::
|
||||
|
||||
This tutorial will talk about how to provision and consume Alibaba Cloud RDS (and OSS) by Terraform.
|
||||
|
||||
Let's deploy the [application](https://github.com/kubevela/kubevela/tree/master/docs/examples/terraform/cloud-resource-provision-and-consume/application.yaml)
|
||||
below to provision Alibaba Cloud OSS and RDS cloud resources, and consume them by the web component.
|
||||
|
||||
|
|
|
@ -273,6 +273,11 @@ For enabled addons, if no applications to use definitions, you can click the dis
|
|||
|
||||
If you're a system infra or operator, you can refer to extension documents to learn how to [make your own addon and registry](../../platform-engineers/addon/intro), including [extend cloud resources by addon](../../platform-engineers/addon/terraform).
|
||||
|
||||
:::tip
|
||||
Here's a blog introduces [how to build addon from scratch using redis operator as example](/blog/2022/10/18/building-addon-introduction), you can read it as an end to end tutorial!
|
||||
:::
|
||||
|
||||
|
||||
## Extend KubeVela as a Developer
|
||||
|
||||
If you're extremely interested in KubeVela, you can also extend more features as a developer.
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
title: Make Your Own Addon
|
||||
---
|
||||
|
||||
:::tip
|
||||
Here's a blog introduces [how to build addon from scratch using redis operator as example](/blog/2022/10/18/building-addon-introduction), you can read it as an end to end tutorial!
|
||||
:::
|
||||
|
||||
A KubeVela addon is a collection that can contain the following three types of files;
|
||||
* `Basic information file` that contains `metadata.yaml` and `README.md`.
|
||||
* `OAM module file` that defines KubeVela extensibility points, including [Definitions](../../getting-started/definition), [UI-Schema](../../reference/ui-schema) or [topology-rules](../../reference/topology-rule).
|
||||
|
@ -38,7 +42,9 @@ Not all of these directories or files are necessary, let's explain them one by o
|
|||
|
||||
### Basic information file
|
||||
|
||||
> This type of file is required in an addon.
|
||||
:::caution
|
||||
This type of file is required in an addon.
|
||||
:::
|
||||
|
||||
#### metadata.yaml
|
||||
|
||||
|
@ -69,18 +75,18 @@ invisible: false
|
|||
|
||||
Here's the usage of every field:
|
||||
|
||||
| Field | Required | Type | Usage |
|
||||
|:----:|:---:|:--:|:------:|
|
||||
| name | yes | string | The name of the addon. |
|
||||
| version | yes | string | The version of addon, increase for every change and follow [SemVer](https://semver.org/) rule. |
|
||||
| description | yes | string | Description of the addon. |
|
||||
| icon | no | string | Icon of the addon, will display in addon dashboard. |
|
||||
| url | no | string | The official website of the project behind the addon. |
|
||||
| tags | no | []string | The tags to display and organize the addon. |
|
||||
| dependencies | no | []{ name: string } | Names of other addons it depends on. KubeVela will make sure these dependencies are enabled before installing this addon. |
|
||||
| system.vela | no | string | Required version of vela controller, vela CLI will block the installation if vela controller can't match the requirements. |
|
||||
| system.kubernetes | no | string | Required version of Kubernetes, vela CLI will block the installation if Kubernetes cluster can't match the requirements. |
|
||||
| deployTo.runtimeCluster | no | bool | By default, the addon will not be installed in the managed clusters. If it's `true`, it will be delivered to all managed clusters automatically. (This field only take effect when application template file is YAML typed) |
|
||||
| Field | Required | Type | Usage |
|
||||
| :---------------------: | :------: | :----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| name | yes | string | The name of the addon. |
|
||||
| version | yes | string | The version of addon, increase for every change and follow [SemVer](https://semver.org/) rule. |
|
||||
| description | yes | string | Description of the addon. |
|
||||
| icon | no | string | Icon of the addon, will display in addon dashboard. |
|
||||
| url | no | string | The official website of the project behind the addon. |
|
||||
| tags | no | []string | The tags to display and organize the addon. |
|
||||
| dependencies | no | []{ name: string } | Names of other addons it depends on. KubeVela will make sure these dependencies are enabled before installing this addon. |
|
||||
| system.vela | no | string | Required version of vela controller, vela CLI will block the installation if vela controller can't match the requirements. |
|
||||
| system.kubernetes | no | string | Required version of Kubernetes, vela CLI will block the installation if Kubernetes cluster can't match the requirements. |
|
||||
| deployTo.runtimeCluster | no | bool | By default, the addon will not be installed in the managed clusters. If it's `true`, it will be delivered to all managed clusters automatically. (This field only take effect when application template file is YAML typed) |
|
||||
|
||||
#### README.md (Required)
|
||||
|
||||
|
@ -95,13 +101,17 @@ There is no restrict rules for an [experimental addon](https://github.com/kubeve
|
|||
|
||||
### OAM module file
|
||||
|
||||
> This type of file isn't required in an addon.
|
||||
:::tip
|
||||
This type of file is optional in an addon.
|
||||
:::
|
||||
|
||||
#### Definition files (`definitions/` folder)
|
||||
|
||||
The `definitions/` folder is used to store `Definition`, which can be a YAML file of ComponentDefinition, TraitDefinitions or WorkflowStepDefinitions Kubernetes CustomResource. It can also be a CUE file that defines KubeVela [Definitions](../../getting-started/definition), which will be rendered into the corresponding Kubernetes objects and applied to the cluster when enabling the addon.
|
||||
|
||||
> Please notice: These definitions will only be applied to the control plane.
|
||||
:::note
|
||||
These definitions will only be applied to the control plane.
|
||||
:::
|
||||
|
||||
#### UI-Schema (`schemas/` folder)
|
||||
|
||||
|
@ -109,7 +119,9 @@ The `schemas/` folder is used to store the [UI schema](../../reference/ui-schema
|
|||
|
||||
### Application description file
|
||||
|
||||
> This type of file isn't required in an addon.
|
||||
:::tip
|
||||
This type of file is optional in an addon.
|
||||
:::
|
||||
|
||||
Through the above introduction, we know that the Definition of an addon usually should be supported by a Kubernetes operator. The operator should be defined in a KubeVela application and installed by KubeVela application controller. So the function of application description file is describing this application. Application description file contains two types of file: application template file (template.yaml or template.cue) and resources files which under `resources/` folder.
|
||||
|
||||
|
|
|
@ -51,33 +51,33 @@ Here's a list about images or helm charts of all community addons that should be
|
|||
|
||||
You need sync these images to your own image registry, and modify the related addon files to reference you own registry.
|
||||
|
||||
|Images|files|
|
||||
|:----:|:----:|
|
||||
| fluxcd/helm-controller:v0.11.1| fluxcd/resources/deployment/helm-controller.yaml|
|
||||
| fluxcd/image-automation-controller:v0.14.0|fluxcd/resources/deployment/image-automation-controller.yaml |
|
||||
|fluxcd/image-reflector-controller:v0.11.0|fluxcd/resources/deployment/image-reflector-controller.yaml|
|
||||
|fluxcd/kustomize-controller:v0.13.1|fluxcd/resources/deployment/kustomize-controller.yaml|
|
||||
|fluxcd/source-controller:v0.15.3|fluxcd/resources/deployment/source-controller.yaml|
|
||||
| Images | files |
|
||||
| :----------------------------------------: | :----------------------------------------------------------: |
|
||||
| fluxcd/helm-controller:v0.11.1 | fluxcd/resources/deployment/helm-controller.yaml |
|
||||
| fluxcd/image-automation-controller:v0.14.0 | fluxcd/resources/deployment/image-automation-controller.yaml |
|
||||
| fluxcd/image-reflector-controller:v0.11.0 | fluxcd/resources/deployment/image-reflector-controller.yaml |
|
||||
| fluxcd/kustomize-controller:v0.13.1 | fluxcd/resources/deployment/kustomize-controller.yaml |
|
||||
| fluxcd/source-controller:v0.15.3 | fluxcd/resources/deployment/source-controller.yaml |
|
||||
|
||||
### 2. OCM
|
||||
|
||||
|Images|files|
|
||||
| :----:| :----: |
|
||||
|quay.io/open-cluster-management/registration-operator:latest|ocm-cluster-manager/resources/operator/operator.yaml|
|
||||
| Images | files |
|
||||
| :----------------------------------------------------------: | :--------------------------------------------------: |
|
||||
| quay.io/open-cluster-management/registration-operator:latest | ocm-cluster-manager/resources/operator/operator.yaml |
|
||||
|
||||
### 3. VelaUX
|
||||
|
||||
There is no need to modify the addon files for enabling this addon, you only need to sync these images and enable this addon with repo args to reference your own registry.
|
||||
|
||||
|Images|
|
||||
| :----:|
|
||||
|oamdev/vela-apiserver:v1.2.3|
|
||||
|oamdev/oamdev/velaux::v1.2.3|
|
||||
| Images |
|
||||
| :--------------------------: |
|
||||
| oamdev/vela-apiserver:v1.2.3 |
|
||||
| oamdev/oamdev/velaux::v1.2.3 |
|
||||
|
||||
eg:
|
||||
|
||||
```yaml
|
||||
$ vela addon enable addons/velaux/ repo=<仓库地址>
|
||||
$ vela addon enable addons/velaux/ repo=<addon-registry-url>
|
||||
```
|
||||
|
||||
### 4. Terraform
|
||||
|
|
|
@ -24,7 +24,7 @@ The official KubeVela CLI Docker image is hosted on DockerHub in the `oamdev/vel
|
|||
To run the KubeVela CLI Docker image, use the `docker run` command.
|
||||
|
||||
```
|
||||
$ docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli <command>
|
||||
```
|
||||
|
||||
This is how the command functions:
|
||||
|
|
|
@ -11,13 +11,13 @@ This section will introduce how to use OCM with KubeVela.
|
|||
The installation of OCM is directly available through `vela addon`. There are two addons you need to install if you want to use KubeVela with OCM.
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-hub-control-plane
|
||||
vela addon enable ocm-hub-control-plane
|
||||
```
|
||||
|
||||
This addon allows you to use the basic capabilities provided by OCM. For example, you can create OCM ManifestWorks to dispatch resources directly. But KubeVela will not use OCM for its application management for now.
|
||||
|
||||
```shell
|
||||
$ vela addon enable ocm-gateway-manager-addon
|
||||
vela addon enable ocm-gateway-manager-addon
|
||||
```
|
||||
|
||||
Enabling the second addon will allow you to let KubeVela use the underlying OCM managed clusters through cluster gateway.
|
||||
|
|
|
@ -12,7 +12,10 @@ Starting from here, you will learn to use the KubeVela Addons to install plug-in
|
|||
|
||||
- Choose a Helm Chart you want to deploy. In the tutorial, we take [bitnami/redis](https://github.com/bitnami/charts/tree/master/bitnami/redis) as an example.
|
||||
- Ensure that the cluster you deliver has a usable default StorageClass. Most of our delivery middleware requires data persistence, and the default StorageClass is needed to allocate PV.
|
||||
- Enable the VelaUX addon for UI console. If you are only CLI users, you can skip to [Deploy via CLI](#deploy-via-cli)
|
||||
- Make sure you have VelaUX addon enabled for UI console. If you are only CLI users, you can skip to [Deploy via CLI](#deploy-via-cli)
|
||||
```
|
||||
vela addon enable velaux
|
||||
```
|
||||
|
||||
## Enable fluxcd addon
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ In this section, we will introduce how to deploy a container-based application w
|
|||
## Before starting
|
||||
|
||||
- Containerize your business, you need a container image within your image registry that can be accessed by KubeVela.
|
||||
- Enable the [VelaUX addon](../reference/addons/velaux) by running command `vela addon enable velaux`.
|
||||
- Make sure you have [VelaUX addon](../reference/addons/velaux) enabled.
|
||||
```
|
||||
vela addon enable velaux
|
||||
```
|
||||
|
||||
## Creating an application
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
{
|
||||
"type": "category",
|
||||
"label": "Terraform",
|
||||
"collapsed": false,
|
||||
"collapsed": true,
|
||||
"link": {
|
||||
"type": "doc",
|
||||
"id": "end-user/components/cloud-services/cloud-resource-scenarios"
|
||||
|
@ -255,8 +255,14 @@
|
|||
},
|
||||
"items": [
|
||||
{
|
||||
"Addons": [
|
||||
"platform-engineers/addon/intro",
|
||||
"type": "category",
|
||||
"label": "Addons",
|
||||
"collapsed": true,
|
||||
"link": {
|
||||
"type": "doc",
|
||||
"id": "platform-engineers/addon/intro"
|
||||
},
|
||||
"items": [
|
||||
"platform-engineers/addon/addon-cue",
|
||||
"platform-engineers/addon/addon-yaml",
|
||||
"reference/topology-rule",
|
||||
|
|
Loading…
Reference in New Issue